コード例 #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 }));
     }
 }
コード例 #2
0
ファイル: ComplaintService.cs プロジェクト: codedive/MyDemo1
 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;
 }
コード例 #3
0
 public void UpdateComplaint(Condtion condt)
 {
     complaintRepository.Update(condt);
 }