コード例 #1
0
ファイル: HomeController.cs プロジェクト: fathurxzz/aleqx
        public void FeedbackForm(FeedbackFormModel feedbackFormModel)
        {
            using (var context = new SiteContainer())
            {
                var emails = new List<MailAddress>
                                 {
                                     new MailAddress("*****@*****.**")
                                 };

                var responseData = Helpers.MailHelper.SendTemplate(null, emails, "Форма обратной связи", null, null, true, feedbackFormModel.Name, feedbackFormModel.Email, feedbackFormModel.Text);
                var responseFeedback = new Feedback
                                           {
                                               Email = feedbackFormModel.Email,
                                               ErrorMessage = responseData.ErrorMessage,
                                               Text = feedbackFormModel.Text,
                                               Title = feedbackFormModel.Name,
                                               Sent = responseData.EmailSent
                                           };

                context.AddToFeedback(responseFeedback);
                context.SaveChanges();
            }
        }
コード例 #2
0
ファイル: Site.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <summary>
 /// Create a new Feedback object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="sent">Initial value of the Sent property.</param>
 public static Feedback CreateFeedback(global::System.Int32 id, global::System.String text, global::System.String title, global::System.Boolean sent)
 {
     Feedback feedback = new Feedback();
     feedback.Id = id;
     feedback.Text = text;
     feedback.Title = title;
     feedback.Sent = sent;
     return feedback;
 }
コード例 #3
0
ファイル: Site.Designer.cs プロジェクト: fathurxzz/aleqx
 /// <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);
 }