예제 #1
0
 protected void bt_capnhat_Click(object sender, EventArgs e)
 {
     if (txt_mkmoi.Text.Length >= 6)
     {
         try
         {
             DataSet  dsNd = new DataSet();
             object[] obj  = new object[2];
             obj[0] = Session["taikhoan"].ToString();
             obj[1] = md5.hmweb_Encrypt("thuy", txt_mkcu.Text);
             dsNd   = SupportDb.ReturnDataSet("kiemtramatkhau", obj);
             if (dsNd.Tables[0].Rows.Count > 0)
             {
                 obj[0] = Session["taikhoan"].ToString();
                 obj[1] = md5.hmweb_Encrypt("thuy", txt_mkmoi.Text);
                 SupportDb.ExecuteProcdure("capnhatmatkhau", obj);
                 lbl_thanhcong.Text = "Cập nhật Thành công!";
                 txt_mkcu.Text      = "";
                 txt_mkmoi.Text     = "";
                 txt_ktramkmoi.Text = "";
             }
         }
         catch
         {
             lbl_thanhcong.Text = "Đã xảy ra lỗi trong quá trình đổi mật khẩu!";
         }
     }
     else
     {
         lbl_thanhcong.Text = "Mật khẩu mới của bạn quá ngắn (< 6 kí tự)";
     }
 }
예제 #2
0
    protected void bt_up_Click(object sender, EventArgs e)
    {
        object[] obj4 = new object[6];
        obj4[0] = Session["masanpham1"];
        obj4[1] = txt_tensp.Text;
        obj4[2] = Convert.ToInt32(drp_nhomhang.SelectedValue);
        obj4[3] = Convert.ToInt32(txt_soluong.Text);
        obj4[4] = txt_chitiet.Text;
        obj4[5] = Convert.ToDouble(txt_dongia.Text);
        SupportDb.ExecuteProcdure("capnhatsanpham1", obj4);
        lbl_thongbao.Text = "Cập nhật thành công !";
        txt_tensp.Text    = "";
        txt_soluong.Text  = "";
        txt_chitiet.Text  = "";
        txt_dongia.Text   = "";
        ful_anhsp.Enabled = true;
        bt_them.Enabled   = true;
        bt_up.Visible     = false;
        object[] obj011 = new object[1];
        obj011[0] = Session["manh01"];
        DataSet dsa = new DataSet();

        dsa = SupportDb.ReturnDataSet("timsptheomanh", obj011);
        grv_sp.DataSource = dsa;
        grv_sp.DataBind();
        Panel2.Visible = false;
        Panel1.Visible = true;
    }
