public ActionResult Save(System.Int32 id, string tag) { CurUser = Session["UserModel"] as SysUser; T_CKDModels model = new T_CKDModels(); //加载销售单列表 T_XSDModels xsdmode = new T_XSDModels(); xsdmode.DataModel = xsdmode.DataModel ?? new T_XSD(); xsdmode.DataList = T_XSDDomain.GetInstance().GetAllT_XSD(xsdmode.DataModel).Where(p => p.XSFLAG == Convert.ToInt32("1")).ToList(); ViewData["XSD"] = new SelectList(xsdmode.DataList, "XSID", "XSDH"); //加载仓库列表 T_CKModels ckmode = new T_CKModels(); ckmode.DataModel = ckmode.DataModel ?? new T_CK(); ckmode.DataList = T_CKDomain.GetInstance().GetAllT_CK(ckmode.DataModel); ViewData["CK"] = new SelectList(ckmode.DataList, "CKID", "CKMC"); //加载产品列表 T_YLCPModels ylcpQymode = new T_YLCPModels(); ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP(); ylcpQymode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == Convert.ToInt32("1")).ToList(); ViewData["YLCP"] = new SelectList(ylcpQymode.DataList, "CPID", "CPMC"); //获取本企业下的人员列表 T_Person person = new T_Person(); person.PsQYID = (int)CurUser.UserCompanyID; ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ"); model.DataModel = new T_CKD(); if (id != 0) { model.DataModel = T_CKDDomain.GetInstance().GetModelById(id); model.CKMXList = T_CKMXDomain.GetInstance().GetT_CKMXByCkid(id); if (model.DataModel.XSID != null && model.DataModel.XSID != 0) { var temp = T_XSDDomain.GetInstance().GetModelById(model.DataModel.XSID); if (temp != null) { model.XSDH = temp.XSDH; } } } else { model.DataModel.CKDH = T_CKDDomain.GetInstance().GetCkOrderNum(CurUser); model.DataModel.CKCJR = CurUser.UserAccount; model.DataModel.CKCJRQ = DateTime.Now; } model.Tag = tag; model.RoleCode = GetRoleCode(); return(View("~/Views/T_CKD/Save.cshtml", model)); }
public ActionResult Details(System.Int32 id) { T_CKDModels model = new T_CKDModels(); model.DataModel = new T_CKD(); model.DataModel.CKID = id; var str = ExportExcelPR(id); var str2 = ExportExcelPR2(id); ViewData["ParaStr"] = str.Replace("\r\n", "<br />"); ViewData["ParaStr2"] = str2.Replace("\r\n", "<br />"); return(View("~/Views/T_CKD/Details.cshtml", model)); }
public ActionResult Save(System.Int32 id, string tag) { T_CKMXModels model = new T_CKMXModels(); model.DataModel = new T_CKMX(); Int32 did = id; if (tag != "Add") { model.DataModel = T_CKMXDomain.GetInstance().GetModelById(id); did = model.DataModel.CKDID ?? 0; } //加载仓库列表 T_CKModels ckmode = new T_CKModels(); ckmode.DataModel = ckmode.DataModel ?? new T_CK(); ckmode.DataList = T_CKDomain.GetInstance().GetAllT_CK(ckmode.DataModel); ViewData["CK"] = new SelectList(ckmode.DataList, "CKID", "CKMC"); //加载产品列表 T_YLCPModels ylcpQymode = new T_YLCPModels(); ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP(); ylcpQymode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == Convert.ToInt32("1")).ToList(); ViewData["YLCP"] = new SelectList(ylcpQymode.DataList, "CPID", "CPMC"); //加载出库单列表 T_CKDModels ckdQymode = new T_CKDModels(); ckdQymode.DataModel = ckdQymode.DataModel ?? new T_CKD(); T_CKD ckd = T_CKDDomain.GetInstance().GetModelById(did); ckdQymode.DataList = new List <T_CKD>(); ckdQymode.DataList.Add(ckd); ViewData["CKD"] = new SelectList(ckdQymode.DataList, "CKID", "CKMC"); //if (id != 0) //{ // model.DataModel = T_CKMXDomain.GetInstance().GetModelById(id); //} model.Tag = tag; return(View("~/Views/T_CKMX/Save.cshtml", model)); }
public ActionResult CKMXTable(System.Int32 id, string ckdh, int canEdit) { T_CKDModels model = new T_CKDModels(); if (id != 0) { model.CKMXList = T_CKMXDomain.GetInstance().GetT_CKMXByCkid(id); } else { model.CKMXList = T_CKMXDomain.GetInstance().GetT_CKMXByCkdh(ckdh); } model.RoleCode = GetRoleCode(); model.DataModel = new T_CKD(); model.DataModel.CKID = id; return(View("~/Views/T_CKMX/CKMXTable.cshtml", model)); }
public void Save(T_CKDModels model) { int result = 0; try { if (model.Tag == "Add") { var temp = T_CKDDomain.GetInstance().GetAllModels <string>(p => p.CKDH == model.DataModel.CKDH).FirstOrDefault(); if (temp != null && temp.XSID != 0) { var CurUser1 = Session["UserModel"] as SysUser; model.DataModel.CKDH = T_CKDDomain.GetInstance().GetCkOrderNum(CurUser1); } result = T_CKDDomain.GetInstance().AddModel(model.DataModel); } else if (model.Tag == "Edit") { result = T_CKDDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.CKID); } if (model.DataModel.IsFinish == 1 && model.DataModel.XSID != 0) { T_XSDDomain.GetInstance().UpdateFinish((int)model.DataModel.XSID); } } catch { } Response.ContentType = "text/json"; if (result > 0) { Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_CKD/Index\"}"); } else { Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}"); } }
public ActionResult Index(T_CKDModels evalModel) { try { evalModel.currentPage = int.Parse(Request["pageNum"].ToString()); } catch { } string order = ""; try { order = Request["orderField"].ToString(); } catch { } if (order.Trim() == "${param.orderField}") { order = ""; } int pagesize = Convert.ToInt32(evalModel.pageSize); int pagecount = Convert.ToInt32(evalModel.pagecount); int currentPage = Convert.ToInt32(evalModel.currentPage); evalModel.DataModel = evalModel.DataModel ?? new T_CKD(); if (Request["strCKDName"] != null) //出库单号 { string str = Request["strCKDName"].ToString(); if (!String.IsNullOrEmpty(str)) { evalModel.DataModel.CKDH = str.Trim(); } ViewData["strCKDName"] = str; } if (Request["strCKDMC"] != null) //出库单名称 { string str = Request["strCKDMC"].ToString(); if (!String.IsNullOrEmpty(str)) { evalModel.DataModel.CKMC = str.Trim(); } } var ghId = 0; if (Request["strCKDGHQY"] != null) { var str = Request["strCKDGHQY"].ToString(); if (!string.IsNullOrEmpty(str)) { ghId = Convert.ToInt32(str); } ViewData["strCKDGHQY"] = str; } var cpId = 0; //产品名称 if (Request["strCKDCPMC"] != null) { string str = Request["strCKDCPMC"].ToString(); if (!String.IsNullOrEmpty(str)) { cpId = Convert.ToInt32(str); } ViewData["strCKDCPMC"] = str; } var scId = 0; //生产企业ID if (Request["strCKDSCQY"] != null) { string str = Request["strCKDSCQY"].ToString(); if (!String.IsNullOrEmpty(str)) { scId = Convert.ToInt32(str); } ViewData["strCKDSCQY"] = str; } //购货企业列表 T_CusQY cusqy = new T_CusQY(); ViewBag.CUSQY = new SelectList(T_CusQYDomain.GetInstance().GetAllT_CusQY(cusqy).Where(p => p.CusStatus == 1).ToList(), "CusID", "CusMC"); T_SupQYModels supmode = new T_SupQYModels(); supmode.DataModel = supmode.DataModel ?? new T_SupQY(); supmode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList(); ViewData["SupQYList"] = new SelectList(supmode.DataList, "SupID", "SupMC"); T_YLCPModels ylcpQymode = new T_YLCPModels(); ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP(); ylcpQymode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == 1).ToList(); ViewData["YLCP"] = new SelectList(ylcpQymode.DataList, "CPID", "CPMC"); evalModel.DataList = T_CKDDomain.GetInstance().PageT_CKD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, cpId, scId, ghId, out pagecount, out resultCount); evalModel.resultCount = resultCount; return(View("~/Views/T_CKD/Index.cshtml", evalModel)); }