public Cls_KhachHang_DTA(Cls_KhachHang_DTA KH_Data) { MaKH = KH_Data.MaKH; TenKH = KH_Data.TenKH; TheCard = KH_Data.TheCard; NgaySinh = KH_Data.NgaySinh; Phai = KH_Data.Phai; DienThoai = KH_Data.DienThoai; DiaChi = KH_Data.DiaChi; Email = KH_Data.Email; HinhThucDK = KH_Data.HinhThucDK; MaLoaiKH = KH_Data.MaLoaiKH; }
public void Insert_Update_Delete_KH(Cls_KhachHang_DTA KH_Data,string sThucThi) { sConn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SP_KhachHang"; cmd.Connection = this.sConn; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@MaKH", SqlDbType.Char); cmd.Parameters["@MaKH"].Value = KH_Data.MaKH; cmd.Parameters.Add("@TenKH", SqlDbType.NVarChar); cmd.Parameters["@TenKH"].Value = KH_Data.TenKH; cmd.Parameters.Add("@TheCard", SqlDbType.NVarChar); cmd.Parameters["@TheCard"].Value = KH_Data.TheCard; cmd.Parameters.Add("@NgaySinh", SqlDbType.DateTime); cmd.Parameters["@NgaySinh"].Value = KH_Data.NgaySinh; cmd.Parameters.Add("@Phai", SqlDbType.Bit); cmd.Parameters["@Phai"].Value = KH_Data.Phai; cmd.Parameters.Add("@DienThoai", SqlDbType.NVarChar); cmd.Parameters["@DienThoai"].Value = KH_Data.DienThoai; cmd.Parameters.Add("@DiaChi", SqlDbType.NVarChar); cmd.Parameters["@DiaChi"].Value = KH_Data.DiaChi; cmd.Parameters.Add("@Email", SqlDbType.NVarChar); cmd.Parameters["@Email"].Value = KH_Data.Email ; cmd.Parameters.Add("@HinhThucDK", SqlDbType.NVarChar); cmd.Parameters["@HinhThucDK"].Value = KH_Data.HinhThucDK; cmd.Parameters.Add("@MaLoaiKH", SqlDbType.Char); cmd.Parameters["@MaLoaiKH"].Value = KH_Data.MaLoaiKH; cmd.Parameters.Add("@sqlTemp", SqlDbType.NVarChar); if(sThucThi=="Insert"||sThucThi=="Delete"||sThucThi=="Update") cmd.Parameters["@sqlTemp"].Value = sThucThi; cmd.ExecuteNonQuery(); sConn.Close(); }
public Cls_KhachHang_DTA(Cls_KhachHang_DTA KH_Data) { MaKH = KH_Data.MaKH; TenKH = KH_Data.TenKH; TheCard = KH_Data.TheCard; NgaySinh = KH_Data.NgaySinh; Phai = KH_Data.Phai; DienThoai = KH_Data.DienThoai; DiaChi = KH_Data.DiaChi; Email = KH_Data.Email; HinhThucDK = KH_Data.HinhThucDK; MaLoaiKH = KH_Data.MaLoaiKH; }
public void Insert_Update_Delete(Cls_KhachHang_DTA KH_DATA,string sThucThi) { KH_BUS.Insert_Update_Delete_KH(KH_DATA, sThucThi); }