예제 #3
0
 protected void bt_dangky_Click(object sender, EventArgs e)
 {
     if (chk_dongy.Checked == true)
     {
         if (txt_matkhau.Text.Length >= 6)
         {
             try
             {
                 object[] obj2 = new object[2];
                 obj2[0] = txt_tendangnhap.Text;
                 obj2[1] = txt_email.Text;
                 DataSet ds = new DataSet();
                 ds = SupportDb.ReturnDataSet("ktratendangnhapvaemail", obj2);
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     lbl_thongbao.Text = "Tên tài khoản đã có người đăng kí.Vui lòng nhập vào tên khác !";
                 }
                 else
                 {
                     if (ds.Tables[1].Rows.Count > 0)
                     {
                         lbl_thongbao.Text = "Email này đã đăng kí. Vui lòng nhập email khác ! ";
                     }
                     else
                     {
                         object[] obj5 = new object[7];
                         obj5[0] = Convert.ToInt32(drp_quyen.SelectedValue);
                         obj5[1] = txt_tendangnhap.Text;
                         obj5[2] = md5.hmweb_Encrypt("thuy", txt_matkhau.Text);
                         obj5[3] = txt_hoten.Text;
                         obj5[4] = txt_diachi.Text;
                         obj5[5] = txt_dienthoai.Text;
                         obj5[6] = txt_email.Text;
                         SupportDb.ExecuteProcdure("nguoidungdangky", obj5);
                         lbl_thongbao.Text    = "Thêm người dùng thành công !";
                         txt_tendangnhap.Text = "";
                         txt_matkhau.Text     = "";
                         txt_hoten.Text       = "";
                         txt_diachi.Text      = "";
                         txt_dienthoai.Text   = "";
                         txt_email.Text       = "";
                     }
                 }
             }
             catch
             {
                 lbl_thongbao.Text = "Có lỗi trong quá trình thêm người dùng. Bạn vui lòng kiểm tra lại !";
             }
         }
         else
         {
             lbl_thongbao.Text = "Mật khẩu quá ngắn (< 6 kí tự)";
         }
     }
     Hienthinguoidung();
     Panel1.Visible = true;
     Panel2.Visible = false;
     txt_ten.Text   = "";
 }
 protected void btCapnhat_Click(object sender, EventArgs e)
 {
     object[] obj = new object[2];
     obj[0] = lblIDHoaDon.Text;
     obj[1] = drpTinhtrang.SelectedValue.ToString();
     SupportDb.ExecuteProcdure("CapNhatHoaDonChuaGiao", obj);
     Response.Redirect(Request.ApplicationPath + "/Admin/HoaDonChuaGiao.aspx");
 }
 protected void btThem_Click(object sender, EventArgs e)
 {
     object[] obj1 = new object[1];
     obj1[0] = txtNSX.Text;
     SupportDb.ExecuteProcdure("ThemNSX", obj1);
     Response.Write("<script>alert('Thêm NSX thành công!');</script>");
     Response.Redirect(Request.ApplicationPath + "/Admin/QLNSX.aspx");
 }
 protected void btCapnhat_Click(object sender, EventArgs e)
 {
     object[] objq = new object[2];
     objq[0] = txtKhachang.Text;
     objq[1] = drpQuyen.SelectedValue;
     SupportDb.ExecuteProcdure("CapNhatQuyenKH", objq);
     Response.Write("<script>alert('Cập nhật khách hàng thành công!');</script>");
 }
 protected void bt_them_Click(object sender, EventArgs e)
 {
     object[] obj1 = new object[2];
     obj1[0] = txt_tennhomhang.Text;
     obj1[1] = Convert.ToInt32(drp_loaihang.SelectedValue);
     SupportDb.ExecuteProcdure("themnhomhang", obj1);
     lbl_thanhcong.Text   = "Thêm nhóm hàng thành công !";
     txt_tennhomhang.Text = "";
     Hienthinhomhang();
 }
 protected void Button1_Click(object sender, EventArgs e)
 {
     object[] obj4 = new object[3];
     obj4[0] = Session["manhomh"];
     obj4[1] = txt_tennhomhang.Text;
     obj4[2] = Convert.ToInt32(drp_loaihang.SelectedValue);
     SupportDb.ExecuteProcdure("capnhatnhomhang", obj4);
     lbl_thanhcong.Text   = "Cập nhật thành công !";
     txt_tennhomhang.Text = "";
     Hienthinhomhang();
 }
예제 #9
0
 protected void btOk_Click(object sender, ImageClickEventArgs e)
 {
     object[] obj = new object[5];
     obj[0] = System.DateTime.Now.ToShortDateString();
     obj[1] = txtGhiChu.Text;
     obj[2] = Session["IDKhachHang"];
     obj[3] = Session["IDVanChuyen"];
     obj[4] = Session["IDThanhToan"];
     SupportDb.ExecuteProcdure("ThemHoaDon", obj);
     Chitietsanpham();
     SendMail();
     Response.Redirect("ThanhCong.aspx");
 }
