Beispiel #1
0
 private void UpdateSurveyMap(UpdateFeedBackViewModel updateFeedback, Feedback feedback)
 {
     feedback.Age              = updateFeedback.Age;
     feedback.Comment          = updateFeedback.Comment;
     feedback.CommentDateTime  = updateFeedback.CommentDateTime;
     feedback.CreatedBy        = updateFeedback.CreatedBy;
     feedback.Evaluation       = updateFeedback.Evaluation;
     feedback.Gender           = updateFeedback.Gender;
     feedback.ModifiedDateTime = DateTime.Now;
     feedback.Name             = updateFeedback.Name;
     feedback.Occupation       = updateFeedback.Occupation;
     feedback.SurveyId         = updateFeedback.SurveyId;
 }
Beispiel #2
0
 public string UpdateFeedback(UpdateFeedBackViewModel updateFeedback)
 {
     try
     {
         Feedback feedback = GetFeedbackById(updateFeedback.Id);
         if (feedback == null)
         {
             return("Survey Does Not Exists");
         }
         else
         {
             UpdateSurveyMap(updateFeedback, feedback);
             this.repository.Edit(feedback);
             repository.Commit();
             return("Details Updted Successfully");
         }
     }
     catch
     {
         throw new Exception("Not Updated");
     }
 }
 public IActionResult UpdateSurvey([FromBody]UpdateFeedBackViewModel updatedFeedback)
 {
     return Ok(service.UpdateFeedback(updatedFeedback));
 }