Exemple #1
0
        public string SendItinerary()
        {
            string result  = "";
            string resNo   = HttpContext.Server.HtmlEncode(Request.Form["resNo"]);
            string to      = HttpContext.Server.HtmlEncode(Request.Form["to"]).Trim();
            string subject = HttpContext.Server.HtmlEncode(Request.Form["subject"]);
            string message = HttpContext.Server.HtmlEncode(Request.Form["message"]);

            BlueGreenContext bgcontext     = new BlueGreenContext();
            Reservation      reservation   = bgcontext.GetActiveReservation(resNo);
            string           projectNumber = (reservation != null) ? reservation.ProjectStay : null;

            if (projectNumber != null)
            {
                var splitToEmail = to.Split(';');
                foreach (string toEmail in splitToEmail)
                {
                    if (!string.IsNullOrEmpty(toEmail))
                    {
                        result = EmailUtils.SendItineraryEmail(toEmail, subject, message, reservation, bgcontext);
                    }
                }
            }
            else
            {
                result = EmailUtils.BuildJsonResponse(false, "project number not found");
            }

            return(result);
        }