Beispiel #1
0
        public void Remove(Guid id)
        {
            Absenteeism absenteeism = GetById(id);

            absenteeism.Status = DAL.Entity.Enum.Status.Deleted;
            Update(absenteeism);
        }
Beispiel #2
0
 public ActionResult Edit(Absenteeism absenteeism)
 {
     if (ModelState.IsValid)
     {
         absenteeismService.Update(absenteeism);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Beispiel #3
0
 public ActionResult Delete(Absenteeism absenteeism)
 {
     try
     {
         absenteeismService.Remove(absenteeism.ID);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Beispiel #4
0
 public void Update(Absenteeism absenteeism)
 {
     context.Entry(absenteeism).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     context.SaveChanges();
 }
Beispiel #5
0
 public void Add(Absenteeism absenteeism)
 {
     context.Absenteeisms.Add(absenteeism);
     context.SaveChanges();
 }