Exemple #1
0
        public string ProvideFinalOffer(int BookingId, int FinalOffer, int Convert)
        {
            try
            {
                string s = BL_Booking.ProvideFinalOffer(BookingId, FinalOffer, ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId, Convert);
                if (s == "")
                {
                    var bookingDetails = BL_Booking.GetBookingModifyDetails_Notifications(BookingId);
                    var model          = new NegotiationEmailTempleteModel();
                    model.Status = "Progress! You have received a  counter offer! Please check the details by clicking the link below: ";

                    bookingDetails.dTaxes = System.Convert.ToDecimal(bookingDetails.sExtra2);
                    model.BookingModify   = bookingDetails;

                    var websiteBaseUrl = ConfigurationManager.AppSettings["OFRBaseUrl"].ToString();
                    model.CallbackUrl = websiteBaseUrl + "Negotiation/NegotiationStatus?bookingId=" + clsUtils.Encode(BookingId.ToString());

                    model.CallbackUrl = clsUtils.Shorten(model.CallbackUrl);
                    // string notifySMS_User = model.Status + Environment.NewLine + "<a href=\"" + model.CallbackUrl + "\"></a>";

                    var html      = this.RenderViewToString("_EmailTemplete", model);
                    var testEmail = "";

                    Task.Run(() => clsUtils.sendSMS(bookingDetails.MobileOFR, model.Status + model.CallbackUrl));
                    Task.Run(() => MailComponent.SendEmail(bookingDetails.EmailOFR, testEmail, "", "Bargain Status", html, null, null, true, null, null));

                    return("{ \"st\" : 1 , \"Status\" : \"Final offer provided successfully.\" }");
                }
                else
                {
                    return("{ \"st\" : 0 , \"Status\" : \"" + s + "\" }");
                }
            }
            catch (Exception)
            {
                return("{ \"st\" : 0 , \"Status\" : \"Please try again.\" }");
            }
        }
