public ActionResult DeleteConfirm(int id)
        {
            Responses responses = PayrollPeriodRepo.Delete(id);

            if (responses.Success)
            {
                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { success = false, message = "Error msg" }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
 public ActionResult SelectedPeriod(int id)
 {
     if (PayrollPeriodRepo.SelectPeriod(id))
     {
         return(Json(new { success = true, description = PayrollPeriodRepo.SelectedPeriod.Description }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(new { success = false, description = PayrollPeriodRepo.SelectedPeriod.Description }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #3
0
 public ActionResult Edit(PayrollPeriodViewModel model)
 {
     if (ModelState.IsValid)
     {
         Responses responses = PayrollPeriodRepo.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));
 }
 public ActionResult Create(PayrollPeriodViewModel model)
 {
     if (ModelState.IsValid)
     {
         Responses responses = PayrollPeriodRepo.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));
 }
Beispiel #5
0
 public ActionResult Delete(int Id)
 {
     return(View("_Delete", PayrollPeriodRepo.GetById(Id)));
 }
Beispiel #6
0
 public ActionResult Edit(int Id)
 {
     return(View("_Edit", PayrollPeriodRepo.GetById(Id)));
 }
Beispiel #7
0
 public ActionResult List()
 {
     return(View("_List", PayrollPeriodRepo.Get()));
 }
Beispiel #8
0
 public ActionResult SelectPeriod()
 {
     return(PartialView("_SelectPeriod", PayrollPeriodRepo.Get()));
 }
Beispiel #9
0
 // DELETE api/<controller>/5
 public Responses Delete(int id)
 {
     return(PayrollPeriodRepo.Delete(id));
 }
Beispiel #10
0
 // PUT api/<controller>/5
 public Responses Put(int id, [FromBody] PayrollPeriodViewModel entity)
 {
     entity.Id = id;
     return(PayrollPeriodRepo.Update(entity));
 }
Beispiel #11
0
 // POST api/<controller>
 public Responses Post([FromBody] PayrollPeriodViewModel entity)
 {
     return(PayrollPeriodRepo.Update(entity));
 }
Beispiel #12
0
 // GET api/<controller>/5
 public PayrollPeriodViewModel Get(int id)
 {
     return(PayrollPeriodRepo.GetById(id));
 }
Beispiel #13
0
 // GET api/<controller>
 public IEnumerable <PayrollPeriodViewModel> Get()
 {
     return(PayrollPeriodRepo.Get());
 }
 //GET DETAILS
 public ActionResult Details(int id)
 {
     return(View(PayrollPeriodRepo.GetById(id)));
 }
Beispiel #15
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)));
 }
Beispiel #16
0
 //GET CREATE
 public ActionResult Create()
 {
     ViewBag.PayrollPeriodList   = new SelectList(PayrollPeriodRepo.Get(), "Id", "PeriodYear");
     ViewBag.SalaryComponentList = new SelectList(SalaryComponentRepo.Get(), "Id", "Description");
     return(View("_Create"));
 }