public void Delete(TimeAttendanceTypeViewModel model) { var item = _repository.FindById(model.Id); if (item != null) { _repository.Delete(item); } }
public ActionResult Delete(TimeAttendanceTypeViewModel model) { try { service.Delete(model); service.Save(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(TimeAttendanceTypeViewModel model) { try { if (ModelState.IsValid) { service.Update(model); service.Save(); return(RedirectToAction("Index")); } return(View(model)); } catch { return(View()); } }
public void Update(TimeAttendanceTypeViewModel model) { var contractType = AutoMapper.Mapper.Map <TimeAttendanceTypeViewModel, TimeAttendanceType>(model); _repository.Update(contractType); }
public void Insert(TimeAttendanceTypeViewModel model) { var contractType = AutoMapper.Mapper.Map <TimeAttendanceTypeViewModel, TimeAttendanceType>(model); _repository.Add(contractType); }