public ActionResult Edit(int id) { string query = string.Format("&appid={0}&tabid={1}&flag={2}", Request.QueryString["appid"], Request.QueryString["tabid"], Request.QueryString["flag"]); RoadFlow.Data.Model.EnterpriseInfo model = new RoadFlow.Platform.EnterpriseInfo().Get <RoadFlow.Data.Model.EnterpriseInfo>(new KeyValuePair <string, object>("ID", id)); return(View(model)); }
public ActionResult Index(FormCollection collection) { DataTable dt = new DataTable(); string keyword = string.Empty; string pager = string.Empty; string wher = string.Empty; string query = string.Empty; string TYSHXYDM = string.Empty; Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where = new Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object>(); if (collection != null) { if (!TYSHXYDM.IsNullOrEmpty()) { keyword = Request["Keyword"]; where.Add(new KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>("TYSHXYDM", RoadFlow.Data.Model.SQLFilterType.CHARINDEX), keyword); } } query = string.Format("&appid={0}&tabid={1}&Keyword={2}&flag={3}", Request.QueryString["appid"], Request.QueryString["tabid"], keyword, Request.QueryString["flag"]); RoadFlow.Platform.EnterpriseInfo infoDb = new RoadFlow.Platform.EnterpriseInfo(); dt = infoDb.GetPagerData(out pager, query, pageSize, RoadFlow.Utility.Tools.GetPageNumber(), where); ViewBag.DisplayName = MyExtensions.GetModelDispalyName <RoadFlow.Data.Model.EnterpriseInfo>(new List <string>() { "Name", "TYSHXYDM", "Type", "ArtificialPerson" }); ViewBag.Pager = pager; ViewBag.Keyword = keyword; return(View(dt)); }
public ActionResult Edit(RoadFlow.Data.Model.EnterpriseInfo model, int keyId) { //RoadFlow.Data.Model.EnterpriseInfo model = new RoadFlow.Platform.EnterpriseInfo().Get<RoadFlow.Data.Model.EnterpriseInfo>(new KeyValuePair<string, object>("ID", keyId)); int result = new RoadFlow.Platform.EnterpriseInfo().Update(model, keyId); if (result > 0) { return(RedirectToAction("Index", new { appid = Request["appid"] })); } return(View()); }