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)); }
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())); }
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)); }
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)); }
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)); }
// POST api/<controller> public Responses Post([FromBody] EmployeeSalaryViewModel entity) { return(EmployeeSalaryRepo.Update(entity)); }
// GET api/<controller>/5 public EmployeeSalaryViewModel Get(int id) { return(EmployeeSalaryRepo.GetById(id)); }
// GET api/<controller> public IEnumerable <EmployeeSalaryViewModel> Get() { return(EmployeeSalaryRepo.Get()); }
public ActionResult SavePayroll(List <EmployeeSalaryViewModel> models) { Responses responses = EmployeeSalaryRepo.SaveSalary(models); return(Json(new { response = responses }, JsonRequestBehavior.AllowGet)); }
//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))); }
//GET DETAILS public ActionResult Details(int id) { return(View(EmployeeSalaryRepo.GetById(id))); }
//DELETE GET public ActionResult Delete(int id) { return(View("_Delete", EmployeeSalaryRepo.GetById(id))); }
//EDIT GET public ActionResult Edit(int id) { return(View("_Edit", EmployeeSalaryRepo.GetById(id))); }
public ActionResult List() { return(View("_List", EmployeeSalaryRepo.Get())); }
// PUT api/<controller>/5 public Responses Put(int id, [FromBody] EmployeeSalaryViewModel entity) { entity.Id = id; return(EmployeeSalaryRepo.Update(entity)); }
// DELETE api/<controller>/5 public Responses Delete(int id) { return(EmployeeSalaryRepo.Delete(id)); }
public ActionResult EmployeePayroll(string badgeId) { List <EmployeeSalaryViewModel> empSalary = EmployeeSalaryRepo.GetByBadgeId(badgeId); return(PartialView("_EmployeePayroll", empSalary)); }