Ejemplo n.º 1
0
 //[OutputCache(Duration=84731)]
 public ActionResult ContactUs()
 {
     ViewBag.FeedbackCateoryID = new SelectList(db.FeedbackCategories.ToList(), "FeedbackCategoryID", "Category");
     AppVar.GetTitlePageMeta(ViewBag, "Contact Us", null, "Contact Us - " + AppVar.Name,
                             "Contact Us, Feedback about " + AppVar.Name);
     return(View());
 }
Ejemplo n.º 2
0
 public ActionResult ContactUs()
 {
     ViewBag.FeedbackCateoryID =
         new SelectList(
             db.FeedbackCategories.Where(
                 n =>
                 !(n.FeedbackCategoryID == FeedbackCategoryIDs.MobileAppReport ||
                   n.FeedbackCategoryID == FeedbackCategoryIDs.ReviewReport)).ToList(), "FeedbackCategoryID",
             "Category");
     AppVar.GetTitlePageMeta(ViewBag, "Contact Us", null, "Contact Us - " + AppVar.Name,
                             "Contact Us, Feedback about " + AppVar.Name);
     return(View());
 }
Ejemplo n.º 3
0
        public ActionResult ContactUs(Feedback feedback)
        {
            ViewBag.FeedbackCateoryID = new SelectList(db.FeedbackCategories.ToList(), "FeedbackCategoryID", "Category");
            AppVar.GetTitlePageMeta(ViewBag, "Contact Us", null, "Contact Us - " + AppVar.Name,
                                    "Contact Us, Feedback about " + AppVar.Name);


            if (ModelState.IsValid)
            {
                db.Entry(feedback).State = EntityState.Added;
                db.SaveChanges();
                AppVar.SetSavedStatus(ViewBag);
                //send a email.
                AppVar.Mailer.NotifyAdmin("A feedback has been added by " + feedback.Email,
                                          "Please check your feedback inbox. Feedback :<br>" + feedback.Message);

                return(View(feedback));
            }

            AppVar.SetErrorStatus(ViewBag);
            return(View(feedback));
        }
Ejemplo n.º 4
0
        public async Task <ViewResult> ContactUs(Feedback feedback)
        {
            AppVar.GetTitlePageMeta(ViewBag, "Contact Us", null, "Contact Us - " + AppVar.Name,
                                    "Contact Us, Feedback about " + AppVar.Name);
            var user             = UserManager.GetCurrentUser();
            var oneHourBefore    = DateTime.Now.AddHours(-1);
            var isReportedBefore = db.Feedbacks.Any(n => n.Username == user.UserName && n.PostedDate >= oneHourBefore);

            if (isReportedBefore)
            {
                return(View("Later"));
            }
            if (ModelState.IsValid)
            {
                feedback.PostedDate      = DateTime.Now;
                feedback.Username        = user.UserName;
                feedback.Name            = user.DisplayName;
                db.Entry(feedback).State = EntityState.Added;
                db.SaveChanges();
                AppVar.SetSavedStatus(ViewBag);
                //send a email.
                var body = EntityToString.Get(feedback);
                AppVar.Mailer.NotifyAdmin("A feedback has been added by " + feedback.Email,
                                          "Please check your feedback inbox.<br><br> Feedback :<br><q>" + feedback.Message + "</q><br>" + body);

                return(View("Done"));
            }

            ViewBag.FeedbackCateoryID =
                new SelectList(
                    db.FeedbackCategories.Where(
                        n =>
                        !(n.FeedbackCategoryID == FeedbackCategoryIDs.MobileAppReport ||
                          n.FeedbackCategoryID == FeedbackCategoryIDs.ReviewReport)).ToList(), "FeedbackCategoryID",
                    "Category");
            AppVar.SetErrorStatus(ViewBag);
            return(View(feedback));
        }