Exemple #1
0
    protected void btnvalidation_Click(object sender, EventArgs e)
    {
        // DataTable dtroyalinfo = VistaBOL.Select_Newyear_RoyalInfo(textroyalinfo.Text);
        DataTable dtroyalinfo = TransactionBOL.selectifo_royal(textroyalinfo.Text);

        if (textroyalinfo.Text == "")
        {
            ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Please enter Royal Card No. or Mobile No.');", true);
            pricecouple.Text = "11999";
            pricesingle.Text = "6999";
            priceteen.Text   = "3999";
            pricekids.Text   = "2999";
        }
        else if (dtroyalinfo.Rows.Count > 0)
        {
            pricecouple.Text = "9999";
            pricesingle.Text = "5999";
            priceteen.Text   = "3999";
            pricekids.Text   = "2999";
        }
        else
        {
            ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Royal Card No. or Mobile No. not matched.');", true);
            pricecouple.Text   = "11999";
            pricesingle.Text   = "6999";
            priceteen.Text     = "3999";
            pricekids.Text     = "2999";
            textroyalinfo.Text = "";
        }
    }
    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);
        }
    }