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 })); } }
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; }
public void UpdateComplaint(Condtion condt) { complaintRepository.Update(condt); }