예제 #10
0
    protected void bt_them_Click(object sender, EventArgs e)
    {
        string strpath = "../images/quangcao/";

        ful_anhquangcao.SaveAs(Server.MapPath("../images/quangcao/") + ful_anhquangcao.FileName);
        object[] obj1 = new object[5];
        obj1[0] = txt_tencongty.Text;
        obj1[1] = txt_diachi.Text;
        obj1[2] = txt_sdt.Text;
        obj1[3] = txt_email.Text;
        obj1[4] = strpath.Substring(3) + ful_anhquangcao.FileName;
        SupportDb.ExecuteProcdure("themquangcao", obj1);
        lbl_thongbao.Text = "Thêm thành công !";
        Hienthiquangcao();
    }
예제 #11
0
 protected void bt_capnhat_Click(object sender, EventArgs e)
 {
     object[] objcn = new object[4];
     objcn[0] = Convert.ToInt32(Session["manguoidung"]);
     //obj[0] = txt_hoten.Text;
     objcn[1] = txt_diachi.Text;
     objcn[2] = txt_sdt.Text;
     objcn[3] = txt_email.Text;
     SupportDb.ExecuteProcdure("capnhatnguoidung", objcn);
     lbl_thongbao.Text = "Thành công!";
     txt_hoten.Text    = "";
     txt_diachi.Text   = "";
     txt_sdt.Text      = "";
     txt_email.Text    = "";
 }
 protected void btDelete_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in grv_donhang.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("chk_Check");
         if (chk != null && chk.Checked)
         {
             int      madh = Convert.ToInt32(grv_donhang.DataKeys[row.RowIndex].Value);
             object[] obj1 = new object[1];
             obj1[0] = madh;
             SupportDb.ExecuteProcdure("xoadonhang", obj1);
             lbl_thongbao.Text = "Xóa thành công !";
         }
     }
     Hienthidonhang();
 }
예제 #13
0
    protected void bt_them_Click(object sender, EventArgs e)
    {
        string strpath = "../images/sanpham/";

        ful_anhsp.SaveAs(Server.MapPath("../images/sanpham/") + ful_anhsp.FileName);
        object[] obj1 = new object[6];
        obj1[0] = txt_tensp.Text;
        obj1[1] = drp_nhomhang.SelectedValue;
        obj1[2] = strpath.Substring(3) + ful_anhsp.FileName;
        obj1[3] = txt_soluong.Text;
        obj1[4] = txt_chitiet.Text;
        obj1[5] = txt_dongia.Text;
        SupportDb.ExecuteProcdure("themsanpham", obj1);
        lbl_thongbao.Text = "Thêm thành công !";
        Hienthisanpham();
    }
    protected void btThem_Click(object sender, EventArgs e)
    {
        string str = "Images/Products/";

        fuAnh.SaveAs(Server.MapPath("../Images/Products/") + fuAnh.FileName);
        object[] obj = new object[8];
        obj[0] = drpLoai.SelectedValue;
        obj[1] = drpNSX.SelectedValue;
        obj[2] = txtTensp.Text;
        obj[3] = str + fuAnh.FileName;
        obj[4] = txtTomtat.Text;
        obj[5] = txtChitiet.Text;
        obj[6] = txtDongia.Text;
        obj[7] = txtSoluong.Text;
        SupportDb.ExecuteProcdure("ThemSanPham", obj);
        Response.Write("<script>alert('Đã thêm mới sản phẩm!');</script>");
    }
