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 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 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; } }
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 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); } }