Exemple #1
0
        public void FeedbackForm(FeedbackFormModel feedbackFormModel)
        {
            using (var context = new ModelContainer())
            {
                var feedback = new Feedback
                                   {
                                       Email = feedbackFormModel.Email,
                                       Text = feedbackFormModel.Text,
                                       Title = feedbackFormModel.Name
                                   };
                context.AddToFeedback(feedback);
                context.SaveChanges();


                var responseData = MailHelper.SendTemplate(
                    new List<MailAddress>
                        {
                            new MailAddress("*****@*****.**"),
                            new MailAddress("*****@*****.**")
                        },
                    "Форма обратной связи RVK", "FeedbackTemplate.htm", null, true, feedbackFormModel.Name,
                    feedbackFormModel.Email, feedbackFormModel.Text);


                var responseFeedback = new Feedback{Email = "",Text = responseData.ErrorMessage,Title = responseData.EmailSent.ToString()};
                context.AddToFeedback(responseFeedback);
                context.SaveChanges();
            }
        }
Exemple #2
0
 /// <summary>
 /// Create a new Feedback object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 public static Feedback CreateFeedback(global::System.Int32 id, global::System.String title, global::System.String text)
 {
     Feedback feedback = new Feedback();
     feedback.Id = id;
     feedback.Title = title;
     feedback.Text = text;
     return feedback;
 }
Exemple #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Feedback EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToFeedback(Feedback feedback)
 {
     base.AddObject("Feedback", feedback);
 }