public ActionResult Create(FormCollection collection) { var model = new OfficeCtrl(); this.TryUpdateModel <OfficeCtrl>(model); model.oddnum = model.CreateTime.ToFileTimeUtc().ToString(); this.ProjectService.SaveOfficeCtrl(model); return(this.RefreshParent()); }
public void SaveOfficeCtrl(OfficeCtrl offices) { using (var dbContext = new ProjectDbContext()) { if (offices.ID > 0) { dbContext.Update <OfficeCtrl>(offices); } else { dbContext.Insert <OfficeCtrl>(offices); } } }
// // GET: /Cms/Office/Create public ActionResult Create() { var model = new OfficeCtrl(); return(View("Edit", model)); }