예제 #1
0
        //Thêm loại sản phẩm
        public int InsertLSP(LoaiSanPhamDTO loaiSanPham)
        {
            int    result = 0;
            string Query  = "Insert into LoaiSP values('" + loaiSanPham.MaLoai + "', N'" + loaiSanPham.TenLoai + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #2
0
        public int InsertPN(PhieuNhapDTO phieuNhap)
        {
            int    result = 0;
            string Query  = "Insert into PhieuNhap(MaPN, NgayNhap) values('" + phieuNhap.MaPN + "', N'" + phieuNhap.NgayNhap.ToShortDateString() + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #3
0
        //THÊM PHIẾU XUẤT
        public int InsertPX(PhieuXuatDTO phieuXuatDTO)
        {
            int    result = 0;
            string Query  = "Insert into PhieuXuat(MaPX, NgayXuat) values('" + phieuXuatDTO.MaPX + "', N'" + phieuXuatDTO.NgayXuat.ToShortDateString() + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #4
0
        //Thêm SẢN PHẨM
        public int InsertSP(SanPhamDTO sanPham)
        {
            int    result = 0;
            string Query  = "Insert into SanPham values (" + sanPham.MaSP + ",N'" + sanPham.Ten + "'," + sanPham.MaLoai + "," + sanPham.MaNCC + "," + sanPham.MaKichCo + ",N'" + sanPham.GioiTinh + "',N'" + sanPham.GhiChu + "'," + sanPham.DonGia + ")";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #5
0
        //Thêm CHI TIẾT PHIẾU NHẬP
        public int InsertCTPN(ChiTietPhieuNhapDTO chiTietPhieuNhap)
        {
            int    result = 0;
            string Query  = "Insert into CTPhieuNhap values('" + chiTietPhieuNhap.MaPN + "', '" + chiTietPhieuNhap.MaSP + "', '" + chiTietPhieuNhap.MaNCC + "', '" + chiTietPhieuNhap.SoLuong + "', '" + chiTietPhieuNhap.GiaNhap + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #6
0
        //Thêm CHI TIẾT PHIẾU xuất
        public int InsertCTPX(ChiTietPhieuXuatDTO chiTietPhieuXuat)
        {
            int    result = 0;
            string Query  = "Insert into CTPhieuXuat values('" + chiTietPhieuXuat.MaPX + "', '" + chiTietPhieuXuat.MaSP + "', '" + chiTietPhieuXuat.SoLuong + "', '" + chiTietPhieuXuat.MaKH + "','" + chiTietPhieuXuat.GiamGia + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #7
0
        //Thêm khách hàng
        public int InsertKH(KhachHangDTO khachHang)
        {
            int    result = 0;
            string Query  = "Insert into KhachHang values('" + khachHang.MaKH + "', N'" + khachHang.HoTen + "', N'" + khachHang.DiaChi + "', N'" + khachHang.SDT + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #8
0
        //THÊM
        public int InsertNV(NhanVienDTO nhanVien)
        {
            int    result = 0;
            string Query  = "Insert into NhanVien  values(N'" + nhanVien.MaNV + "',  N'" + nhanVien.HoTen + "', '" + nhanVien.NamSinh.ToShortDateString() + "', N'" + nhanVien.QueQuan + "','" + nhanVien.TenDangNhap + "','" + nhanVien.MatKhau + "','" + nhanVien.SDT + "'," + nhanVien.MaLoaiNguoiDung + ")";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }
예제 #9
0
        //Thêm nhà cung cấp
        public int InsertNCC(NhaCungCapDTO nhaCungCap)
        {
            int    result = 0;
            string Query  = "Insert into NhaCungCap values('" + nhaCungCap.MaNCC + "', N'" + nhaCungCap.HoTen + "', N'" + nhaCungCap.DiaChi + "', '" + nhaCungCap.SDT + "')";

            try
            {
                result = DBcon.ExecuteSPNoneQuery(Query);
            }
            catch (SqlException ex)
            {
            }
            return(result);
        }