예제 #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        bookingLogicLayer BL = new bookingLogicLayer();

        BL.PayamentStatus = "0";
        BL.UserId         = Session["UserId"].ToString();
        BL.EntryBy        = Session["UserId"].ToString();
        string BID = bookingLogicLayer.InsertbookingDetials(BL);

        DataTable dtCurrentTable = (DataTable)ViewState["dtTable"];

        for (int i = 0; i < dtCurrentTable.Rows.Count; i++)
        {
            if (dtCurrentTable.Rows[i]["type"].ToString() == "0")
            {
                dtCurrentTable.Rows[i]["type"] = "2";
                BookingSeatLogicLayer BLS = new BookingSeatLogicLayer();
                if (rdobtnD1.Checked == true)
                {
                    BLS.BookingDate = rdobtnD1.Text;
                }
                else if (rdobtnD2.Checked == true)
                {
                    BLS.BookingDate = rdobtnD2.Text;
                }
                else if (rdobtnD3.Checked == true)
                {
                    BLS.BookingDate = rdobtnD3.Text;
                }

                if (RadioButton1.Checked == true)
                {
                    BLS.BookingTime = "1";
                }
                else if (RadioButton2.Checked == true)
                {
                    BLS.BookingTime = "2";
                }
                else if (RadioButton3.Checked == true)
                {
                    BLS.BookingTime = "3";
                }
                else if (RadioButton4.Checked == true)
                {
                    BLS.BookingTime = "4";
                }

                BLS.BookingId   = BID;
                BLS.BookingType = TypeId;
                BLS.SeatNo      = (i + 1).ToString();
                BLS.Rate        = lblRate.Text.Trim();
                BLS.UserId      = Session["UserId"].ToString();
                BLS.MovieId     = hfMoviesId.Value;
                BookingSeatLogicLayer.InsertBookingSeatDetials(BLS);
                DataTable Dt = BookingSeatLogicLayer.GetAllIDWiseBookedSeatDetials(BID);
                if (Dt.Rows.Count > 0)
                {
                    string Message = "";
                    Message = "MovieName :" + Dt.Rows[0]["MoviesName"].ToString() + " ScreenName : " + Dt.Rows[0]["ScreenName"].ToString() + " Seat No : " + Dt.Rows[0]["SeatNo"].ToString();
                    MessageCenter.SendMsg(Dt.Rows[0]["MobileNumber"].ToString(), Message);
                }
            }
        }
        ViewState["dtTable"] = dtCurrentTable;
        DataTable DtBooking1 = (DataTable)ViewState["DtBooking"];

        for (int i = 0; i < DtBooking1.Rows.Count; i++)
        {
            BookingCateenLogicLayer BCL = new BookingCateenLogicLayer();
            BCL.BookingId = BID;
            BCL.ProductId = DtBooking1.Rows[i]["ProductId"].ToString();
            BCL.Qty       = DtBooking1.Rows[i]["Qty"].ToString();
            BCL.Rate      = DtBooking1.Rows[i]["Rate"].ToString();
            BCL.UserId    = Session["UserId"].ToString();
            BCL.EntryBy   = Session["UserId"].ToString();
            BookingCateenLogicLayer.InsertBookingCateenDetials(BCL);
        }
        rpt.DataSource = ViewState["dtTable"];
        rpt.DataBind();

        int CheckCount = 0;

        if (string.IsNullOrWhiteSpace(Request.QueryString["Count"]))
        {
            CheckCount = 100;
        }
        else
        {
            CheckCount = Convert.ToInt32(Request.QueryString["Count"]);
        }
        if (CheckCount != 0 || CheckCount != 100)
        {
            string AAAA = bookingLogicLayer.ReSudulewithBookingId(Convert.ToString(Request.QueryString["OldBookingId"]));
        }
        // Response.Redirect("Recipt.aspx?Id=" + BID);
        Response.Redirect("BookCanteen.aspx?Bookingid=" + BID);
    }
