예제 #1
0
        public void Delete(TimeAttendanceTypeViewModel model)
        {
            var item = _repository.FindById(model.Id);

            if (item != null)
            {
                _repository.Delete(item);
            }
        }
예제 #2
0
 public ActionResult Delete(TimeAttendanceTypeViewModel model)
 {
     try
     {
         service.Delete(model);
         service.Save();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #3
0
        public ActionResult Edit(TimeAttendanceTypeViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    service.Update(model);
                    service.Save();
                    return(RedirectToAction("Index"));
                }

                return(View(model));
            }
            catch
            {
                return(View());
            }
        }
예제 #4
0
        public void Update(TimeAttendanceTypeViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <TimeAttendanceTypeViewModel, TimeAttendanceType>(model);

            _repository.Update(contractType);
        }
예제 #5
0
        public void Insert(TimeAttendanceTypeViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <TimeAttendanceTypeViewModel, TimeAttendanceType>(model);

            _repository.Add(contractType);
        }