예제 #15
0
 protected void btXoa_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in GridView1.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("chkXoa");
         if (chk != null && chk.Checked)
         {
             //bat dau xoa nd
             int      idnsx = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
             object[] obj1  = new object[1];
             obj1[0] = idnsx;
             SupportDb.ExecuteProcdure("XoaNSX", obj1);
             //Response.Write(idnsx.ToString());
             Response.Redirect(Request.ApplicationPath + "/Admin/QLNSX.aspx");
         }
     }
 }
 protected void btThem_Click(object sender, EventArgs e)
 {
     if (txtPass.Text.Length >= 6)//Password >6 kí tự mới được phép đăng ký
     {
         try
         {
             object[] obj2 = new object[2];
             obj2[0] = txtTendangnhap.Text;
             obj2[1] = txtDiachi.Text;
             DataSet ds = new DataSet();
             ds = SupportDb.ReturnDataSet("Kiemtra_User_Email", obj2);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 Response.Write("<script>alert('Tài khoản của bạn đã có người đăng ký. Vui lòng chọn tài khoản khác!');</script>");
             }
             else
             {
                 if (ds.Tables[1].Rows.Count != 0)
                 {
                     Response.Write("<script>alert('Bạn chưa nhâp Email hoặc Email đã tồi tại, bạn vui lòng nhập Email khác');</script>");
                 }
                 else
                 {
                     object[] obj = new object[7];
                     obj[0] = txtTendangnhap.Text;
                     obj[1] = md5.maHoa(txtPass.Text);
                     obj[2] = txtTennguoidung.Text;
                     obj[3] = txtDiachi.Text;
                     obj[4] = txtSDT.Text;
                     obj[5] = txtEmail.Text;
                     obj[6] = drpQuyen.SelectedValue;
                     SupportDb.ExecuteProcdure("DangKyThanhVien_Admin", obj);
                     Response.Write("<script>alert('Tài khoản của bạn đã được tạo thành công!');</script>");
                 }
             }
         }
         catch
         {
             Response.Write("<script>alert('Có lỗi xảy ra trong quá trình đăng ký!.Vui lòng kiểm tra lại!');</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('Mật khẩu quá ngắn!');</script>");
     }
 }
예제 #17
0
    void Chitietsanpham()
    {
        DataSet ds = new DataSet();

        object[] objht = new object[0];
        ds = SupportDb.ReturnDataSet("LayMaHoaDonLonNhat", objht);
        DataRow dr = ds.Tables[0].Rows[0];

        objDT = (DataTable)Session["Cart"];
        for (int i = 0; i < objDT.Rows.Count; i++)
        {
            object[] obj1 = new object[3];
            obj1[0] = Convert.ToInt32(dr["IDHoaDon"].ToString());
            obj1[1] = (Int32)objDT.Rows[i]["IDSanPham"];
            obj1[2] = (Int32)objDT.Rows[i]["SoLuong"];
            SupportDb.ExecuteProcdure("ThemChiTietHoaDon", obj1);
        }
    }
 protected void btx1_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in grv_timkiem.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("chk_Check0");
         if (chk != null && chk.Checked)
         {
             int      madh1  = Convert.ToInt32(grv_timkiem.DataKeys[row.RowIndex].Value);
             object[] obj112 = new object[1];
             obj112[0] = madh1;
             SupportDb.ExecuteProcdure("xoadonhang", obj112);
             lbl_thongbao.Text = "Xóa thành công !";
         }
     }
     Hienthidonhang();
     Panel2.Visible = false;
     Panel1.Visible = true;
 }
예제 #19
0
 protected void bt_xoa_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in grv_kqnguoidung.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("chk_Check0");
         if (chk != null && chk.Checked)
         {
             int      manguoidung1 = Convert.ToInt32(grv_kqnguoidung.DataKeys[row.RowIndex].Value);
             object[] objx         = new object[1];
             objx[0] = manguoidung1;
             SupportDb.ExecuteProcdure("xoanguoidung", objx);
             lbl_thongbao.Text = "Xóa thành công !";
         }
     }
     Hienthinguoidung();
     Panel2.Visible = false;
     Panel1.Visible = true;
     txt_ten.Text   = "";
 }
예제 #20
0
 protected void bt_capnhat_Click(object sender, EventArgs e)
 {
     object[] obj4 = new object[5];
     obj4[0] = Session["maquangcao"];
     obj4[1] = txt_tencongty.Text;
     obj4[2] = txt_diachi.Text;
     obj4[3] = txt_sdt.Text;
     obj4[4] = txt_email.Text;
     SupportDb.ExecuteProcdure("capnhatquangcao", obj4);
     lbl_thongbao.Text       = "Cập nhật thành công !";
     txt_tencongty.Text      = "";
     txt_diachi.Text         = "";
     txt_sdt.Text            = "";
     txt_email.Text          = "";
     ful_anhquangcao.Enabled = true;
     bt_them.Enabled         = true;
     bt_capnhat.Visible      = false;
     Hienthiquangcao();
 }
