protected void btnHtlPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); HotelList <string> PromoClass = new HotelList <string>(); List <string> Promotions = PromoClass.listofHotels(); string PromotionCode = txtHtlPromotionCode.Text; int list = listPromo.Count; for (int i = 0; i < list; i++) { if (Promotions.Contains(listPromo[i].PromotionCode.ToString().ToUpper())) //listPromo[i].PromotionCode.ToString().ToUpper() { bool isMatch = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); if (isMatch) { listPromo[i].WebPromotionId = txtHtlPromotionCode.Text.ToUpper(); Session["PromotionCode"] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session["Hotel"] = listPromo[i].PromotionCode.ToString(); Response.Redirect("Default.aspx?Hotel=s&promo=" + Encrypt(listPromo[i].PromotionCode)); } } } PromotionNotValid(); }
protected void btnPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); string PromotionCode = txtPromotionCode.Text; int list = listPromo.Count; for (int i = 0; i < list; i++) { if (listPromo[i].PromotionCode == "VALENTINEMONTH") { bool isMatch = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); if (isMatch) { listPromo[i].WebPromotionId = txtPromotionCode.Text.ToUpper(); Session["PromotionCode"] = listPromo[i]; Session["Hotel"] = "VALENTINEMONTH"; Response.Redirect("Default.aspx?Valentine=s"); } else { PromotionNotValid(); } } } }
protected void btnMANAPromotionCode_Click(object sender, EventArgs e) { decimal TotalAmount = 0; decimal PayableAmount = 0; string pack = ddl_package.SelectedValue.ToString(); List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); // String PromotionCode = txtMANAPromotionCode.Text; int list = listPromo.Count; int select = int.Parse(ddl_noofpackage.SelectedValue.ToString()); if (ddl_package.SelectedItem.ToString() == "Select" && ddl_noofpackage.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select any Family Package and the number of Packages"; ddl_package.Focus(); return; } if (ddl_package.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select any Family Package"; ddl_package.Focus(); return; } if (ddl_noofpackage.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select number of Packages"; ddl_noofpackage.Focus(); return; } else { for (int i = 0; i < list; i++) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "MANA") { if (ddl_package.SelectedItem.ToString() == "Weekday,Rs.3999") { PayableAmount = Convert.ToDecimal("3999") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PackageType"] = "Family Package Weekdays"; } if (ddl_package.SelectedItem.ToString() == "Weekend,Rs.4999") { PayableAmount = Convert.ToDecimal("4999") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PackageType"] = "Family Package Weekend"; } Session["Package"] = ddl_package.SelectedItem.ToString(); //Session["Package"] = ddl_package.SelectedItem.ToString(); Session["PromotionCode"] = listPromo[i]; Session["dtt"] = listPromo[i].EndDate.ToString(); Session["Hotel"] = listPromo[i].PromotionCode.ToString(); //Session["PayableAmount"] = PayableAmount; Session["NoofPackages"] = ddl_noofpackage.SelectedValue.ToString(); Response.Redirect("Default.aspx?MANA=ManaPromo", false); } } PromotionNotValid(); } }
protected void Page_Load(object sender, EventArgs e) { lblMsgPromotionCode.Visible = false; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("MMT promotion start"); if (!IsPostBack) { List <KoDTicketingLibrary.DTO.Promotion> listPromo1 = VistaBOL.GetPromostionCode(); int cont = listPromo1.Count; for (int i = 0; i < cont; i++) { if (listPromo1[i].PromotionCode.ToString().ToUpper() == "MMT") { string date1 = ""; //string endDat = "16 Aug 2013"; DateTime Enddate = listPromo1[i].EndDate; Enddate = Enddate.AddDays(11); double days = Enddate.Subtract(DateTime.Now).TotalDays; for (double j = 0; j <= days; j++) { DateTime date = DateTime.Now.AddDays(j); string day = date.DayOfWeek.ToString().ToUpper(); date1 = date.ToString("ddd, MMM dd,yyyy"); if (day == "MONDAY") { ddl_date.Items.Remove(date1); } else { ddl_date.Items.Add(date1); } } } } } }
protected void btnMMTPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); String PNRnumber = txtMMTPNR.Text; String PromotionCode = txtMMTPromotionCode.Text; int list = listPromo.Count; if (txtMMTPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtMMTPromotionCode.Focus(); return; } else if (txtMMTPNR.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your PNR Number"; txtMMTPNR.Focus(); return; } else { for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); bool isMatch = Regex.IsMatch(PNRnumber, "(?![N|n][P|p][0]{12})^([N|n][P|p])[0-9]{12}$"); bool isMatch2 = Regex.IsMatch(PNRnumber, "(?![N|n][H|h][0]{12})^([N|n][H|h])[0-9]{12}$"); if ((isMatch || isMatch2) && isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "MMTDOMESTIC") { listPromo[i].WebPromotionId = txtMMTPromotionCode.Text.ToUpper(); Session["PromotionCode"] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Response.Redirect("Default.aspx?MMTD=s&promo=" + Encrypt(listPromo[i].PromotionCode)); } } } PromotionNotValid(); } }
protected void btnIndigoPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); String PNRnumber = txtIndigoPNR.Text; String PromotionCode = txtIndigoPromotionCode.Text; int list = listPromo.Count; if (txtIndigoPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtIndigoPromotionCode.Focus(); return; } else if (txtIndigoPNR.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your PNR Number"; txtIndigoPNR.Focus(); return; } else { for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); bool isMatch = Regex.IsMatch(PNRnumber, "^[A-Z a-z]{6}$"); if (isMatch && isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "INDIGOSL" || listPromo[i].PromotionCode.ToString().ToUpper() == "INDIGODM" || listPromo[i].PromotionCode.ToString().ToUpper() == "INDIGOGL" || listPromo[i].PromotionCode.ToString().ToUpper() == "INDIGOPL") { listPromo[i].WebPromotionId = txtIndigoPromotionCode.Text.ToUpper(); Session["PromotionCode"] = listPromo[i]; Response.Redirect("Default.aspx?Indigo=s"); } } } } PromotionNotValid(); }
protected void btnPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); String PromotionCode = txtPromotionCode.Text; Int16 CampaignCounter = 1; foreach (KoDTicketingLibrary.DTO.Promotion item in listPromo) { if (txtPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtPromotionCode.Focus(); } else { bool isMatch = Regex.IsMatch(PromotionCode, "(?![M,m]+[R,r]+[T,t][0]{5})^([M|m][R|r][T|t])[0-9]{5}$|^([M|m][R|r][T||t])[9]{5}$"); if (isMatch) { item.WebPromotionId = txtPromotionCode.Text.ToUpper(); Session["PromotionCode"] = item; Response.Redirect("Default.aspx"); } else { if (CampaignCounter == listPromo.Count) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Promotion Code is not Valid"; txtPromotionCode.Text = ""; txtPromotionCode.Focus(); } else { CampaignCounter++; } } } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["ac"] != null) { Session["AgentCode"] = Request.QueryString["ac"]; } Load_Play(); } List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); int list = listPromo.Count; for (int i = 0; i < list; i++) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "JHUMROOOFFER") { Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; } } }
protected void btnMMTPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); string sum = GTICKBOL.MMTpackage_check(txtMMTPNR.Text); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("MMT ticket sum: " + sum); String PNRnumber = txtMMTPNR.Text; String PromotionCode = txtMMTPromotionCode.Text; int list = listPromo.Count; int no = int.Parse(sum); int select = int.Parse(ddl_noofpackage.SelectedValue.ToString()); if (no >= 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, maximum 4 bookings are allowed on each Booking Id."; txtMMTPromotionCode.Text = ""; txtMMTPNR.Text = ""; txtMMTPromotionCode.Focus(); return; } else if ((no + select) > 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, you can select only " + (4 - no) + " package";; txtMMTPromotionCode.Text = ""; txtMMTPNR.Text = ""; txtMMTPromotionCode.Focus(); return; } else if (txtMMTPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtMMTPromotionCode.Focus(); return; } else if (txtMMTPNR.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your PNR Number"; txtMMTPNR.Focus(); return; } else if (chkterms.Checked == false) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Accept terms and conditions"; txtMMTPNR.Focus(); return; } else { for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); bool isMatch = Regex.IsMatch(PNRnumber, "(?![U|u][S|s][0]{4}[B|b][0]{5})^([U|u][S|s][0-9]{4}[B|b]{1}[0-9]{5})$"); bool isMatch1 = Regex.IsMatch(PNRnumber, "(?![A|a][N|n][0]{12})^([A|a][N|n])[0-9]{12}$"); bool isMatch2 = Regex.IsMatch(PNRnumber, "(?![U|u][S|s][0]{4}[B|b]{1}[A-Z a-z 0-9]{7})^([U|u][S|s][0-9]{4}[B|b]{1}[A-Z a-z 0-9]{7})$"); bool isMatch3 = Regex.IsMatch(PNRnumber, "(?![U|u][N|n][0]{4}[B|b]{1}[A-Z a-z 0-9]{7})^([U|u][N|n][0-9]{4}[B|b]{1}[A-Z a-z 0-9]{7})$"); if ((isMatch || isMatch1 || isMatch2 || isMatch3) && isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "MMT") { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("MMT end date: " + listPromo[i].EndDate.ToString()); decimal TotalAmount = Convert.ToDecimal(ddl_noofpackage.SelectedValue) * Convert.ToDecimal("6000"); decimal PayableAmount = Convert.ToDecimal("4500") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PromotionCode"] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session["Hotel"] = listPromo[i].PromotionCode.ToString(); Session["PayableAmount"] = PayableAmount; Session["TotalAmount"] = TotalAmount; Session["NoofPackages"] = ddl_noofpackage.SelectedValue.ToString(); Session["pnr"] = txtMMTPNR.Text.ToUpper(); Session["Package"] = "4500"; Session["promocode"] = txtMMTPromotionCode.Text.ToUpper(); //Session["day"] = ddl_date.SelectedItem.Text.ToString(); Response.Redirect("Default.aspx?MMT=MMTUS&promo=" + Encrypt(listPromo[i].PromotionCode)); } } } } PromotionNotValid(); }
protected void btn_Submit_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); Session["Package"] = ddl_Package1.SelectedValue; int list = listPromo.Count; string category = ""; string PC = ""; if (Session["Package"] == "Rs.1275") { PC = "MONTHOFMARCH"; } else if (Session["Package"] == "Rs.4999") { PC = "MARCHPROMOTION"; } for (int i = 0; i < list; i++) { if (listPromo[i].PromotionCode.ToString().ToUpper() == PC.ToString()) { string WebPromotionId = "KOD40MOM"; listPromo[i].WebPromotionId = WebPromotionId.ToUpper(); Session["PromotionCode"] = listPromo[i]; Session["Hotel"] = listPromo[i].PromotionCode.ToString(); if (listPromo[i].CO == 1) { category = "COPPER"; } else if (listPromo[i].SL == 1) { category = "SILVER"; } else if (listPromo[i].GL == 1) { category = "GOLD"; } else if (listPromo[i].PL == 1) { category = "PLATINUM"; } else if (listPromo[i].BZ == 1) { category = "BRONZE"; } else if (listPromo[i].DM == 1) { category = "DIAMOND"; } } } String PlayDate = Convert.ToDateTime(ddl_Date.SelectedItem.Text).ToString("dd/MM/yyyy"); if (Session["Package"] == "Rs.1275") { Session["seat_Val"] = "NMJM" + "," + "JHUMROO" + "," + PlayDate + "," + ddl_ShowTime.SelectedValue + "," + "SL" + "," + ddl_Quantity.SelectedValue + "," + "Jhumroo @ Nautanki Mahal" + "," + "2:30 PM" + "," + category; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Render Seat Layout for " + Session["seat_Val"].ToString()); if (Session["Hotel"] == null) { Session["Hotel"] = ""; } Response.Redirect("Seat-Layout.aspx?March=s", false); } else if (Session["Package"] == "Rs.4999") { Session["seat_Val"] = "NMJM" + "," + "JHUMROO" + "," + PlayDate + "," + ddl_ShowTime.SelectedValue + "," + "GL" + "," + ddl_Quantity.SelectedValue + "," + "Jhumroo @ Nautanki Mahal" + "," + "7:30 PM" + "," + category; Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Render Seat Layout for " + Session["seat_Val"].ToString()); if (Session["Hotel"] == null) { Session["Hotel"] = ""; } Response.Redirect("Seat-Layout.aspx?March=s", false); } }
protected void btnMMTPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); string sum = GTICKBOL.YATRAPromotion_check(txtYatraPNR.Text); String PNRnumber = txtYatraPNR.Text; String PromotionCode = txtYatraPromotionCode.Text; int list = listPromo.Count; int no = int.Parse(sum); int select = int.Parse(ddl_nooftickets.SelectedValue.ToString()); if (no >= 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, maximum 4 tickets are allowed on each Booking Id."; txtYatraPromotionCode.Text = ""; txtYatraPNR.Text = ""; txtYatraPromotionCode.Focus(); return; } else if ((no + select) > 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, you can select only " + (4 - no) + " tickets";; txtYatraPromotionCode.Text = ""; txtYatraPNR.Text = ""; txtYatraPromotionCode.Focus(); return; } else if (txtYatraPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtYatraPromotionCode.Focus(); return; } else if (txtYatraPNR.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your PNR Number"; txtYatraPNR.Focus(); return; } else if (chkterms.Checked == false) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Accept terms and conditions"; txtYatraPNR.Focus(); return; } else { for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); bool isMatch = Regex.IsMatch(PNRnumber, "(?![Y|y][T|t][0]{11})^([Y|y][T|t])[0-9]{11}$"); bool isMatch1 = Regex.IsMatch(PNRnumber, "(?![Y|y][T|t][0]{10})^([Y|y][T|t])[0-9]{10}$"); bool isMatch2 = Regex.IsMatch(PNRnumber, "(?![Y|y][T|t][0]{9})^([Y|y][T|t])[0-9]{9}$"); bool isMatch3 = Regex.IsMatch(PNRnumber, "(?![Y|y][T|t][0]{8})^([Y|y][T|t])[0-9]{8}$"); if ((isMatch || isMatch1 || isMatch2 || isMatch3) && isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "YATRA") { Session["PromotionCode"] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session["Hotel"] = listPromo[i].PromotionCode.ToString(); Session["yatrapnr"] = txtYatraPNR.Text.ToUpper(); Session["NoofTickets"] = ddl_nooftickets.SelectedItem.ToString(); Session["promocode"] = txtYatraPromotionCode.Text.ToUpper(); Response.Redirect("Default.aspx?Yatra=S&promo=" + Encrypt(listPromo[i].PromotionCode), false); } } } } PromotionNotValid(); }
protected void btnMCPromotionCode_Click(object sender, EventArgs e) { if (Txtcardno.Text == "" || (Txtcardno.Text.Length < 6)) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Six Digits of Your Master Card."; Txtcardno.Focus(); return; } if (ddlbankname.SelectedValue.ToString() == "Select Bank Name") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select Bank Name"; ddlbankname.Focus(); return; } if (txtMCPromotionCode.Text.Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Promotion Code"; txtMCPromotionCode.Focus(); return; } if (chkterms.Checked == false) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Accept Terms and Condition."; chkterms.Focus(); return; } else { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); String PromotionCode = txtMCPromotionCode.Text; int list = listPromo.Count; bool istrue = false; DataTable dtvalidation = TransactionBOL.Validationnonwc(int.Parse(Txtcardno.Text)); for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); if (isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "MCOTHERS") { //Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Promotion code:" + txtMCPromotionCode.Text.ToString()); //Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Redirect to MasterCard-NwcDetail page."); //Session["MCPROMOCODE"] = txtMCPromotionCode.Text.ToString(); Session["PromotionCode"] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session["Hotel"] = listPromo[i].PromotionCode.ToString(); istrue = true; // Response.Redirect("MasterCard-NwcDetails.aspx"); } if (istrue == false) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Promotion Code is not Valid."; txtMCPromotionCode.Focus(); return; } if (dtvalidation != null && dtvalidation.Rows.Count > 0) { foreach (DataRow dr in dtvalidation.Rows) { if (dr[0].ToString() == ddlbankname.SelectedItem.ToString()) { Session["MCPROMOCODE"] = txtMCPromotionCode.Text.ToString(); Session["NWTMCBANKNAME"] = ddlbankname.SelectedItem.ToString(); Session["NWTMCCARDNO"] = Txtcardno.Text.ToString(); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("Card no:" + Txtcardno.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("bank name:" + ddlbankname.SelectedItem.ToString()); Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write("redirect to default page."); Response.Redirect("Default.aspx?NWMCT=S&promo=" + Encrypt("MCOTHERS"), false); } else { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Either Card Number or Bank name is incorrect."; Txtcardno.Focus(); return; } } } else { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, your card is not eligible for this Offer."; Txtcardno.Focus(); return; } } } } }
protected void btnvalidation_Click(object sender, EventArgs e) { DataTable dtroyalinfo = TransactionBOL.selectifo_royal(textroyalinfo.Text); if (textroyalinfo.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please enter Royal Card No. or Mobile No."; textroyalinfo.Focus(); return; //ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Please enter Royal Card No. or Mobile No.');", true); } if (ddl_package.SelectedItem.ToString() == "Select" && ddl_noofpackage.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select any Family Package and the number of Packages"; ddl_package.Focus(); return; } if (ddl_package.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select any Family Package"; ddl_package.Focus(); return; } if (ddl_noofpackage.SelectedItem.ToString() == "Select") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please select number of Packages"; ddl_noofpackage.Focus(); return; } else if (dtroyalinfo.Rows.Count > 0) { Session["royalno"] = textroyalinfo.Text; decimal TotalAmount = 0; decimal PayableAmount = 0; List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); int list = listPromo.Count; string pack = ddl_package.SelectedValue.ToString(); int select = int.Parse(ddl_noofpackage.SelectedValue.ToString()); for (int i = 0; i < list; i++) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "FAMILYOFFER") { if (Session["royalno"].ToString() != null && Session["royalno"].ToString() != "") { if (ddl_package.SelectedItem.ToString() == "Weekday-Rs.9796") { PayableAmount = Convert.ToDecimal("4999") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PackageType"] = "Family Package Weekdays"; } if (ddl_package.SelectedItem.ToString() == "Weekend-Rs.13196") { PayableAmount = Convert.ToDecimal("7999") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PackageType"] = "Family Package Weekend"; } Session["Package"] = ddl_package.SelectedItem.ToString(); Session["PromotionCode"] = listPromo[i]; Session[listPromo[i].PromotionCode] = listPromo[i]; Session["a" + listPromo[i].PromotionCode] = listPromo[i]; Session["dtt"] = listPromo[i].EndDate.ToString(); Session["Hotel"] = listPromo[i].PromotionCode.ToString(); Session["NoofPackages"] = ddl_noofpackage.SelectedValue.ToString(); Response.Redirect("Default.aspx?FAMILYOFFER=FamilyOffer&promo=" + Encrypt(listPromo[i].PromotionCode), false); } } } } else { OfferNotValid(); //ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Royal Card No. or Mobile No. not matched.');", true); } }
protected void btnMMTPromotionCode_Click(object sender, EventArgs e) { List <KoDTicketingLibrary.DTO.Promotion> listPromo = VistaBOL.GetPromostionCode(); string sum = GTICKBOL.MMTpackage_check(txtMMTPNR.Text); String PNRnumber = txtMMTPNR.Text; String PromotionCode = txtMMTPromotionCode.Text; int list = listPromo.Count; int no = int.Parse(sum); int select = int.Parse(ddl_noofpackage.SelectedValue.ToString()); if (no >= 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, maximum 4 bookings are allowed on each Booking Id."; txtMMTPromotionCode.Text = ""; txtMMTPNR.Text = ""; txtMMTPromotionCode.Focus(); return; } else if ((no + select) > 4) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Sorry, you can select only " + (4 - no) + " package";; txtMMTPromotionCode.Text = ""; txtMMTPNR.Text = ""; txtMMTPromotionCode.Focus(); return; } else if (txtMMTPromotionCode.Text.ToString().Length == 0) { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your Promotion Code"; txtMMTPromotionCode.Focus(); return; } else if (txtMMTPNR.Text == "") { lblMsgPromotionCode.Visible = true; lblMsgPromotionCode.Text = "Please Enter Your PNR Number"; txtMMTPNR.Focus(); return; } else { for (int i = 0; i < list; i++) { bool isMatchPromo = Regex.IsMatch(PromotionCode, listPromo[i].RegexValidator); bool isMatch = Regex.IsMatch(PNRnumber, "(?![U|u][S|s][0]{4}[B|b][0]{5})^([U|u][S|s][0-9]{4}[B|b]{1}[0-9]{5})$"); bool isMatch1 = Regex.IsMatch(PNRnumber, "(?![A|a][N|n][0]{12})^([A|a][N|n])[0-9]{12}$"); if ((isMatch || isMatch1) && isMatchPromo) { if (listPromo[i].PromotionCode.ToString().ToUpper() == "MMT") { decimal TotalAmount = Convert.ToDecimal(ddl_noofpackage.SelectedValue) * Convert.ToDecimal("6000"); decimal PayableAmount = Convert.ToDecimal("4500") * Convert.ToDecimal(ddl_noofpackage.SelectedValue); Session["PayableAmount"] = PayableAmount; Session["TotalAmount"] = TotalAmount; Session["NoofPackages"] = ddl_noofpackage.SelectedValue.ToString(); Session["pnr"] = txtMMTPNR.Text.ToUpper(); Session["promocode"] = txtMMTPromotionCode.Text.ToUpper(); Session["day"] = ddl_date.SelectedItem.Text.ToString(); Response.Redirect("MMTContactDetails.aspx"); } } } } PromotionNotValid(); }