示例#1
0
 public IHttpActionResult AddComplaint(ComplaintBindingModel model)
 {
     try
     {
         ComplaintBindingModel complaintBindingModel = new ComplaintBindingModel();
         ComplaintModel complaintModel = new ComplaintModel();
         AutoMapper.Mapper.Map(model,complaintModel);
         complaintModel = complaintService.InsertComplaint(complaintModel);
         AutoMapper.Mapper.Map(complaintModel, complaintBindingModel);
         return Ok(complaintBindingModel);
     }
     catch (Exception ex)
     {
         return BadRequest(ex.Message);
     }
 }
示例#2
0
 public IHttpActionResult UpdateComplaint(int complaintId)
 {
     try {
         ComplaintBindingModel complaintBindingModel = new ComplaintBindingModel();
         ComplaintModel complaintModel = new ComplaintModel();
         complaintModel = complaintService.GetComplaintByComplaintId(complaintId);
         complaintModel.Status = ComplaintStatus.Close;
         complaintModel = complaintService.UpdateComplaint(complaintModel);
         AutoMapper.Mapper.Map(complaintModel, complaintBindingModel);
         return Ok(complaintBindingModel);
     }
     catch(Exception ex)
     {
         return BadRequest(ex.Message);
     }
 }
示例#3
0
 public IHttpActionResult GetComplaintByComplaintId(int complaintId)
 {
     ComplaintBindingModel complaintBindingModel = new ComplaintBindingModel();
     ComplaintModel complaintModel = new ComplaintModel();
     // AutoMapper.Mapper.Map(jobBindingModel, jobModel);
     complaintModel = complaintService.GetComplaintDetailByComplaintId(complaintId);
     AutoMapper.Mapper.Map(complaintModel, complaintBindingModel);
     return Ok(complaintBindingModel);
 }