예제 #2
0
    private void Sliver()
    {
        Booktime();
        DataTable CamaignDetail = MoviesLogicLayer.GetAllIDWiseMoviesDetials(Id);

        lblClass.Text      = "Silver";
        hfMoviesId.Value   = Convert.ToString(CamaignDetail.Rows[0]["MoviesId"]);
        lblMovieName.Text  = Convert.ToString(CamaignDetail.Rows[0]["MoviesName"]);
        lblRate.Text       = Convert.ToString(CamaignDetail.Rows[0]["SilverRate"]);
        lblScreenName.Text = Convert.ToString(CamaignDetail.Rows[0]["ScreenName"]);
        for (int i = 0; i < Convert.ToInt32(CamaignDetail.Rows[0]["SilverSeat"]); i++)
        {
            table.Rows.Add(i, 1);
        }
        DateTime RelaseDate = Convert.ToDateTime(CamaignDetail.Rows[0]["RealsieDate"]);

        if (RelaseDate >= DateTime.Now)
        {
            DateTime ExpiryDate = Convert.ToDateTime(CamaignDetail.Rows[0]["ExpiryDate"]);

            rdobtnD1.Text = RelaseDate.ToString("dd-MMM-yyyy");
            if (ExpiryDate >= DateTime.Now.AddDays(1))
            {
                rdobtnD2.Text = RelaseDate.AddDays(1).ToString("dd-MMM-yyyy");
            }
            else
            {
                rdobtnD2.Visible = true;
            }
            if (ExpiryDate >= DateTime.Now.AddDays(2))
            {
                rdobtnD3.Text = RelaseDate.AddDays(2).ToString("dd-MMM-yyyy");
            }
            else
            {
                rdobtnD3.Visible = true;
            }
        }
        else
        {
            DateTime ExpiryDate = Convert.ToDateTime(CamaignDetail.Rows[0]["ExpiryDate"]);
            if (ExpiryDate >= DateTime.Now)
            {
                rdobtnD1.Text = DateTime.Now.ToString("dd-MMM-yyyy");
            }
            else
            {
                rdobtnD1.Visible = false;
            }
            if (ExpiryDate >= DateTime.Now.AddDays(1))
            {
                rdobtnD2.Text = DateTime.Now.AddDays(1).ToString("dd-MMM-yyyy");
            }
            else
            {
                rdobtnD2.Visible = false;
            }
            if (ExpiryDate >= DateTime.Now.AddDays(2))
            {
                rdobtnD3.Text = DateTime.Now.AddDays(2).ToString("dd-MMM-yyyy");
            }
            else
            {
                rdobtnD3.Visible = false;
            }
        }
        if (rdobtnD1.Visible == false && rdobtnD2.Visible == false && rdobtnD3.Visible == false)
        {
            rpt.Visible          = false;
            btnSubmit.Visible    = false;
            RadioButton1.Visible = false;
            RadioButton2.Visible = false;
            RadioButton3.Visible = false;
            RadioButton4.Visible = false;
        }
        else
        {
            rpt.Visible          = true;
            btnSubmit.Visible    = true;
            RadioButton1.Visible = true;
            RadioButton2.Visible = true;
            RadioButton3.Visible = true;
            RadioButton4.Visible = true;
        }
        string BookingDate = "";

        if (rdobtnD1.Checked == true)
        {
            BookingDate = rdobtnD1.Text;
        }
        else if (rdobtnD2.Checked == true)
        {
            BookingDate = rdobtnD2.Text;
        }
        else if (rdobtnD3.Checked == true)
        {
            BookingDate = rdobtnD3.Text;
        }
        string BookingTime = "";

        if (RadioButton1.Checked == true)
        {
            BookingTime = "1";
        }
        else if (RadioButton2.Checked == true)
        {
            BookingTime = "2";
        }
        else if (RadioButton3.Checked == true)
        {
            BookingTime = "3";
        }
        else if (RadioButton4.Checked == true)
        {
            BookingTime = "4";
        }

        DataTable DtSeat12 = BookingSeatLogicLayer.GetAllIDWiseBookingSeat(hfMoviesId.Value, TypeId, BookingDate, BookingTime);

        for (int i = 0; i < Convert.ToInt32(CamaignDetail.Rows[0]["GoldSeat"]); i++)
        {
            for (int j = 0; j < DtSeat12.Rows.Count; j++)
            {
                if (Convert.ToInt32(DtSeat12.Rows[j]["SeatNo"]) == i + 1)
                {
                    table.Rows[i]["type"] = "2";
                }
            }
        }
        ViewState["dtTable"] = table;
        rpt.DataSource       = (DataTable)ViewState["dtTable"];
        rpt.DataBind();
        RptCateen.DataSource = CateenMasterLogicLayer.GetAllIDWiseCateenMasterDetialsT(Convert.ToString(CamaignDetail.Rows[0]["TheatresNameId"]));
        RptCateen.DataBind();
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string    Id = Convert.ToString(Request.QueryString["Id"]);
            DataTable Dt = BookingSeatLogicLayer.GetAllIDWiseBookedSeatDetials(Id);
            hfMoviesId.Value   = Dt.Rows[0]["MovieId"].ToString();
            lblMovieName.Text  = Dt.Rows[0]["MoviesName"].ToString();
            ImgAss.ImageUrl    = "Admin/MovieImage/" + Dt.Rows[0]["MoviesImage"].ToString();
            lblScreenName.Text = Dt.Rows[0]["ScreenName"].ToString();
            if (Dt.Rows[0]["BookingType"].ToString() == "1")
            {
                lblClass.Text = "Platium";
            }
            else if (Dt.Rows[0]["BookingType"].ToString() == "2")
            {
                lblClass.Text = "Gold";
            }
            else if (Dt.Rows[0]["BookingType"].ToString() == "3")
            {
                lblClass.Text = "Silver";
            }
            lblRate.Text         = Dt.Rows[0]["Rate"].ToString();
            lblSeatNo.Text       = Dt.Rows[0]["SeatNo"].ToString();
            lblAmt.Text          = Dt.Rows[0]["TotalRate"].ToString();
            lblCityName.Text     = Dt.Rows[0]["CityName"].ToString();
            lblTheatresName.Text = Dt.Rows[0]["TheatresName"].ToString();
            lblBookDate.Text     = Convert.ToDateTime(Dt.Rows[0]["BookingDate"]).ToString("dd-MMM-yyyy");
            if (Dt.Rows[0]["BookingTime"].ToString() == "1")
            {
                lblBookTime.Text = "First";
            }
            else if (Dt.Rows[0]["BookingTime"].ToString() == "2")
            {
                lblBookTime.Text = "Second";
            }
            else if (Dt.Rows[0]["BookingTime"].ToString() == "3")
            {
                lblBookTime.Text = "Evening";
            }
            else if (Dt.Rows[0]["BookingTime"].ToString() == "4")
            {
                lblBookTime.Text = "Night";
            }

            DataTable Dt2  = BookingSeatLogicLayer.GetAllIDWiseBookedCateenDetials(Id);
            int       Rate = 0;
            for (int i = 0; i < Dt2.Rows.Count; i++)
            {
                Rate = Rate + Convert.ToInt32(Dt.Rows[0]["rate"]);
            }
            lblTotal111.Text = Rate.ToString() + ".00";
            if (Dt2.Rows.Count > 0)
            {
                rptBookedCatenlist.DataSource = Dt2;
                rptBookedCatenlist.DataBind();
            }
            else
            {
                H1.Visible = false;
            }
            if (Session["UserId"] == null)
            {
                ALogin.Visible  = true;
                Lbl2.Visible    = true;
                ASignup.Visible = true;
                lbl4.Visible    = false;
                ALogOut.Visible = false;
                lbl3.Visible    = false;
            }
            else
            {
                ALogin.Visible       = false;
                Lbl2.Visible         = false;
                ASignup.Visible      = false;
                lbl4.Visible         = true;
                ALogOut.Visible      = true;
                lbl3.Visible         = true;
                lblUserSettings.Text = Convert.ToString(Session["UserName"]);
            }
        }
    }