Пример #1
0
        public ActionResult RemoveConfirm(int id)
        {
            Responses responses = EmployeeSalaryRepo.RemoveByComponentId(id);

            if (responses.Success)
            {
                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { success = false, message = "Error msg" }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult RemoveComponent(string bId, int scId)
        {
            List <EmployeeSalaryViewModel> models = EmployeeSalaryRepo.GetByBadgeId(bId, scId);

            if (models.Count > 0)
            {
                EmployeeSalaryViewModel model = models[0];
                return(PartialView("_RemoveComponent", model));
            }
            return(PartialView("_RemoveComponent", new EmployeeSalaryViewModel()));
        }
Пример #3
0
        public ActionResult GetSalaryComponent(int jobPositionId, int salaryComponentId)
        {
            EmployeeSalaryViewModel     model = EmployeeSalaryRepo.GetByComponentId(salaryComponentId);
            SalaryDefaultValueViewModel sd    = SalaryDefaultValueRepo.GetByJobPosition(jobPositionId, salaryComponentId);

            if (sd != null)
            {
                model.BasicValue = sd.Value;
            }
            return(PartialView("_GetSalaryComponent", model));
        }
Пример #4
0
        public ActionResult DeleteConfirm(int id)
        {
            Responses responses = (EmployeeSalaryRepo.Delete(id));

            if (responses.Success)
            {
                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { success = false, message = responses.Message }, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
 public ActionResult Edit(EmployeeSalaryViewModel model)
 {
     if (ModelState.IsValid)
     {
         Responses responses = EmployeeSalaryRepo.Update(model);
         if (responses.Success)
         {
             return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { success = false, message = "Error msg" }, JsonRequestBehavior.AllowGet));
         }
     }
     return(Json(new { success = false, message = "Invalid" }, JsonRequestBehavior.AllowGet));
 }
 public ActionResult Create(EmployeeSalaryViewModel model)
 {
     if (ModelState.IsValid)
     {
         Responses responses = EmployeeSalaryRepo.Update(model);
         if (responses.Success)
         {
             return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             return(Json(new { success = false, message = responses.Message }, JsonRequestBehavior.AllowGet));
         }
     }
     return(Json(new { success = false, message = ModelState.ToString() }, JsonRequestBehavior.AllowGet));
 }
Пример #7
0
 // POST api/<controller>
 public Responses Post([FromBody] EmployeeSalaryViewModel entity)
 {
     return(EmployeeSalaryRepo.Update(entity));
 }
Пример #8
0
 // GET api/<controller>/5
 public EmployeeSalaryViewModel Get(int id)
 {
     return(EmployeeSalaryRepo.GetById(id));
 }
Пример #9
0
 // GET api/<controller>
 public IEnumerable <EmployeeSalaryViewModel> Get()
 {
     return(EmployeeSalaryRepo.Get());
 }
Пример #10
0
        public ActionResult SavePayroll(List <EmployeeSalaryViewModel> models)
        {
            Responses responses = EmployeeSalaryRepo.SaveSalary(models);

            return(Json(new { response = responses }, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
 //GET Edit
 public ActionResult Edit(int id)
 {
     ViewBag.PayrollPeriodList   = new SelectList(PayrollPeriodRepo.Get(), "Id", "PeriodYear");
     ViewBag.SalaryComponentList = new SelectList(SalaryComponentRepo.Get(), "Id", "Description");
     return(View("_Edit", EmployeeSalaryRepo.GetById(id)));
 }
Пример #12
0
 //GET DETAILS
 public ActionResult Details(int id)
 {
     return(View(EmployeeSalaryRepo.GetById(id)));
 }
Пример #13
0
 //DELETE GET
 public ActionResult Delete(int id)
 {
     return(View("_Delete", EmployeeSalaryRepo.GetById(id)));
 }
Пример #14
0
 //EDIT GET
 public ActionResult Edit(int id)
 {
     return(View("_Edit", EmployeeSalaryRepo.GetById(id)));
 }
Пример #15
0
 public ActionResult List()
 {
     return(View("_List", EmployeeSalaryRepo.Get()));
 }
Пример #16
0
 // PUT api/<controller>/5
 public Responses Put(int id, [FromBody] EmployeeSalaryViewModel entity)
 {
     entity.Id = id;
     return(EmployeeSalaryRepo.Update(entity));
 }
Пример #17
0
 // DELETE api/<controller>/5
 public Responses Delete(int id)
 {
     return(EmployeeSalaryRepo.Delete(id));
 }
Пример #18
0
        public ActionResult EmployeePayroll(string badgeId)
        {
            List <EmployeeSalaryViewModel> empSalary = EmployeeSalaryRepo.GetByBadgeId(badgeId);

            return(PartialView("_EmployeePayroll", empSalary));
        }