예제 #21
0
 protected void bt_capnhat_Click(object sender, EventArgs e)
 {
     object[] obj4 = new object[6];
     obj4[0] = Session["masanpham"];
     obj4[1] = txt_tensp.Text;
     obj4[2] = Convert.ToInt32(drp_nhomhang.SelectedValue);
     obj4[3] = Convert.ToInt32(txt_soluong.Text);
     obj4[4] = txt_chitiet.Text;
     obj4[5] = Convert.ToDouble(txt_dongia.Text);
     SupportDb.ExecuteProcdure("capnhatsanpham1", obj4);
     lbl_thongbao.Text  = "Cập nhật thành công !";
     txt_tensp.Text     = "";
     txt_soluong.Text   = "";
     txt_chitiet.Text   = "";
     txt_dongia.Text    = "";
     ful_anhsp.Enabled  = true;
     bt_them.Enabled    = true;
     bt_capnhat.Visible = false;
     Hienthisanpham();
 }
예제 #22
0
    protected void btThem_Click(object sender, EventArgs e)
    {
        object[] obj = new object[2];
        obj[0] = drpDanhmuc.SelectedValue;
        obj[1] = txtTenloai.Text;
        DataSet ds = new DataSet();

        ds = SupportDb.ReturnDataSet("KiemTraTrungLoai", obj);
        if (ds.Tables[0].Rows.Count > 0)
        {
            Response.Write("<script>alert('Loại sản phẩm đã tồn tại.Vui lòng kiểm tra lại!');</script>");
        }
        else
        {
            object[] obj1 = new object[2];
            obj1[0] = drpDanhmuc.SelectedValue;
            obj1[1] = txtTenloai.Text;
            SupportDb.ExecuteProcdure("ThemLoai", obj);
            Response.Write("<script>alert('Thêm loại thành công!');</script>");
        }
    }
 protected void bt_capnhat_Click(object sender, EventArgs e)
 {
     object[] obj4 = new object[3];
     obj4[0] = Session["madonhang"];
     obj4[1] = drp_tinhtrang.SelectedValue;
     obj4[2] = drp_ghichu.SelectedValue;
     SupportDb.ExecuteProcdure("capnhatdonhang1", obj4);
     lbl_thongbao.Text    = "Cập nhật thành công !";
     txt_tenkhach.Text    = "";
     txt_diachi.Text      = "";
     txt_sdt.Text         = "";
     txt_email.Text       = "";
     txt_ngaydathang.Text = "";
     txt_chuky.Text       = "";
     txt_tongtien.Text    = "";
     txt_pttt.Text        = "";
     txt_ptvc.Text        = "";
     Hienthidonhang();
     hienthitimkiem();
     bt_capnhat.Enabled = false;
 }
예제 #24
0
 protected void bt_Doi_Click(object sender, EventArgs e)
 {
     if (md5.maHoa(txtpasscu.Text) == Session["MatKhau"].ToString())
     {
         if (txtPassmoi.Text == txtPassmoinhaplai.Text)
         {
             object[] obj = new object[2];
             obj[0] = Session["IDKhachHang"].ToString();
             obj[1] = md5.maHoa(txtPassmoi.Text);
             SupportDb.ExecuteProcdure("ThayDoiMatKhau", obj);
             Session["MatKhau"] = md5.maHoa(txtPassmoi.Text);
             Response.Write("<script>alert('Mật khẩu đã được đổi thành công!');</script>");
         }
         else
         {
             Response.Write("<script>alert('Mật khẩu mới nhập lại chưa khớp!');</script>");
         }
     }
     else
     {
         Response.Write("<script>alert('Mật khẩu cũ không chính xác!');</script>");
     }
 }
 protected void btOK_Click(object sender, EventArgs e)
 {
     if (md5.maHoa(txtMatKhau.Text) == Session["MatKhau"].ToString())
     {
         object[] obj = new object[5];
         obj[0] = Session["IDKhachHang"].ToString();
         obj[1] = txtHoTen.Text;
         obj[2] = txtDiaChi.Text;
         obj[3] = txtSDT.Text;
         obj[4] = txtEmail.Text;
         SupportDb.ExecuteProcdure("ThayDoiThongTinCaNhan", obj);
         Session["HoTen"]  = txtHoTen.Text;
         Session["DiaChi"] = txtDiaChi.Text;
         Session["SDT"]    = txtSDT.Text;
         Session["Email"]  = txtEmail.Text;
         Response.Redirect("ThongTinKH.aspx");
     }
     else
     {
         Response.Write("<script>alert('Mật khẩu không chính xác!');</script>");
         txtMatKhau.Text = "";
     }
 }
