コード例 #1
0
        public ActionResult Create([Bind(Include = "Id,Name,Location,Unit,TypeOfService,Details,Urgency,DateSubmitted,ContractorUsed,FollowUpNeeded,Completed,DateCompleted")] ServiceRequests serviceRequests)
        {
            if (ModelState.IsValid)
            {
                db.ServiceRequests.Add(serviceRequests);
                db.SaveChanges();

                MailGun managerMessage = new MailGun();
                managerMessage.SendServiceRequest("*****@*****.**", serviceRequests.Name, serviceRequests.Location, serviceRequests.Unit, serviceRequests.TypeOfService, serviceRequests.Details, serviceRequests.Urgency, serviceRequests.DateSubmitted);

                return(RedirectToAction("Success"));
            }

            return(View(serviceRequests));
        }