Ejemplo n.º 1
0
        public static bool ThemChiTietHDNhap(clsChiTietHDNhap_DTO cthd)
        {
            string query = string.Format("insert into ChiTietHDNhap(MaHDNhap, MaChiTietSP, DonGiaNhap, SoLuong, TrangThai) values('{0}', '{1}', {2}, {3} ,'{4}')", cthd.MaHDNhap, cthd.MaChiTietSP, cthd.DonGia, cthd.SoLuong, cthd.TrangThai);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 2
0
        public static bool CapNhatSanPham(clsSanPham_DTO sp)
        {
            string query = string.Format("update SanPham set TenSP = N'{0}', MaLoaiSP = '{1}', MaNhaSX = '{2}', NgayNhapKho ='{3}', GioiTinh = N'{4}', TrangThai = '{5}' where MaSP = '{6}'", sp.TenSP, sp.MaLoaiSP, sp.MaNhaSX, sp.NgayNhapKho, sp.GioiTinh, sp.TrangThai_SP, sp.MaSP);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 3
0
        public static bool ThemHDNhap(clsHoaDonNhap_DTO hd)
        {
            string query = string.Format("insert into HoaDonNhap(MaHdNhap, MaNVLap, NgayLapHD, TongTien, TrangThai) values('{0}', '{1}', '{2}',{3}, '{4}')", hd.MaHDNhap, hd.MaNVLap, hd.NgayLapHD, hd.TongTien, hd.TrangThai);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 4
0
        public static bool ThemSanPham(clsSanPham_DTO sp)
        {
            string query = string.Format("insert into SanPham(MaSP, TenSP, MaLoaiSP, MaNhaSX, NgayNhapKho, GioiTinh, TrangThai) values('{0}',N'{1}','{2}','{3}','{4}',N'{5}','{6}')", sp.MaSP, sp.TenSP, sp.MaLoaiSP, sp.MaNhaSX, sp.NgayNhapKho, sp.GioiTinh, sp.TrangThai_SP);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 5
0
        public static bool CapNhatCTSP(clsChiTietSanPham_DTO ctsp)
        {
            string query = string.Format("update ChiTietSanPham set HinhAnh = '{0}', GiaBan = {1}, TrangThai = '{2}' where MaSP = '{3}' and MaMau = '{4}' and MaChatLieu = '{5}' and MaSize = '{6}'", ctsp.HinhAnh, ctsp.GiaTien, ctsp.TrangThai, ctsp.MaSP, ctsp.MaMau, ctsp.MaChatLieu, ctsp.MaSize);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 6
0
        public static bool CapNhatTrangThai(bool trangThai, string maSP, string maMau, string maChatLieu, string maSize)
        {
            string query = string.Format("update ChiTietSanPham set TrangThai = '{0}' where maSP = '{1}' and maMau = '{2}' and maChatLieu ='{3}' and maSize = '{4}'", trangThai, maSP, maMau, maChatLieu, maSize);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 7
0
        public static bool CapNhatSoLuong(string maCTSP, int SL)
        {
            string query = string.Format("update ChiTietSanPham set SoLuongTonKho = {0} where maChiTietSP = '{1}'", SL, maCTSP);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }
Ejemplo n.º 8
0
        public static bool ThemChiTietSP(clsChiTietSanPham_DTO ctsp)
        {
            string query = string.Format("insert into ChiTietSanPham(MaChiTietSP, MaSP, MaMau, MaChatLieu, MaSize, HinhAnh, SoLuongTonKho, GiaBan, TrangThai) values('{8}', '{0}','{1}', '{2}', '{3}', '{4}', {5}, {6}, '{7}')", ctsp.MaSP, ctsp.MaMau, ctsp.MaChatLieu, ctsp.MaSize, ctsp.HinhAnh, ctsp.SoLuongTonKho, ctsp.GiaTien, ctsp.TrangThai, ctsp.MaChiTietSP);
            int    kq    = DataProvider.ExecuteInsertUpdateDelete(query);

            DataProvider.CloseConnect();
            return(kq == 1);
        }