public async Task <IActionResult> Edit(int id, [Bind("ID,ProjectId,AssignedBy,WBSSummary,WBSHours,StartDate,EndDate,WBSCost")] WBSModel wBSModel) { if (id != wBSModel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wBSModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WBSModelExists(wBSModel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(wBSModel)); }
public async Task <IActionResult> Create([Bind("ID,ProjectId,AssignedBy,WBSSummary,WBSHours,StartDate,EndDate,WBSCost")] WBSModel wBSModel) { if (ModelState.IsValid) { _context.Add(wBSModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(wBSModel)); }
public async Task <IActionResult> CreateWBS(WBSCreateVM model) { var WBS = new WBSModel { AssignedBy = model.AssignedBy, ProjectId = model.ProjectId, WBSSummary = model.WBSSummary, WBSCost = model.WBSCost, WBSHours = model.WBSHours, StartDate = model.StartDate, EndDate = model.EndDate }; await _context.WorkBreakDowns.AddAsync(WBS); await _context.SaveChangesAsync(); ViewBag.Msg = "Successfully Added New WBS"; return(View(model)); }