public void Delete(SalaryLevelViewModel model)
        {
            var item = _repository.FindById(model.Id);

            if (item != null)
            {
                _repository.Delete(item);
            }
        }
        // GET: SalaryLevel/Create
        public ActionResult Create()
        {
            var model      = new SalaryLevelViewModel();
            var workTitles = _workTitleService.GetWorkTitles();

            ViewBag.WorkTitles  = new SelectList(workTitles, "Id", "Name");
            model.EffectiveDate = DateTime.Now.ToLocalTime();
            return(View(model));
        }
 public ActionResult Delete(SalaryLevelViewModel model)
 {
     try
     {
         service.Delete(model);
         service.Save();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Edit(SalaryLevelViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    service.Update(model);
                    service.Save();
                    return(RedirectToAction("Index"));
                }

                return(View(model));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Create(SalaryLevelViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    //model.MonthlySalary = model.MonthlySalary.ToString().de;
                    service.Insert(model);
                    service.Save();
                    return(RedirectToAction("Index"));
                }

                var workTitles = _workTitleService.GetWorkTitles();
                ViewBag.WorkTitles = new SelectList(workTitles, "Id", "Name");
                return(View(model));
            }
            catch
            {
                return(View());
            }
        }
        public void Update(SalaryLevelViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <SalaryLevelViewModel, SalaryLevel>(model);

            _repository.Update(contractType);
        }
        public void Insert(SalaryLevelViewModel model)
        {
            var contractType = AutoMapper.Mapper.Map <SalaryLevelViewModel, SalaryLevel>(model);

            _repository.Add(contractType);
        }