using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Collections; using Estsh.Web.Service; using Estsh.Web.Util; /*************************************************************************************************** * * 作者:龚泽宇 * 创建时间:2015.12.21 * 描述:发运管理 * 修改日志:龚泽宇 * * *************************************************************************************************/ namespace Estsh.Core.Web.Controllers { /// /// 发运管理 /// public class ShipManagementController : Controller { private ShipManagementService service = new ShipManagementService(); // // GET: /ShipManagement/ public ActionResult Index() { return View(); } /// /// 获取客户产线列表 /// /// public ActionResult GetCustPDLine() { Hashtable result = new Hashtable(); ArrayList list = this.service.GetCustPDLine(); result.Add("list", list); return Json(result, JsonRequestBehavior.AllowGet); } /// /// 状态变更 /// /// /// public ActionResult stateChanges(string ids, string count) { Hashtable result = new Hashtable(); string a = "-1"; if (string.IsNullOrEmpty(count) && ids == "null") { result.Add("list", "数据异常,请重新操作!"); } else if (count == "已打印") { a = "0"; } else if (count == "未打印") { a = "1"; } string message = ""; int iCount = this.service.stateChanges(ids, a); if (iCount > 0) { message = "变更成功。"; } else { message = "变更失败。"; } ArrayList list = new ArrayList(); result.Add("message", message); return Json(result, JsonRequestBehavior.AllowGet); } /// /// 根据分页条件获取用户列表 /// /// /// /// /// /// public ActionResult getShipManagementListByPage(String account, Pager pager, String direction, String sort, string cbCustPDLine, string txtStartTime, string txtEndTime, string txtStartSeq, string txtEndSeq) { if (string.IsNullOrEmpty(cbCustPDLine) || cbCustPDLine == "null") { return Json(""); } if (string.IsNullOrEmpty(txtStartTime)) { return Json(""); } if (string.IsNullOrEmpty(txtEndTime)) { return Json(""); } Hashtable result = new Hashtable(); result.Add("pager.pageNo", pager.pageNo); Hashtable dataHt = this.service.getShipManagementListByPage(pager, direction, sort, cbCustPDLine, txtStartTime, txtEndTime, txtStartSeq, txtEndSeq); result.Add("rows", dataHt["dataList"]); result.Add("pager.totalRows", dataHt["totalCount"]); result.Add("sort", sort); result.Add("direction", direction); return Json(result); } } }