Exemple #1
0
 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;
 }
Exemple #3
0
 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);
 }
Exemple #4
0
        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));
        }
Exemple #5
0
        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));
        }
Exemple #6
0
 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;
 }
Exemple #7
0
 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;
 }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        //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);
            }
        }
Exemple #11
0
 //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);
 }