示例#1
0
        private void hienThongTin(String id, int te, int nl)
        {
            iTE.Value  = te.ToString();
            iNL.Value  = nl.ToString();
            tour.Value = id;
            String        emailKH = "";
            String        sdtKH   = "";
            SqlDataReader rdkh    = khachHangModel.xemKhachHangID(HttpContext.Current.Session["maKH"].ToString());

            if (rdkh.HasRows)
            {
                while (rdkh.Read())
                {
                    emailKH            = "Email: " + rdkh["sEmail"].ToString();
                    sdtKH              = "Số Điện Thoại: " + rdkh["sSDT"].ToString();
                    txtEmail.InnerHtml = emailKH;
                    txtSDT.InnerHtml   = sdtKH;
                    txtTen.InnerHtml   = "Khách Hàng " + rdkh["sTenKhachHang"].ToString();
                }
            }
            SqlDataReader rd = tourController.xemTour(id);

            if (rd.HasRows)
            {
                while (rd.Read())
                {
                    linkAnh.InnerHtml = "<img src='../../Upload/" + rd["surlanh"].ToString() + "' alt='' class='img-responsive'>";
                    tieuDe.InnerHtml  = "Đặt Tour: &nbsp" + rd["sTieuDe"].ToString();
                    int giaTE     = Convert.ToInt32(rd["igiate"]);//.ToString();
                    int giaTEgiam = Convert.ToInt32(rd["igiategiam"]);
                    int giaNL     = Convert.ToInt32(rd["igianl"]);
                    int giaNLgiam = Convert.ToInt32(rd["igianlgiam"]);
                    int giaNL_    = 0;
                    int giaTE_    = 0;
                    if (giaNLgiam == 0 || (DateTime.Parse(rd["hangiamnl"].ToString()) < DateTime.Now))
                    {
                        giaNL_ = giaNL;
                    }
                    else
                    {
                        giaNL_ = giaNLgiam;
                    }

                    if (giaTEgiam == 0 || (DateTime.Parse(rd["hangiamte"].ToString()) < DateTime.Now))
                    {
                        giaTE_ = giaTE;
                    }
                    else
                    {
                        giaTE_ = giaTEgiam;
                    }
                    // + Session["tenKH"].ToString();

                    txtNL.InnerHtml   = "Số Chỗ Người Lớn Là: &nbsp" + nl + "&nbsp chỗ x &nbsp" + giaNL_.ToString("#,##0") + "&nbspVNĐ";
                    txtTE.InnerHtml   = "Số Chỗ Trẻ Em Là: &nbsp" + te + "&nbsp chỗ x &nbsp" + giaTE_.ToString("#,##0") + "&nbspVNĐ";
                    txtTong.InnerHtml = "Tổng Tiền Là:&nbsp" + (te * giaTE_ + nl * giaNL_).ToString("#,##0") + "&nbspVNĐ";
                    tien_tt.Value     = (te * giaTE_ + nl * giaNL_).ToString();
                }
            }
        }
