123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- using LeaRun.Application.Entity.CustomerManage;
- using LeaRun.Application.Busines.CustomerManage;
- using LeaRun.Util;
- using LeaRun.Util.WebControl;
- using System.Web.Mvc;
- using LeaRun.Application.Busines.SystemManage;
- using LeaRun.Application.Code;
- using LeaRun.Application.Entity.BaseManage;
- namespace LeaRun.Application.Web.Areas.CustomerManage.Controllers
- {
- /// <summary>
- /// 版 本 6.1
- /// Copyright (c) 2013-2016 上海力软信息技术有限公司
- /// 创 建:佘赐雄
- /// 日 期:2016-03-12 10:50
- /// 描 述:商机信息
- /// </summary>
- public class ChanceController : MvcControllerBase
- {
- private ChanceBLL chancebll = new ChanceBLL();
- private CodeRuleBLL codeRuleBLL = new CodeRuleBLL();
- #region 视图功能
- /// <summary>
- /// 商机列表页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 商机表单页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult Form()
- {
- if (Request["keyValue"] == null)
- {
- ViewBag.EnCode = codeRuleBLL.GetBillCode(SystemInfo.CurrentUserId, SystemInfo.CurrentModuleId);
- }
- return View();
- }
- /// <summary>
- /// 商机明细页面
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult Detail()
- {
- return View();
- }
- #endregion
- #region 获取数据
- /// <summary>
- /// 获取商机列表
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns>返回分页列表Json</returns>
- [HttpGet]
- public ActionResult GetPageListJson(Pagination pagination, string queryJson)
- {
- var watch = CommonHelper.TimerStart();
- var data = chancebll.GetPageList(pagination, queryJson);
- var jsonData = new
- {
- rows = data,
- total = pagination.total,
- page = pagination.page,
- records = pagination.records,
- costtime = CommonHelper.TimerEnd(watch)
- };
- return ToJsonResult(jsonData);
- }
- /// <summary>
- /// 获取商机实体
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns>返回对象Json</returns>
- [HttpGet]
- public ActionResult GetFormJson(string keyValue)
- {
- var data = chancebll.GetEntity(keyValue);
- return ToJsonResult(data);
- }
- #endregion
- #region 验证数据
- /// <summary>
- /// 商机名称不能重复
- /// </summary>
- /// <param name="FullName">名称</param>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult ExistFullName(string FullName, string keyValue)
- {
- bool IsOk = chancebll.ExistFullName(FullName, keyValue);
- return Content(IsOk.ToString());
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除商机数据
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- [HandlerAuthorize(PermissionMode.Enforce)]
- public ActionResult RemoveForm(string keyValue)
- {
- chancebll.RemoveForm(keyValue);
- return Success("删除成功。");
- }
- /// <summary>
- /// 保存商机表单(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <param name="entity">实体对象</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, ChanceEntity entity)
- {
- chancebll.SaveForm(keyValue, entity);
- return Success("操作成功。");
- }
- /// <summary>
- /// 商机作废
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult Invalid(string keyValue)
- {
- chancebll.Invalid(keyValue);
- return Success("作废成功。");
- }
- /// <summary>
- /// 商机转换客户
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult ToCustomer(string keyValue)
- {
- chancebll.ToCustomer(keyValue);
- return Success("转换成功。");
- }
- #endregion
- }
- }
|