// // GET: /Project/budget/Details/5 //public ActionResult Details(int id) //{ // return View(); // GET: /Project/ProjectBasedata/Create public ActionResult Create() { var ProjectList = this.ProjectService.GetProjectBasedataList(new ProjectRequest()); this.ViewBag.ProjectBasedataID = new SelectList(ProjectList, "ID", "PName"); var model = new InsBudgetInfo(); return(View("Edit", model)); } //
public void SaveInsBudget(InsBudgetInfo insbudget) { using (var dbContext = new ProjectDbContext()) { if (insbudget.ID > 0) { dbContext.Update <InsBudgetInfo>(insbudget); } else { dbContext.Insert <InsBudgetInfo>(insbudget); } } }
public ActionResult Create(FormCollection collection) { var model = new InsBudgetInfo(); this.TryUpdateModel <InsBudgetInfo>(model); if (model.InsWarranty != null) { model.InsBudgetTotal += (int)model.InsWarranty; } if (model.InsSubcontracting != null) { model.InsBudgetTotal += (int)model.InsSubcontracting; } if (model.InsOtherBudget != null) { model.InsBudgetTotal += (int)model.InsOtherBudget; } this.ProjectService.SaveInsBudget(model); return(this.RefreshParent()); }