protected void Page_Load(object sender, EventArgs e)
    {
        int promoteId = Convert.ToInt32(Request.QueryString["PromoteID"].ToString());

        promote = BLLPromote.getPromoteByID(promoteId)[0];
        if (!Page.IsPostBack)
        {
            FillData();
        }
    }
Esempio n. 2
0
    protected void bntNext(object sender, EventArgs e)
    {
        if (MultiView1.ActiveViewIndex == 1)
        {
            MultiView1.ActiveViewIndex++;
        }
        else if (MultiView1.ActiveViewIndex == 2)
        {
            MultiView1.ActiveViewIndex++;
        }
        if (MultiView1.ActiveViewIndex == 3)
        {
            Promote   promote   = new Promote();
            string    age       = (MultiView1.Views[2].FindControl("tbBirthday") as TextBox).Text;
            int       age2      = tinhtuoi(age);
            int       idPromote = 0;
            ArrayList arrSeart  = (ArrayList)ViewState["CountSeat"];
            //kiem tra tuoi
            if (age2 <= 5)
            {
                idPromote = 1;
            }
            else if (5 < age2 & age2 <= 12)
            {
                idPromote = 2;
            }
            else if (12 < age2 & age2 <= 50)
            {
                idPromote = 3;
            }
            else if (50 < age2)
            {
                idPromote = 4;
            }
            ViewState["promoteID"] = idPromote;
            promote             = BLLPromote.getPromoteByID(idPromote);
            lbDiscount.Text     = promote.PromoteName.ToString();
            lbCustomer2.Text    = tbName.Text;
            lbPromotePrent.Text = promote.Discount.ToString();

            lbNumberSeat.Text = arrSeart.Count.ToString();
            int countTicket = int.Parse(lbNumberSeat.Text);

            string litPrice     = (MultiView1.Views[1].FindControl("lbPrice2") as Label).Text;
            float  price        = float.Parse(litPrice.ToString());
            int    discount     = int.Parse(lbPromotePrent.Text.ToString());
            float  discoutPrent = (price * discount * countTicket) / 100;
            ViewState["totalFare"] = price * countTicket;
            float total = price * countTicket - discoutPrent;
            //litPromote.Text = discoutPrent.ToString();
            lbTotalPrice.Text = total.ToString();
        }
    }