Exemple #1
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    //protected void ddl_Date_SelectedIndexChanged(object sender, EventArgs e)
    protected void dateofshow_TextChanged(object sender, EventArgs e)
    {
        String PlayDate;

        if (dateofshow.Text.ToString() == "" || dateofshow.Text.ToString() == "Select")
        {
            PlayDate        = "0";
            dateofshow.Text = "Select";
        }
        else
        {
            PlayDate = Convert.ToDateTime(dateofshow.Text.ToString()).ToString("dd/MM/yyyy");
        }
        String filmCode = ddl_Play.SelectedValue;
        //String PlayDate = ddl_Date.SelectedValue;
        //PlayDate = PlayDate.Replace("-", "/");
        String Location = ddl_Location.SelectedValue;

        ddl_ShowTimes.Items.Clear();
        ddl_ShowTimes.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));

        foreach (DataRow dr in VistaBOL.Select_PlayTime(Location, filmCode, PlayDate).Rows)
        {
            ddl_ShowTimes.Items.Add(new ListItem(Convert.ToDateTime(dr[0].ToString()).ToShortTimeString(), dr[1].ToString().Trim()));
        }
        //UpdatePanel2.Update();
    }
Exemple #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddl_Date_SelectedIndexChanged(object sender, EventArgs e)
    {
        String filmCode = ddl_Play.SelectedValue;
        String PlayDate = ddl_Date.SelectedValue;

        PlayDate = PlayDate.Replace("-", "/"); //comment this for live deployment
        String Location = ddl_Location.SelectedValue;

        ddl_ShowTimes.Items.Clear();
        ddl_ShowTimes.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));

        foreach (DataRow dr in VistaBOL.Select_PlayTime(Location, filmCode, PlayDate).Rows)
        {
            ddl_ShowTimes.Items.Add(new ListItem(Convert.ToDateTime(dr[0].ToString()).ToShortTimeString(), dr[1].ToString().Trim()));
        }
    }
Exemple #3
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    //protected void ddl_Play_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    String Play = ddl_Play.SelectedValue;
    //    dateofshow.Text = "Select";
    //    ddl_Location.Items.Clear();
    //    ddl_Location.Items.Add(new ListItem("Select", "0"));
    //    DataTable dtAudi = VistaBOL.Select_Audi(Play);
    //    foreach (DataRow dr in dtAudi.Rows)
    //        ddl_Location.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));

    //}
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ddl_Location_SelectedIndexChanged(object sender, EventArgs e)
    {
        String filmCode = ddl_Play.SelectedValue;
        String Location = ddl_Location.SelectedValue;

        ddl_Date.Items.Clear();
        //ddl_Date.Items.Add(new ListItem("Select", "0"));
        //ddl_Date.Items[0].Selected = true;
        DataTable dtplaydate = VistaBOL.Select_PlayDate(Location, filmCode);

        foreach (DataRow dr in dtplaydate.Rows)
        {
            if (!(dr[0].ToString().Equals("2012.12.31")))
            {
                ddl_Date.Items.Add(new ListItem(Convert.ToDateTime(dr[0].ToString()).ToString("ddd, MMM dd,yyyy"),
                                                Convert.ToDateTime(dr[0].ToString()).ToString("dd/MM/yyyy")));
                dateofshow.Text = Convert.ToDateTime(dr[0].ToString()).ToString("ddd, MMM dd,yyyy");
            }
        }
        String PlayDate;

        if (dateofshow.Text.ToString() == "" || dateofshow.Text.ToString() == "Select")
        {
            PlayDate        = "0";
            dateofshow.Text = "Select";
        }
        else
        {
            PlayDate = Convert.ToDateTime(dateofshow.Text.ToString()).ToString("dd/MM/yyyy");
        }
        String filmCode1 = ddl_Play.SelectedValue;
        //String PlayDate = ddl_Date.SelectedValue;
        //PlayDate = PlayDate.Replace("-", "/");
        String Location1 = ddl_Location.SelectedValue;

        ddl_ShowTimes.Items.Clear();
        //ddl_ShowTimes.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        ddl_Category.Items.Clear();
        ddl_Category.Items.Add(new ListItem("Select", "0"));
        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));

        foreach (DataRow dr in VistaBOL.Select_PlayTime(Location1, filmCode1, PlayDate).Rows)
        {
            ddl_ShowTimes.Items.Add(new ListItem(Convert.ToDateTime(dr[0].ToString()).ToShortTimeString(), dr[1].ToString().Trim()));
        }


        String filmCode2 = ddl_ShowTimes.SelectedValue;

        ddl_Category.Items.Clear();
        //ddl_Category.Items.Add(new ListItem("Select", "0"));
        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));
        DataSet ds = VistaBOL.Select_Category_DS(filmCode2);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (ds.Tables[0].Rows[i][1].ToString() == "COPPER")
            {
                ddl_Category.Items.Add(new ListItem("CHILD" + ", Rs. " + String.Format("{0:#.##}",
                                                                                       decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
            }
            else if (ds.Tables[0].Rows[i][1].ToString() == "GOLD")
            {
                ddl_Category.Items.Add(new ListItem("SINGLE" + ", Rs. " + String.Format("{0:#.##}",
                                                                                        decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
            }
            else if (ds.Tables[0].Rows[i][1].ToString() == "PLATINUM")
            {
                ddl_Category.Items.Add(new ListItem("COUPLE" + ", Rs. " + String.Format("{0:#.##}",
                                                                                        decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
            }
            else if (ds.Tables[0].Rows[i][1].ToString() == "SILVER")
            {
                ddl_Category.Items.Add(new ListItem("TEEN" + ", Rs. " + String.Format("{0:#.##}",
                                                                                      decimal.Parse(ds.Tables[0].Rows[i][2].ToString())), ds.Tables[0].Rows[i][0].ToString()));
            }
        }

        const ushort MAX_SEATS_PER_TRANSACTION = 10; //needs to be moved to config;

        drp_TotalSeats.Items.Clear();
        drp_TotalSeats.Items.Add(new ListItem("Select", "0"));
        String Category       = ddl_Category.SelectedValue;
        String PlayTime       = ddl_ShowTimes.SelectedValue;
        int    availableSeats = VistaBOL.Select_Available_Seats(Category, PlayTime);

        if (availableSeats > 0) //if there are seats available...
        {
            //ensure only MAX per transaction are allowed for selection
            availableSeats = (availableSeats > MAX_SEATS_PER_TRANSACTION) ? 10 : availableSeats;
            for (int i = 1; i <= availableSeats; i++)
            {
                drp_TotalSeats.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
        }
        else //otherwise mark sold out
        {
            drp_TotalSeats.Items.Add(new ListItem("Sold Out", "0"));
        }
    }