public void Remove(Guid id) { MontlyPlan montlyPlan = GetById(id); montlyPlan.Status = DAL.Entity.Enum.Status.Deleted; Update(montlyPlan); }
public IActionResult Create(MontlyPlan model) { if (ModelState.IsValid) { mountlyPlanService.Add(model); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(MontlyPlan model) { if (ModelState.IsValid) { mountlyPlanService.Update(model); return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Delete(MontlyPlan model) { try { mountlyPlanService.Remove(model.ID); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public void Update(MontlyPlan montlyPlan) { context.Entry(montlyPlan).State = Microsoft.EntityFrameworkCore.EntityState.Modified; context.SaveChanges(); }
public void Add(MontlyPlan montlyPlan) { context.MontlyPlans.Add(montlyPlan); context.SaveChanges(); }
public ActionResult Edit(Guid id) { MontlyPlan mountlyPlan = mountlyPlanService.GetById(id); return(View(mountlyPlan)); }