// // GET: /Cms/Oddments/Create public ActionResult Create() { var model = new Oddments(); this.RenderMyViewData(model); var ProjectBasedataIDList = this.ProjectService.GetProjectBasedataList(new ProjectRequest()); this.ViewBag.ProjectBasedataID = new SelectList(ProjectBasedataIDList, "ID", "PName"); return View("Edit", model); }
public ActionResult Create(FormCollection collection) { var model = new Oddments(); this.TryUpdateModel<Oddments>(model); model.ChangTime = model.CreateTime.ToCnDataString(); this.ProjectService.SaveOddments(model); return this.RefreshParent(); }
// // GET: /Cms/Oddments/ public ActionResult Index(OddmentsRequest requset) { var model = new Oddments(); this.RenderMyViewData(model); var ProjectBasedataIDList = this.ProjectService.GetProjectBasedataList(new ProjectRequest()); this.ViewBag.ProjectBasedataID = new SelectList(ProjectBasedataIDList, "ID", "PName"); var result = this.ProjectService.GetOddmentsList(requset); return View(result); }
// // GET: /Cms/Oddments/Create public ActionResult Create() { var model = new Oddments() { }; return View("Edit", model); }
public void SaveOddments(Oddments oddments) { using (var dbContext = new ProjectDbContext()) { if (oddments.ID > 0) { dbContext.Update<Oddments>(oddments); } else { dbContext.Insert<Oddments>(oddments); } } }
private void RenderMyViewData(Oddments model) { ViewData.Add("OType", new SelectList(EnumHelper.GetItemValueList<EnumOType>(), "Key", "Value", model.OType)); }