public static int InsertHospitalBed() { HospitalBed newHB = new HospitalBed(0, 0, 0); String sqlInsert = @"INSERT INTO HOSPITALBED(PATIENT,STATE) VALUES (@PATIENT,@STATE)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", newHB.Patient), new SqlParameter("@STATE",newHB.State)}; return SqlResult.ExecuteNonQuery(sqlInsert, sqlParameters); }
private void SetHospitalBedDetail(HospitalBed hbDetail) { textBoxHospitalBedID.Text = hbDetail.BedID.ToString(); textBoxPatientID.Text = hbDetail.Patient.ToString(); if (hbDetail.State == 0) comboBoxState.SelectedIndex = 0; else comboBoxState.SelectedIndex = 1; }
public static int UpdateHospitalBed(HospitalBed updateHB) { string sqlUpdate = @"UPDATE HOSPITALBED SET PATIENT = @PATIENT, STATE = @STATE WHERE BEDID=@BEDID"; SqlParameter[] sqlParameters = { new SqlParameter("@BEDID", updateHB.BedID), new SqlParameter("@PATIENT", updateHB.Patient), new SqlParameter("@STATE", updateHB.State)}; return SqlResult.ExecuteNonQuery(sqlUpdate, sqlParameters); }
public static int InsertHospitalBed() { HospitalBed newHB = new HospitalBed(0, 0, 0); String sqlInsert = @"INSERT INTO HOSPITALBED(PATIENT,STATE) VALUES (@PATIENT,@STATE)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", newHB.Patient), new SqlParameter("@STATE", newHB.State) }; return(SqlResult.ExecuteNonQuery(sqlInsert, sqlParameters)); }
public static int UpdateHospitalBed(HospitalBed updateHB) { string sqlUpdate = @"UPDATE HOSPITALBED SET PATIENT = @PATIENT, STATE = @STATE WHERE BEDID=@BEDID"; SqlParameter[] sqlParameters = { new SqlParameter("@BEDID", updateHB.BedID), new SqlParameter("@PATIENT", updateHB.Patient), new SqlParameter("@STATE", updateHB.State) }; return(SqlResult.ExecuteNonQuery(sqlUpdate, sqlParameters)); }
public static HospitalBed GetHospitalBed(int bedID) { HospitalBed hB = new HospitalBed(); int tempInterger; string sqlSelect = @"SELECT BEDID,PATIENT, STATE FROM HOSPITALBED WHERE (BEDID=@BEDID)"; SqlParameter[] sqlParameters = { new SqlParameter("@BEDID", bedID) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect,sqlParameters); int.TryParse(dataTable.Rows[0][0].ToString(), out tempInterger); hB.BedID = tempInterger; hB.Patient = int.Parse(dataTable.Rows[0][1].ToString()); hB.State = int.Parse(dataTable.Rows[0][2].ToString()); return hB; }
public static HospitalBed GetHospitalBed(String patient) { HospitalBed hB = new HospitalBed(); string sqlSelect = @"SELECT BEDID, PATIENT, STATE, FROM HOSPITALBED WHERE (PATIENT=@PATIENT)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", int.Parse(patient)) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect,sqlParameters); if (dataTable.Rows.Count > 0) { hB.BedID = Convert.ToInt32(dataTable.Rows[0][0]); hB.Patient = Convert.ToInt32(dataTable.Rows[0][1].ToString()); hB.State = int.Parse(dataTable.Rows[0][2].ToString()); } return hB; }
public static HospitalBed GetHospitalBed(int bedID) { HospitalBed hB = new HospitalBed(); int tempInterger; string sqlSelect = @"SELECT BEDID,PATIENT, STATE FROM HOSPITALBED WHERE (BEDID=@BEDID)"; SqlParameter[] sqlParameters = { new SqlParameter("@BEDID", bedID) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect, sqlParameters); int.TryParse(dataTable.Rows[0][0].ToString(), out tempInterger); hB.BedID = tempInterger; hB.Patient = int.Parse(dataTable.Rows[0][1].ToString()); hB.State = int.Parse(dataTable.Rows[0][2].ToString()); return(hB); }
public static HospitalBed GetHospitalBed(String patient) { HospitalBed hB = new HospitalBed(); string sqlSelect = @"SELECT BEDID, PATIENT, STATE, FROM HOSPITALBED WHERE (PATIENT=@PATIENT)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", int.Parse(patient)) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect, sqlParameters); if (dataTable.Rows.Count > 0) { hB.BedID = Convert.ToInt32(dataTable.Rows[0][0]); hB.Patient = Convert.ToInt32(dataTable.Rows[0][1].ToString()); hB.State = int.Parse(dataTable.Rows[0][2].ToString()); } return(hB); }
//Check patient already have bed or not public static Boolean CheckPatient(int patientID) { HospitalBed hB = new HospitalBed(); string sqlSelect = @"SELECT PATIENT, STATE, BEDID FROM HOSPITALBED WHERE (PATIENT=@PATIENT)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", patientID) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect, sqlParameters); if (dataTable.Rows.Count > 0) { return(true); } else { return(false); } }
//Check patient already have bed or not public static Boolean CheckPatient(int patientID) { HospitalBed hB = new HospitalBed(); string sqlSelect = @"SELECT PATIENT, STATE, BEDID FROM HOSPITALBED WHERE (PATIENT=@PATIENT)"; SqlParameter[] sqlParameters = { new SqlParameter("@PATIENT", patientID) }; DataTable dataTable = SqlResult.ExecuteQuery(sqlSelect, sqlParameters); if(dataTable.Rows.Count >0) return true; else return false; }
public FormHostpitalBedDetail(HospitalBed hbDetail) { InitializeComponent(); HBDetail = hbDetail; SetHospitalBedDetail(hbDetail); }