コード例 #1
0
ファイル: HospitalBed.cs プロジェクト: hpbaotho/benhvien
 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);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
ファイル: HospitalBed.cs プロジェクト: hpbaotho/benhvien
 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);
 }
コード例 #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));
        }
コード例 #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));
        }
コード例 #6
0
ファイル: HospitalBed.cs プロジェクト: hpbaotho/benhvien
 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;
 }
コード例 #7
0
ファイル: HospitalBed.cs プロジェクト: hpbaotho/benhvien
 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;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
            }
        }
コード例 #11
0
ファイル: HospitalBed.cs プロジェクト: hpbaotho/benhvien
 //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;
 }
コード例 #12
0
 public FormHostpitalBedDetail(HospitalBed hbDetail)
 {
     InitializeComponent();
     HBDetail = hbDetail;
     SetHospitalBedDetail(hbDetail);
 }