예제 #26
0
    protected void bt_x_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in grv_sp.Rows)
        {
            CheckBox chk = (CheckBox)row.FindControl("chk_Check0");
            if (chk != null && chk.Checked)
            {
                int      masp1  = Convert.ToInt32(grv_sp.DataKeys[row.RowIndex].Value);
                object[] obj111 = new object[1];
                obj111[0] = masp1;
                SupportDb.ExecuteProcdure("xoasanpham", obj111);
                lbl_thongbao.Text = "Xóa thành công !";
            }
        }
        object[] obj011 = new object[1];
        obj011[0] = Session["manh01"];
        DataSet dsa = new DataSet();

        dsa = SupportDb.ReturnDataSet("timsptheomanh", obj011);
        grv_sp.DataSource = dsa;
        grv_sp.DataBind();
        Panel1.Visible = true;
        Panel2.Visible = false;
    }
예제 #27
0
 protected void bt_DangKy_Click(object sender, EventArgs e)
 {
     capcha_dangky.ValidateCaptcha(txt_MaBaoVe.Text);
     if (!capcha_dangky.UserValidated)
     {
         lbl_thongbao.Text = "Mã bảo vệ chưa chính xác";
         return;
     }
     else
     {
         lbl_thongbao.Text = "Thành công";
     }
     if (txt_MatKhau.Text.Length >= 6)//Password >6 kí tự mới được phép đăng ký
     {
         try
         {
             if (txt_MatKhau.Text == txt_MatKhau_Nhaplai.Text)
             {
                 object[] obj2 = new object[2];
                 obj2[0] = txt_TenDangNhap.Text;
                 obj2[1] = txt_Email.Text;
                 DataSet ds = new DataSet();
                 ds = SupportDb.ReturnDataSet("Kiemtra_User_Email", obj2);
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     lbl_thongbao.Text = "Tài khoản của bạn đã có người đăng ký. Vui lòng chọn tài khoản khác!";
                 }
                 else
                 {
                     if (ds.Tables[1].Rows.Count != 0)
                     {
                         lbl_thongbao.Text = "Bạn chưa nhâp Email hoặc Email đã tồi tại, bạn vui lòng nhập Email Khác";
                     }
                     else
                     {
                         object[] obj = new object[6];
                         obj[0] = txt_TenDangNhap.Text;
                         obj[1] = md5.maHoa(txt_MatKhau.Text);
                         obj[2] = txt_HoTen.Text;
                         obj[3] = txt_DiaChi.Text;
                         obj[4] = txt_SDT.Text;
                         obj[5] = txt_Email.Text;
                         SupportDb.ExecuteProcdure("DangKyThanhVien", obj);
                         lbl_thongbao.Text = "Tài khoản của bạn đã được tạo thành công!";
                     }
                 }
             }
             else
             {
                 lbl_thongbao.Text = "Mật khẩu chưa khớp. Vui lòng kiểm tra lại!";
             }
         }
         catch
         {
             lbl_thongbao.Text = "Có lỗi xảy ra trong quá trình đăng ký!. Vui lòng kiểm tra lại!";
         }
     }
     else
     {
         lbl_thongbao.Text = "Mật khẩu quá ngắn!";
     }
 }