// Inserts the collected data to the connected database (helper method) private void InsertFeedbackFormItem(FeedbackFormMessageModel feedback) { var item = new FeedbackFormItem { UserName = feedback.FirstName, UserLastName = feedback.LastName, UserEmail = feedback.Email, UserFeedback = feedback.MessageText, }; item.Insert(); }
public ActionResult SendFeedback(FeedbackFormMessageModel model) { // Validates the received form data based on the view model if (!ModelState.IsValid) { return(View("FormFill", model)); } // Inserts the collected form data to the connected database InsertFeedbackFormItem(model); return(View("FormSendSuccess")); }