Exemple #2
0
        private Task SendInformation(string statusType, long bookingId)
        {
            try
            {
                //var bookingDetails = BL_Booking.GetBooking(bookingId);
                var bookingModel = BL_Booking.GetBookingModifyDetails_Notifications(bookingId);

                var    model = new NegotiationEmailTempleteModel();
                string notificationSMS_User = string.Empty;
                bool   Accepted             = true;
                switch (statusType) // Notification mail/SMS to customer. Conserve commission checked and managed.
                {
                case "HR":          // Hotel has rejected the negotiation. Conserve commission not applied.
                    var websiteBaseUrl1 = ConfigurationManager.AppSettings["OFRBaseUrl"].ToString();

                    string negoStatusUrl = websiteBaseUrl1 + "Negotiation/NegotiationStatus?bookingId=" + clsUtils.Encode(bookingId.ToString());

                    model.Status         = "Sorry! Your offer is rejected. Please Check the related offer details by clicking the link below:";
                    notificationSMS_User = "******";
                    Accepted             = false;
                    break;

                case "CO":     // Hotel has countered the negotiation.
                case "RR":     // Rate reduced for "Original rate" through conserve commission.
                case "CR":     // Rate reduced for Counter offer through conserve commission.
                    model.Status         = "Progress! You have received a  counter offer ! Please check the details by clicking the link below:";
                    notificationSMS_User = model.Status;
                    Accepted             = false;
                    break;

                case "BP":     // Hotel has accepted the negotiation.
                case "RA":     // Negotiation accepted by reducing conserve commission on "Original rate".
                case "CA":     // Negotiation accepted by reducing conserve commission on counter offer.
                    model.Status         = "Congratulations! Your offer is accepted! Please Check the details by clicking the link below:";
                    notificationSMS_User = model.Status;
                    break;
                }

                //bookingModel.dTaxes = Convert.ToDecimal(bookingModel.sExtra2);

                model.BookingModify = bookingModel;

                var websiteBaseUrl = ConfigurationManager.AppSettings["OFRBaseUrl"].ToString();
                if (!Accepted)
                {
                    model.CallbackUrl = websiteBaseUrl + "Negotiation/NegotiationStatus?bookingId=" + clsUtils.Encode(bookingId.ToString());
                }
                else
                {
                    model.CallbackUrl = websiteBaseUrl + "NegoConfirmed/" + clsUtils.Encode(bookingId.ToString());
                }


                var html = this.RenderViewToString("_EmailTemplete", model);

                var shortUrl = clsUtils.Shorten(model.CallbackUrl);

                var message = notificationSMS_User + shortUrl;

                //Task.Run(() => clsUtils.sendSMS("9560439101", model.Status + Environment.NewLine + model.CallbackUrl));
                clsUtils.sendSMS(bookingModel.MobileOFR, message);

                return(Task.Run(() => MailComponent.SendEmail(bookingModel.EmailOFR, "", "", "Offer from OneFineRate Confirmation No: " + bookingModel.BookingId, html, null, null, true, null, null)));
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #3
0
        public int SendMailToRevenueManager(int bookingId)
        {
            try
            {
                var customerModel = new NegotiationEmailTempleteModel();
                // Added to show hotel Information in email template
                var bookingModel = BL_Booking.GetBookingModifyDetails_Notifications(bookingId);
                customerModel.BookingModify = bookingModel;


                Decimal?ExchangeRate = 1;
                // get from tblEmailSetting
                var revenueManagerDetail = BL_tblEmailSettingsM.GetRecord("RevenueManager");

                // get from propertyEdit page
                var pRevenueManager = BL_PropDetails.GetEmail_PhoneByPropId(bookingModel.PropId);

                string sPrimaryContactEmail;
                string sConfirmationContactEmail;
                string sRevenueManagerEmail;
                string sRevenueManagerContact;

                pRevenueManager.TryGetValue("sPrimaryContactEmail", out sPrimaryContactEmail);
                pRevenueManager.TryGetValue("sConfirmationContactEmail", out sConfirmationContactEmail);
                pRevenueManager.TryGetValue("sRevenueManagerEmail", out sRevenueManagerEmail);
                pRevenueManager.TryGetValue("sRevenueManagerContact", out sRevenueManagerContact);

                string emails = sRevenueManagerEmail + "," + sConfirmationContactEmail + "," + sPrimaryContactEmail;


                customerModel = new NegotiationEmailTempleteModel();
                customerModel.BookingModify = bookingModel;
                //customerModel.Status = "Thanks " + bookingModel.Booker + "! We have recieved your negotiation." + Environment.NewLine + "We will get back to you within 3 hours.";
                customerModel.Status = "Thank you " + bookingModel.Booker + "! We have recieved your bargain." + Environment.NewLine + bookingModel.sMessage;

                var revenuManagerModel = new NegotiationEmailTempleteModel();
                //revenuManagerModel.Status = "Hi " + revenueManageName +", Please take action for the following Negotiation Request.";
                revenuManagerModel.Status = "Hi, Please take action for the following bargain Request.";
                revenuManagerModel.IsRevenueManagerFormat = true;


                if (bookingModel.sCurrencyCode != "INR")
                {
                    etblExchangeRatesM objExchange = BL_ExchangeRate.GetSingleRecordById("INR", bookingModel.sCurrencyCode);
                    if (objExchange.dRate != null)
                    {
                        ExchangeRate = 1 / objExchange.dRate;
                    }
                }
                bookingModel.dTotalNegotiateAmount = bookingModel.dTotalNegotiateAmount * ExchangeRate;
                bookingModel.dTaxes = Convert.ToDecimal(bookingModel.Tax) * Convert.ToDecimal(ExchangeRate);
                revenuManagerModel.BookingModify = bookingModel;

                string extranetUrl = Request.Url.GetLeftPart(UriPartial.Authority) + "Account/Login?sPropId=" + clsUtils.Encode(bookingModel.PropId.ToString());

                string shortExtranetUrl = clsUtils.Shorten(extranetUrl);

                string notificationMsg_RevenueMgr = "You have received a new bargain offer. The guest has chosen your hotel! Click " + shortExtranetUrl + " to view the offer and process yet another reservation from OFR. This offer is valid for the next three hours.";

                var html_RevenueManager = this.RenderViewToString("_NegotiationEmailTemplete", revenuManagerModel);

                Task.Run(() => clsUtils.sendSMS(sRevenueManagerContact, notificationMsg_RevenueMgr));

                Task.Run(() => MailComponent.SendEmail(sRevenueManagerEmail, revenueManagerDetail.sEmail, "", "Reminder - New Bargain", html_RevenueManager, null, null, true, null, null));

                return(1);
            }
            catch (Exception ex)
            {
                return(0);
            }
        }