Exemple #1
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));
 }
Exemple #3
0
 // PUT api/<controller>/5
 public Responses Put(int id, [FromBody] PayrollPeriodViewModel entity)
 {
     entity.Id = id;
     return(PayrollPeriodRepo.Update(entity));
 }
Exemple #4
0
 // POST api/<controller>
 public Responses Post([FromBody] PayrollPeriodViewModel entity)
 {
     return(PayrollPeriodRepo.Update(entity));
 }