Beispiel #1
0
 public ActionResult Edit(Complaint model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _complaint.Update(model);
             TempData["Msg"] = _help.getMsg(AlertType.success.ToString(), "Updated successfully!");
             return(RedirectToAction("Index"));
         }
         else
         {
             return(Json(new { IsAuthenticated = true, IsSuccessful = false, Error = "Please fill the form correctly!" }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { IsAuthenticated = true, IsSuccessful = false, Error = ex.Message }));
     }
 }
Beispiel #2
0
 public ComplaintModel UpdateComplaint(ComplaintModel model)
 {
     //unitOfWork.StartTransaction();
     ComplaintRepository repo = new ComplaintRepository(unitOfWork);
     ComplaintModel complaintModel = new ComplaintModel();
     Complaint complaint = new Complaint();
     complaint = repo.GetAll().Where(x => x.ComplaintId == model.ComplaintId).FirstOrDefault();
     AutoMapper.Mapper.Map(model, complaint);
     repo.Update(complaint);
     //unitOfWork.Commit();
     return complaintModel;
 }
Beispiel #3
0
 public void UpdateComplaint(Condtion condt)
 {
     complaintRepository.Update(condt);
 }