protected void lblOrder_Click(object sender, EventArgs e)
        {
            string id = Request.QueryString["idS"].ToString();

            var dt1 = new DataTable();

            dt1          = ShowTimesService.ShowTimes_GetById(id);
            lblFilm.Text = dt1.Rows[0]["NameF"].ToString();
            double price  = Convert.ToDouble(dt1.Rows[0]["Price"].ToString());
            double number = Convert.ToDouble(txtNumber.Text);
            string str    = (price * number).ToString();

            lblTotal.Text = StringClass.FormatNumber(str);
            DataTable   dt  = CustomerService.Customer_GetByTop("", "Username='******'", "");
            BookingInfo obj = new BookingInfo();

            obj.CusId    = dt.Rows[0]["CusId"].ToString();
            obj.ShoId    = id;
            obj.Bilmoney = str;
            obj.Quantity = txtNumber.Text;
            BookingService.Booking_Insert(obj);

            var dt2 = new DataTable();

            dt2 = BookingService.Booking_GetByTop("", "", "BooId DESC");

            string to         = dt.Rows[0]["Email"].ToString();
            int    port       = 587;
            string subject    = "Message Admin";
            string strContent = "You booking success movie : " + "\n" + dt1.Rows[0]["NameF"].ToString() + "\n" +
                                "Cinema : " + dt1.Rows[0]["NameCi"].ToString() + "\n" +
                                "Date movie: " + dt1.Rows[0]["ShowTime"].ToString() + "\n" +
                                "Time movie: " + dt1.Rows[0]["Time"].ToString() + "\n" +
                                "Quantity ticket : " + dt2.Rows[0]["Quantity"].ToString() + "\n" +
                                "Total amount " + StringClass.FormatNumber(dt2.Rows[0]["Bilmoney"].ToString()) + "\n" +
                                "We will notify you when you pay this ticket. Thank you" + "\n" +
                                "Note : Please, do not reply to email";
            string     content = strContent;
            SmtpClient client  = new SmtpClient();

            client.EnableSsl   = true;
            client.Port        = port;
            client.Host        = "smtp.gmail.com";
            client.Credentials = new NetworkCredential("*****@*****.**", "Noicomdiento");// mail o day
            MailAddress from      = new MailAddress("*****@*****.**");
            MailAddress toAddress = new MailAddress(to);
            MailMessage message   = new MailMessage(from, toAddress);

            message.Body    = content;
            message.Subject = subject;
            try
            {
                client.Send(message);
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
            Response.Redirect("BookingSuccess.aspx?idB=" + dt2.Rows[0]["BooId"].ToString());
        }
 protected void Filter_Click(object sender, EventArgs e)
 {
     try
     {
         string strWhere = " 1=1 ";
         if (Common.StringClass.Check(ddlFilterCinema.SelectedValue))
         {
             strWhere += " and CinId = '" + ddlFilterCinema.SelectedValue + "' ";
         }
         if (Common.StringClass.Check(ddlFilterFilm.SelectedValue))
         {
             strWhere += " and FilId = '" + ddlFilterFilm.SelectedValue + "' ";
         }
         if (Common.StringClass.Check(ddlFilterActive.SelectedValue))
         {
             strWhere += " and Status = '" + ddlFilterActive.SelectedValue + "' ";
         }
         grdShowTimes.CurrentPageIndex = 0;
         grdShowTimes.DataSource       = ShowTimesService.ShowTimes_GetByTop("", strWhere, "");
         grdShowTimes.DataBind();
         if (grdShowTimes.PageCount <= 1)
         {
             grdShowTimes.PagerStyle.Visible = false;
         }
         else
         {
             grdShowTimes.PagerStyle.Visible = true;
         }
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
        protected void lbtDeleteB_Click(object sender, EventArgs e)
        {
            try
            {
                DataGridItem item = default(DataGridItem);
                for (int i = 0; i < grdShowTimes.Items.Count; i++)
                {
                    item = grdShowTimes.Items[i];
                    if (item.ItemType == ListItemType.AlternatingItem | item.ItemType == ListItemType.Item)
                    {
                        if (((CheckBox)item.FindControl("ChkSelect")).Checked)
                        {
                            string strId = item.Cells[1].Text;
                            var    dt    = new DataTable();
                            ShowTimesService.ShowTimes_Delete(strId);
                        }
                    }
                }

                grdShowTimes.CurrentPageIndex = 0;
                BindGrid();
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }
Exemple #4
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            try
            {
                string id = Request.QueryString["idS"].ToString();
                var    dt = new DataTable();
                dt = ShowTimesService.ShowTimes_GetById(id);

                var dtC = new DataTable();
                dtC = CustomerService.Customer_GetByTop("", "Username='******'", "");

                var obj = new FeedbackInfo();
                obj.FilId    = dt.Rows[0]["FilId"].ToString();
                obj.FullName = dtC.Rows[0]["FullName"].ToString();
                obj.Avata    = dtC.Rows[0]["Avata"].ToString();
                obj.Comment  = txtConten.Text;
                FeedbackService.Feedback_Insert(obj);
                LoaFeedback();
                txtConten.Text = "";
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }
 private void LoadFilm()
 {
     try
     {
         rptMovie.DataSource = ShowTimesService.ShowTimes_GetByTop1("", "ShowTimes.Status=1", "");
         rptMovie.DataBind();
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
 private void BindGrid()
 {
     try
     {
         grdShowTimes.DataSource = ShowTimesService.ShowTimes_GetByAll();
         grdShowTimes.DataBind();
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
 protected void lbtUpdateT_Click(object sender, EventArgs e)
 {
     #region [TestInput]
     if (txtShowTime.Text.Trim().Equals(""))
     {
         WebMsgBox.Show("ShowTime not null !");
         txtShowTime.Focus();
         return;
     }
     if (txtPrice.Text.Trim().Equals(""))
     {
         WebMsgBox.Show("Price not null !");
         txtPrice.Focus();
         return;
     }
     if (txtTime.Text.Trim().Equals(""))
     {
         WebMsgBox.Show("Time not null !");
         txtPrice.Focus();
         return;
     }
     #endregion
     ShowTimesInfo obj = new ShowTimesInfo();
     obj.ShoId    = txtId.Value;
     obj.FilId    = ddlFilId_Update.SelectedValue;
     obj.CinId    = ddlCinId_Update.SelectedValue;
     obj.ShowTime = txtShowTime.Text;
     obj.Time     = txtTime.Text;
     obj.Price    = txtPrice.Text;
     obj.Status   = chkActive.Checked ? "1" : "0";
     try
     {
         if (_insert == true)
         {
             ShowTimesService.ShowTimes_Insert(obj);
         }
         else
         {
             ShowTimesService.ShowTimes_Update(obj);
         }
         BindGrid();
         pnView.Visible   = true;
         pnUpdate.Visible = false;
         _insert          = false;
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
Exemple #8
0
        private void LoaFeedback()
        {
            try
            {
                string id = Request.QueryString["idS"].ToString();
                var    dt = new DataTable();
                dt = ShowTimesService.ShowTimes_GetById(id);

                RptComment.DataSource = FeedbackService.Feedback_GetByTop("", "FilId='" + dt.Rows[0]["FilId"].ToString() + "'", "");
                RptComment.DataBind();
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }
        private void LoadInf()
        {
            string id  = Request.QueryString["idS"].ToString();
            var    dt1 = new DataTable();

            dt1 = BookingService.Booking_Sum(id);
            //int daco = Int32.Parse(dt1.Rows[0]["tickets"].ToString());
            var dt = new DataTable();

            dt = ShowTimesService.ShowTimes_GetById(id);
            lblNameCinema.Text  = dt.Rows[0]["NameCi"].ToString();
            Imagethumb.ImageUrl = dt.Rows[0]["PictureBig"].ToString();
            lblAddress.Text     = dt.Rows[0]["Address"].ToString();
            lblFilm.Text        = dt.Rows[0]["NameF"].ToString();
            lblSeats.Text       = dt.Rows[0]["Seats"].ToString() + " (total)";
            //int tong = Int32.Parse(dt.Rows[0]["Seats"].ToString());
            lblDuration.Text = dt.Rows[0]["Duration"].ToString() + " minutes";
            lblShowtime.Text = DateTimeClass.ConvertDateTime(dt.Rows[0]["ShowTime"].ToString(), "dd/MM/yyyy");
            lblTime.Text     = DateTimeClass.ConvertTime(dt.Rows[0]["Time"].ToString());
            lblPrice.Text    = StringClass.FormatNumber(dt.Rows[0]["Price"].ToString());
            double price  = Convert.ToDouble(dt.Rows[0]["Price"].ToString());
            double number = Convert.ToDouble(txtNumber.Text);
            string str    = (price * number).ToString();

            lblTotal.Text = StringClass.FormatNumber(str);
            //string str2 = (tong - daco).ToString();
            //lblNumbertickets.Text = str2 + " (empty)";
            lblNumbertickets.Text = dt1.Rows[0]["tickets"].ToString();
            if (dt1.Rows[0]["tickets"].ToString() == dt.Rows[0]["Seats"].ToString())
            {
                lblMessage.Text    = "Not tickets";
                txtNumber.ReadOnly = true;
                lblOrder.Enabled   = false;
            }
            //if (dt1.Rows[0]["tickets"].ToString() == "")
            //{
            //    lblNumbertickets.Text = "0";
            //}
            else
            {
                lblMessage.Text    = "";
                txtNumber.ReadOnly = false;
                lblOrder.Enabled   = true;
            }
        }
Exemple #10
0
        private void LoadInf()
        {
            try
            {
                if (Session["IDF"] != null)
                {
                    rptShowTime.DataSource = ShowTimesService.ShowTimes_GetByFilId(Session["IDF"].ToString());
                    rptShowTime.DataBind();

                    var dt = new DataTable();
                    dt = ShowTimesService.ShowTimes_GetByFilId(Session["IDF"].ToString());
                    Session["IDShow"] = dt.Rows[0]["ShoId"].ToString();

                    rptMovie.DataSource = ShowTimesService.ShowTimes_GetByTop1("", "ShowTimes.Status=1 and ShoId<>'" + Session["IDShow"].ToString() + "'", "");
                    rptMovie.DataBind();
                }
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }
Exemple #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoaFeedback();
                try
                {
                    string id = Request.QueryString["idS"].ToString();
                    var    dt = new DataTable();
                    dt             = ShowTimesService.ShowTimes_GetById(id);
                    lblDetail.Text = dt.Rows[0]["Detail"].ToString();

                    var dtC = new DataTable();
                    dtC = CustomerService.Customer_GetByTop("", "Username='******'", "");
                    imgImage.ImageUrl = dtC.Rows[0]["Avata"].ToString();
                }
                catch (Exception ex)
                {
                    WebMsgBox.Show(ex.Message);
                }
            }
        }
 protected void lbtUpdatepriceB_Click(object sender, EventArgs e)
 {
     try
     {
         DataGridItem item = default(DataGridItem);
         for (int i = 0; i < grdShowTimes.Items.Count; i++)
         {
             item = grdShowTimes.Items[i];
             if (item.ItemType == ListItemType.AlternatingItem | item.ItemType == ListItemType.Item)
             {
                 TextBox stxtGia = ((TextBox)item.FindControl("txtPrice"));
                 NumberClass.OnlyInputNumber(stxtGia);
                 string strId = item.Cells[1].Text;
                 ShowTimesService.ShowTimes_Update_Price(strId, stxtGia.Text);
             }
         }
         BindGrid();
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
Exemple #13
0
 private void LoadFilmById()
 {
     try
     {
         string id = Request.QueryString["id"].ToString();
         ShowTimesService.ShowTimes_Update_View(id);
         var dt = new DataTable();
         dt                  = FilmService.Film_GetById(id);
         Session["IDF"]      = dt.Rows[0]["FilId"].ToString();
         Imagethumb.ImageUrl = dt.Rows[0]["PictureBig"].ToString();
         lblName.Text        = dt.Rows[0]["NameF"].ToString();
         lblDirector.Text    = dt.Rows[0]["Director"].ToString();
         lblActor.Text       = dt.Rows[0]["Actor"].ToString();
         lblDuration.Text    = dt.Rows[0]["Duration"].ToString() + " minutes";
         ltDescription.Text  = dt.Rows[0]["Description"].ToString();
         lblTypeFilm.Text    = dt.Rows[0]["NameT"].ToString();
         lblCountry.Text     = dt.Rows[0]["NameCo"].ToString();
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }
 protected void grdShowTimes_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     try
     {
         string       strCa    = e.CommandArgument.ToString();
         string       strWhere = " 1=1 ";
         DataGridItem item     = default(DataGridItem);
         if (e.CommandName == "Edit")
         {
             _insert = false;
             DataTable dt = ShowTimesService.ShowTimes_GetById(strCa);
             ddlCinId_Update.SelectedValue = dt.Rows[0]["CinId"].ToString();
             ddlFilId_Update.SelectedValue = dt.Rows[0]["FilId"].ToString();
             txtId.Value       = dt.Rows[0]["ShoId"].ToString();
             txtShowTime.Text  = dt.Rows[0]["ShowTime"].ToString();
             txtPrice.Text     = dt.Rows[0]["Price"].ToString();
             txtTime.Text      = dt.Rows[0]["Time"].ToString();
             chkActive.Checked = dt.Rows[0]["Status"].ToString() == "1" || dt.Rows[0]["Status"].ToString() == "True";
             pnUpdate.Visible  = true;
             pnView.Visible    = false;
         }
         if (e.CommandName == "Delete")
         {
             ShowTimesService.ShowTimes_Delete(strCa);
             BindGrid();
         }
         if (e.CommandName == "Status")
         {
             string strA = "";
             string str  = e.Item.Cells[2].Text;
             strA = str == "1" ? "0" : "1";
             ShowTimesService.ShowTimes_Update_Status(strCa, strA);
             BindGrid();
         }
         if (e.CommandName == "ascPrice")
         {
             if (Common.StringClass.Check(ddlFilterCinema.SelectedValue))
             {
                 strWhere += " and CinId = '" + ddlFilterCinema.SelectedValue + "' ";
             }
             if (Common.StringClass.Check(ddlFilterFilm.SelectedValue))
             {
                 strWhere += " and FilId = '" + ddlFilterFilm.SelectedValue + "' ";
             }
             if (Common.StringClass.Check(ddlFilterActive.SelectedValue))
             {
                 strWhere += " and Status = '" + ddlFilterActive.SelectedValue + "' ";
             }
             grdShowTimes.DataSource = ShowTimesService.ShowTimes_GetByTop("", strWhere, "Price");
             grdShowTimes.DataBind();
             if (grdShowTimes.PageCount <= 1)
             {
                 grdShowTimes.PagerStyle.Visible = false;
             }
         }
         if (e.CommandName == "sortdesc")
         {
             if (Common.StringClass.Check(ddlFilterCinema.SelectedValue))
             {
                 strWhere += " and CinId = '" + ddlFilterCinema.SelectedValue + "' ";
             }
             if (Common.StringClass.Check(ddlFilterFilm.SelectedValue))
             {
                 strWhere += " and FilId = '" + ddlFilterFilm.SelectedValue + "' ";
             }
             if (Common.StringClass.Check(ddlFilterActive.SelectedValue))
             {
                 strWhere += " and Status = '" + ddlFilterActive.SelectedValue + "' ";
             }
             grdShowTimes.DataSource = ShowTimesService.ShowTimes_GetByTop("", strWhere, "NameF");
             grdShowTimes.DataBind();
             if (grdShowTimes.PageCount <= 1)
             {
                 grdShowTimes.PagerStyle.Visible = false;
             }
         }
     }
     catch (Exception ex)
     {
         WebMsgBox.Show(ex.Message);
     }
 }