public void Insert_Delete_Update(Cls_PhieuDat_DTA PD_Data, string sThucThi) { sConn.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandText = "SP_PhieuDatPhong"; cmd.Connection = this.sConn; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@SoPD", SqlDbType.Char); cmd.Parameters["@SoPD"].Value = PD_Data.SoPD; cmd.Parameters.Add("@NgayDat", SqlDbType.DateTime); cmd.Parameters["@NgayDat"].Value = PD_Data.NgayDat; cmd.Parameters.Add("@GioDat", SqlDbType.NVarChar); cmd.Parameters["@GioDat"].Value = PD_Data.GioDat; cmd.Parameters.Add("@BuoiDat", SqlDbType.NVarChar); cmd.Parameters["@BuoiDat"].Value = PD_Data.BuoiDat; cmd.Parameters.Add("@TienDatCoc", SqlDbType.Float); cmd.Parameters["@TienDatCoc"].Value = PD_Data.TienDatCoc; cmd.Parameters.Add("@MaPH", SqlDbType.Char); cmd.Parameters["@MaPH"].Value = PD_Data.MaPH; cmd.Parameters.Add("@MaKH", SqlDbType.Char); cmd.Parameters["@MaKH"].Value = PD_Data.MaKH; cmd.Parameters.Add("@sqlTemp", SqlDbType.NVarChar); if (sThucThi == "Insert" || sThucThi == "Delete" || sThucThi == "Update") { cmd.Parameters["@sqlTemp"].Value = sThucThi; } cmd.ExecuteNonQuery(); sConn.Close(); }
public void Insert_Update_Delete(Cls_PhieuDat_DTA PD_DATA, string sThucThi) { PD_BUS.Insert_Delete_Update(PD_DATA, sThucThi); }