Exemplo n.º 1
0
        //修改出院日期
        public static bool AlterHospitalization(int patientid)
        {
            string   cid  = Case_C.GetCaseID(patientid);
            DateTime hout = DateTime.Now;
            float    hsum = 0;
            List <Hospitalization> hospitalizations = SelectHospitalization(patientid);

            if (hospitalizations != null)
            {
                int days = (hout - hospitalizations[0].H_In).Days + 1;
                hsum = days * 50;
            }
            string sql = "UPDATE `hospital`.`hospitalization`"
                         + "SET `H_Out`='" + hout + "', `H_Sum`='" + hsum + "'WHERE `C_ID`='" + cid + "'";

            return(ExecuteSQL.ExecuteNonQuerySQL_GetBool(sql));
        }
Exemplo n.º 2
0
        //已知病人id查询药方信息
        public static List <Prescript> SelectPrescript(int patientid)
        {
            string         cid            = Case_C.GetCaseID(patientid);
            string         sql            = "SELECT * FROM `hospital`.`prescript` WHERE `C_ID` = '" + cid + "'";
            OdbcConnection odbcConnection = DB.DBManager.GetOdbcConnection();

            odbcConnection.Open();
            OdbcCommand    odbcCommand    = new OdbcCommand(sql, odbcConnection);
            OdbcDataReader odbcDataReader = odbcCommand.ExecuteReader(CommandBehavior.CloseConnection);

            if (odbcDataReader.HasRows)
            {
                List <Prescript> list = Prescript.getList(odbcDataReader);
                odbcConnection.Close();
                return(list);
            }
            else
            {
                odbcConnection.Close();
            }
            return(null);
        }