示例#2
0
        public void xemTour(String id)
        {
            //System.Diagnostics.Debug.WriteLine("3");
            maTour_.Value          = id;
            matourhidden.InnerHtml = "<input type='hidden' id='txtMaTour_' value = '" + id + "'>";
            SqlDataReader rd = tourController.xemTour(id);

            if (rd.HasRows)
            {
                while (rd.Read())
                {
                    txtDanhGia.InnerHtml = "" + rd["soSao"] + "<i class='fa fa-star' style='font - size: 18px; color: #ffca08;'></i>";
                    txtNKH.InnerHtml     = rd["sNoiKhoiHanh"] + "";
                    txtTG.InnerHtml      = rd["stongthoigian"] + "";
                    //   txtTE.InnerHtml = "<strike style='color: red; display: inline;'>"+Convert.ToInt32(rd["igiate"].ToString()).ToString("#,##0") + "</strike>&nbsp&nbsp&nbsp<b style='color: green; display: inline;'>" + Convert.ToInt32(rd["igiategiam"].ToString()).ToString("#,##0") + "</b>VND";

                    // Debug.WriteLine("ss " + (DateTime.Parse(rd["hangiamte"].ToString()) > DateTime.Now) );

                    if (DateTime.Parse(rd["hangiamte"].ToString()) > DateTime.Now)          //Convert.ToInt32(rd["igiategiam"].ToString()) == 0 &&
                    {
                        txtTE.InnerHtml = "<strike style='color: red; display: inline;'>" + Convert.ToInt32(rd["igiate"].ToString()).ToString("#,##0") + "</strike>&nbsp&nbsp&nbsp<b style='color: green; display: inline;'>" + Convert.ToInt32(rd["igiategiam"].ToString()).ToString("#,##0") + "</b>VND";
                    }
                    else
                    {
                        txtTE.InnerHtml = "<p style='color: green;display: inline;'>" + Convert.ToInt32(rd["igiate"].ToString()).ToString("#,##0") + "</p>&nbsp&nbsp&nbsp<b style='color: green; display: inline;'>" + "</b>VND";
                    }

                    if (DateTime.Parse(rd["hangiamnl"].ToString()) > DateTime.Now)         //Convert.ToInt32(rd["igiategiam"].ToString()) == 0 &&
                    {
                        txtNL.InnerHtml = "<strike style='color: red;display: inline;'>" + Convert.ToInt32(rd["igianl"].ToString()).ToString("#,##0") + "</strike>&nbsp&nbsp&nbsp<b style='color: green; display: inline;'>" + Convert.ToInt32(rd["igianlgiam"].ToString()).ToString("#,##0") + "</b>VND";
                    }
                    else
                    {
                        txtNL.InnerHtml = "<p style='color: green;display: inline;'>" + Convert.ToInt32(rd["igianl"].ToString()).ToString("#,##0") + "</p>&nbsp&nbsp&nbsp<b style='color: green; display: inline;'>" + "</b>VND";
                    }

                    DataTable dataTable = tourController.layHinhAnh(id);
                    anhDD.InnerHtml = "<img src='../../Upload/" + dataTable.Rows[0]["sDuongDan"] + "' alt=' 'class='alignleft img-responsive'>";

                    dataTable.Rows[0].Delete();
                    rpt1.DataSource = dataTable;
                    rpt1.DataBind();
                    rpt2.DataSource = dataTable;
                    rpt2.DataBind();

                    txtNoiDung.Text = rd["sMoTa"].ToString();
                    // System.Diagnostics.Debug.WriteLine(rd["sMoTa"].ToString());
                    txtTieuDe.Text = rd["sTieuDe"].ToString();
                    int giaTE     = Convert.ToInt32(rd["igiate"]);//.ToString();
                    int giaTEgiam = Convert.ToInt32(rd["igiategiam"]);
                    int giaNL     = Convert.ToInt32(rd["igianl"]);
                    int giaNLgiam = Convert.ToInt32(rd["igianlgiam"]);


                    string htmlGia = "<input type='hidden' id='giaNL' value ='";
                    if (giaNLgiam == 0 || (DateTime.Parse(rd["hangiamnl"].ToString()) < DateTime.Now))
                    {
                        htmlGia += giaNL;
                    }
                    else
                    {
                        htmlGia += giaNLgiam;
                    }

                    if (giaTEgiam == 0 || (DateTime.Parse(rd["hangiamte"].ToString()) < DateTime.Now))
                    {
                        htmlGia += "' /><input type='hidden' id ='giaTE' value = '" + giaTE;
                    }
                    else
                    {
                        htmlGia += "' /><input type='hidden' id ='giaTE' value = '" + giaTEgiam;
                    }
                    gia.InnerHtml          = htmlGia + "' /> ";
                    hiddenIdTour.InnerHtml = "<input type='hidden' id='idTour' name='idTour' value='" + rd["iMaTour"].ToString() + "' />";
                }
            }
        }