public static void saveCL(ChatLieuDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[2]; sqlP[0] = new SqlParameter("@MaChatLieu", hs.MaChatLieu1); sqlP[1] = new SqlParameter("@TenChatLieu", hs.TenChatLieu1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertChatLieu", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateChatLieu", sqlP, Conn); } }
public static void saveDVT(DonViTinhDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[2]; sqlP[0] = new SqlParameter("@MaDonVi", hs.MaDonVi1); sqlP[1] = new SqlParameter("@TenDonVi", hs.TenDonVi1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertDonViTinh", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateDonViTinh", sqlP, Conn); } }
public static void saveNH(NhomHangDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[2]; sqlP[0] = new SqlParameter("@MaNhom", hs.MaNhom1); sqlP[1] = new SqlParameter("@TenNhom", hs.TenNhom1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertNhomHang", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateNhomHang", sqlP, Conn); } }
public static void saveTL(TheLoaiDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[3]; sqlP[0] = new SqlParameter("@MaLoai", hs.MaLoai1); sqlP[1] = new SqlParameter("@MaNhom", hs.MaNhom1); sqlP[2] = new SqlParameter("@TenLoai", hs.TenLoai1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertTheLoai", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateTheLoai", sqlP, Conn); } }
public static void saveKH(KhachHangDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[4]; sqlP[0] = new SqlParameter("@MaKhach", hs.MaKhachHang1); sqlP[1] = new SqlParameter("@TenKhach", hs.TenKhachHang1); sqlP[2] = new SqlParameter("@DiaChi", hs.DiaChi1); sqlP[3] = new SqlParameter("@DienThoai", hs.DienThoai1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertKhachHang", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateKhachHang", sqlP, Conn); } }
public static void saveAccount(UserDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[4]; sqlP[0] = new SqlParameter("@userName", hs.userName); sqlP[1] = new SqlParameter("@passWord", hs.passWord); sqlP[2] = new SqlParameter("@status", hs.status); sqlP[3] = new SqlParameter("@role", hs.role); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertUser", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateUser", sqlP, Conn); } }
public static void saveHDB(HDBanDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[5]; sqlP[0] = new SqlParameter("@SoHDB", hs.SoHDB1); sqlP[1] = new SqlParameter("@MaNV", hs.MaNV1); sqlP[2] = new SqlParameter("@NgayBan", hs.NgayBan1); sqlP[3] = new SqlParameter("@MaKhach", hs.MaKhach1); sqlP[4] = new SqlParameter("@TongTien", hs.TongTien1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertHDBan", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateHDBan", sqlP, Conn); } }
public static void saveCTHDB(CTHDBDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[5]; sqlP[0] = new SqlParameter("@SoHDB", hs.SoHDB1); sqlP[1] = new SqlParameter("@MaHang", hs.MaHang1); sqlP[2] = new SqlParameter("@SoLuong", hs.SoLuong1); sqlP[3] = new SqlParameter("@GiamGia", hs.GiamGia1); sqlP[4] = new SqlParameter("@ThanhTien", hs.ThanhTien1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertCTHDB", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateCTHDB", sqlP, Conn); } }
public static void saveHang(HangHoaDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[13]; sqlP[0] = new SqlParameter("@MaHang", hs.MaHang1); sqlP[1] = new SqlParameter("@TenHangHoa", hs.TenHangHoa1); sqlP[2] = new SqlParameter("@MaNhom", hs.MaNhom1); sqlP[3] = new SqlParameter("@SoLuong", hs.SoLuong1); //sqlP[4] = new SqlParameter("@DonGiaNhap", hs.DonGiaNhap1); if (hs.DonGiaNhap1 == 0) { sqlP[4] = new SqlParameter("@DonGiaNhap", SqlDbType.Int); sqlP[4].Value = DBNull.Value; } else { sqlP[4] = new SqlParameter("@DonGiaNhap", hs.DonGiaNhap1); } sqlP[5] = new SqlParameter("@MaLoai", hs.MaLoai1); sqlP[6] = new SqlParameter("@NhapKhau", hs.NhapKhau1); sqlP[7] = new SqlParameter("@MaDonVi", hs.MaDonVi1); sqlP[8] = new SqlParameter("@MaChatLieu", hs.MaChatLieu1); sqlP[9] = new SqlParameter("@MaCongDung", hs.MaCongDung1); sqlP[10] = new SqlParameter("@MaNoiSX", hs.MaNoiSX1); //sqlP[11] = new SqlParameter("@Anh", hs.Anh1); if (hs.Anh1 == null) { sqlP[11] = new SqlParameter("@Anh", SqlDbType.Image); sqlP[11].Value = DBNull.Value; } else { sqlP[11] = new SqlParameter("@Anh", hs.Anh1); } sqlP[12] = new SqlParameter("@GhiChu", hs.GhiChu1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertHangHoa", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateHangHoa", sqlP, Conn); } }
public static void saveNV(NhanVienDTO hs, string method) { SqlParameter[] sqlP = new SqlParameter[9]; sqlP[0] = new SqlParameter("@MaNV", hs.MaNV1); sqlP[1] = new SqlParameter("@TenNV", hs.TenNV1); sqlP[2] = new SqlParameter("@GioiTinh", hs.GioiTinh1); sqlP[3] = new SqlParameter("@NgaySinh", hs.NgaySinh1); sqlP[4] = new SqlParameter("@DienThoai", hs.DienThoai1); sqlP[5] = new SqlParameter("@DiaChi", hs.DiaChi1); sqlP[6] = new SqlParameter("@MaNhom", hs.MaNhom1); sqlP[7] = new SqlParameter("@MaCa", hs.MaCa1); sqlP[8] = new SqlParameter("@MaCV", hs.MaCV1); if (method == sys.INSERT) { GenericDAL.execNonQuery("sp_InsertNhanVien", sqlP, Conn); } else if (method == sys.UPDATE) { GenericDAL.execNonQuery("sp_UpdateNhanVien", sqlP, Conn); } }
public static void DeleteCL(string hs) { SqlParameter[] sqlP = new SqlParameter[1]; sqlP[0] = new SqlParameter("@MaChatLieu", hs); GenericDAL.execNonQuery("sp_DeleteChatLieu", sqlP, Conn); }
public static void DeleteCTHDN(string hs) { SqlParameter[] sqlP = new SqlParameter[1]; sqlP[0] = new SqlParameter("@SoHDN", hs); GenericDAL.execNonQuery("sp_DeleteCTHDN", sqlP, Conn); }
public static void DeleteNH(string hs) { SqlParameter[] sqlP = new SqlParameter[1]; sqlP[0] = new SqlParameter("@MaNhom", hs); GenericDAL.execNonQuery("sp_DeleteNhomHang", sqlP, Conn); }
public static void deleteAccount(int uid) { SqlParameter[] sqlP = new SqlParameter[1]; sqlP[0] = new SqlParameter("@uid", uid); GenericDAL.execNonQuery("sp_DeleteUser", sqlP, Conn); }
public static void DeleteDVT(string hs) { SqlParameter[] sqlP = new SqlParameter[1]; sqlP[0] = new SqlParameter("@MaDonVi", hs); GenericDAL.execNonQuery("sp_DeleteDonViTinh", sqlP, Conn); }