public void Save(T_JYFWModels model) { int result = 0; try { if (model.Tag == "Add") { result = T_JYFWDomain.GetInstance().AddModel(model.DataModel); } else if (model.Tag == "Edit") { result = T_JYFWDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.FWID); } } catch { } Response.ContentType = "text/json"; if (result > 0) { Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_JYFW/Index\"}"); } else { Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}"); } }
public ActionResult Index(T_JYFWModels 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_JYFW(); evalModel.DataList = T_JYFWDomain.GetInstance().PageT_JYFW(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount); evalModel.resultCount = resultCount; return(View("~/Views/T_JYFW/Index.cshtml", evalModel)); }
public ActionResult Save(System.Int32 id, string tag) { T_JYFWModels model = new T_JYFWModels(); model.DataModel = new T_JYFW(); if (id != 0) { model.DataModel = T_JYFWDomain.GetInstance().GetModelById(id); } model.Tag = tag; return(View("~/Views/T_JYFW/Save.cshtml", model)); }
public ActionResult Save(System.Int32 id, string tag) { T_WhsQYModels model = new T_WhsQYModels(); model.DataModel = new T_WhsQY(); if (id != 0) { model.DataModel = T_WhsQYDomain.GetInstance().GetModelById(id); model.WhsQYZZList = T_WhsQYZZDomain.GetInstance().GetQYZZByQyid(id); } //经营范围(下) T_JYFWModels jyfwmodels = new T_JYFWModels(); jyfwmodels.DataModel = jyfwmodels.DataModel ?? new T_JYFW(); model.JYFWList = T_JYFWDomain.GetInstance().GetAllT_JYFW(jyfwmodels.DataModel).ToList(); model.Tag = tag; GetRoleCode(model); return(View("~/Views/T_WhsQY/Save.cshtml", model)); }