Exemplo n.º 1
0
 protected void bttHuyBo_Click(object sender, EventArgs e)
 {
     txtMaCP.Text           = "";
     txtGiaGoc.Text         = "";
     txtGiaSauKhiGiam.Text  = "";
     txtRreaDKSU.InnerText  = "";
     txtSLCPMinGiamGia.Text = "";
     txtSLSPmin.Text        = "";
     DateTimePicker1.setDate("");
     DateTimePicker2.setDate("");
 }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int isLogIn;

            int.TryParse(Session["IsLogin"].ToString(), out isLogIn);
            if (isLogIn == 1)
            {
                string typeUser = Session["LoaiUser"].ToString();
                if (typeUser == "Manager" && Request.QueryString["macp"] != "")
                {
                    if (!IsPostBack)
                    {
                        string     macp = Request.QueryString["macp"];
                        COUPON_DTO cp   = CouponBUS.GetCouponInfor1(macp);
                        txtGiaGoc.Text         = cp.GiaGoc.ToString();
                        txtGiaSauKhiGiam.Text  = cp.GiaSauGiam.ToString();
                        txtMaCP.Text           = cp.MaCoupon;
                        txtRreaDKSU.Value      = cp.DieuKienSuDung;
                        txtSLCPMinGiamGia.Text = cp.SoLuongCouponMin.ToString();
                        txtSLSPmin.Text        = cp.SoLuongSanPhamMin.ToString();
                        DateTimePicker1.setDate(cp.ThoiGianBD.ToShortDateString());
                        DateTimePicker2.setDate(cp.ThoiGianKT.ToShortDateString());
                        TextBox1.Text = cp.TenSanPham;

                        /*
                         * List<Coupon> list = CouponBUS.GetCouponInfor(macp);
                         * txtGiaGoc.Text = list[0].GiaHangKhiChuaGiam.ToString();
                         * txtGiaSauKhiGiam.Text = list[0].GiaHangSauKhiGiam.ToString();
                         * txtMaCP.Text = list[0].MaCoupon;
                         * txtRreaDKSU.Value = list[0].DieuKienSuDung;
                         * txtSLCPMinGiamGia.Text=list[0].s*/
                    }
                }
                else
                {
                    Response.Redirect("../Shared/Default.aspx");
                }
            }
            else
            {
                Response.Redirect("../Shared/Default.aspx");
            }
        }