123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using LeaRun.Application.Busines.DMAManage;
- using LeaRun.Application.Code;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace LeaRun.Application.Web.Areas.DMAManage.Controllers
- {
- public class PartitionManageController : MvcControllerBase
- {
- // DMA分区管理功能
- // GET: /WaterWellManage/Alert/
- PartitionsManageBLL manageBLL = new PartitionsManageBLL();
- #region 视图功能
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult AddDMAForm()
- {
- return View();
- }
- #endregion
- #region 获取DMA分区信息
- /// <summary>
- /// 获取DMA分区信息
- /// </summary>
- /// <param name="DMACode"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult GetDMAData(string DMACode)
- {
- return Content(manageBLL.GetDMAData(DMACode));
- }
- #endregion
- #region 修改DMA分区信息
- /// <summary>
- /// 修改DMA分区信息
- /// </summary>
- /// <param name="data"></param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult EditDMAData(string data)
- {
- string userId = OperatorProvider.Provider.Current().UserId;
- string companyId = OperatorProvider.Provider.Current().CompanyId;
- switch (manageBLL.EditDMAData(data, userId, companyId))
- {
- case 0:
- return Error("修改失败。");
- case 1:
- return Success("修改成功。");
- case 2:
- return Error("已存在该名称分区。");
- default:
- return Error("修改失败。");
- }
- }
- #endregion
- #region 添加DMA分区信息
- /// <summary>
- /// 添加DMA分区信息
- /// </summary>
- /// <param name="keyValue"></param>
- /// <param name="data"></param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult AddDMAData(string keyValue, string data)
- {
- string userId = OperatorProvider.Provider.Current().UserId;
- string companyId = OperatorProvider.Provider.Current().CompanyId;
- switch (manageBLL.AddDMAData(keyValue, data, userId, companyId))
- {
- case 0:
- return Error("添加失败。");
- case 1:
- return Success("添加成功。");
- case 2:
- return Error("已存在该名称分区。");
- default:
- return Error("添加失败。");
- }
- }
- #endregion
- #region 删除DMA分区信息
- /// <summary>
- /// 删除DMA分区信息
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult DeleteDMAData(string keyValue)
- {
- int result = manageBLL.DeleteDMAData(keyValue);
- switch (result) {
- case 0:
- return Error("删除失败!");
- case 1:
- return Success("删除成功。");
- case 2:
- return Error("删除失败,DMA考核表关系表中存在依赖数据!");
- case 3:
- return Error("删除失败,该分区有未删除的子分区!");
- default:
- return Error("删除失败!");
- }
- }
- #endregion
- }
- }
|