public void Remove(Guid id)
        {
            MontlyPlan montlyPlan = GetById(id);

            montlyPlan.Status = DAL.Entity.Enum.Status.Deleted;
            Update(montlyPlan);
        }
示例#2
0
 public IActionResult Create(MontlyPlan model)
 {
     if (ModelState.IsValid)
     {
         mountlyPlanService.Add(model);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
示例#3
0
 public ActionResult Edit(MontlyPlan model)
 {
     if (ModelState.IsValid)
     {
         mountlyPlanService.Update(model);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
示例#4
0
        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();
 }
示例#7
0
        public ActionResult Edit(Guid id)
        {
            MontlyPlan mountlyPlan = mountlyPlanService.GetById(id);

            return(View(mountlyPlan));
        }