/// <summary> /// 修改病人信息 /// </summary> /// <param name="objPatientInfo"></param> /// <returns></returns> public int UpdatePatientInfo(PatientInfo objPatientInfo) { StringBuilder sqlBuilder = new StringBuilder(); sqlBuilder.Append("update AdditionalPatients set PatientName='{0}',PatientGender='{1}'," + "Patientstarttime='{2}',PatientAge='{3}',PatientDepartment='{4}',PatientNum='{5}'"); sqlBuilder.Append(" where PatientBednum={6} and UseFlag=0"); string sql = string.Format(sqlBuilder.ToString(), objPatientInfo.PatientName, objPatientInfo.PatientGender, objPatientInfo.Patientstarttime, objPatientInfo.PatientAge, objPatientInfo.PatientDepartment, objPatientInfo.PatientNum, objPatientInfo.PatientBednum); try { return(Convert.ToInt32(SQLiteHelper.Update(sql))); } catch (SQLiteException ex) { SQLiteHelper.WriteLog(" public int UpdatePatientInfo(PatientInfo objPatientInfo)", ex.Message); throw new Exception("数据库操作出现异常!具体信息:\r\n" + ex.Message); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int UpdatePatientInfo(PatientInfo objPatientInfo)", ex.Message); throw ex; } }
/// <summary> /// 插入新配置的床位信息,覆盖上次的信息 /// </summary> /// <param name="objBedConfigInfo"></param> /// <returns></returns> public int InsertBedInfo(BedConfigInfo objBedConfigInfo) { string sql = "update BedConfig set Bedcount='{0}', Bedrows='{1}' where Bedflag=1"; sql = string.Format(sql, objBedConfigInfo.Bedcount, objBedConfigInfo.Bedrows); return(SQLiteHelper.Update(sql)); }
public int delSetInfo(int bednum) { string sql = "DELETE FROM SetInfo WHERE PatientBednum ={0} "; sql = string.Format(sql, bednum); return(SQLiteHelper.Update(sql)); }
public int DeletePatientHisInfo() { string sql = "DELETE FROM Patients WHERE UseFlag =1 "; sql = string.Format(sql); return(SQLiteHelper.Update(sql)); }
public int UpdateUUID(String UUID) { string sql = "update UUIDINFO set UUID='{0}'"; sql = string.Format(sql, UUID); return(SQLiteHelper.Update(sql)); }
/// <summary> /// 添加医院信息 /// </summary> public int AddHospitalInfo(HospitalInfo objHospitalInfo) { string sql = "update HospitalInfo set HospitalName='{0}',Department='{1}' where Flag=1"; sql = string.Format(sql, objHospitalInfo.HospitalName, objHospitalInfo.Department); int res = SQLiteHelper.Update(sql); return(res); }
public int insertInfo(HospitalInfo hospitalInfo) { string sql = "insert into HospitalInfo(HospitalName,Department,Flag) values('{0}','{1}','{2}') "; sql = string.Format(sql, hospitalInfo.HospitalName, hospitalInfo.Department, 1); int res = SQLiteHelper.Update(sql); return(res); }
public int DeleAll() { string sql = "DELETE FROM PatientBodyInfo"; string sql1 = "DELETE FROM Patients"; string sql2 = "DELETE FROM AdditionalPatients"; SQLiteHelper.Update(sql1); SQLiteHelper.Update(sql2); return(SQLiteHelper.Update(sql)); }
/// <summary> /// 设置出院标志 /// </summary> public int setuseflag(int bednum) { string sql = "update AdditionalPatients set UseFlag = 1 where PatientBednum={0}"; sql = string.Format(sql, bednum); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int setuseflag(int bednum)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
public int AddSetInfo(SetInfo objSetInfo) { string sql = "insert into SetInfo(PatientBednum,IsEnable)"; sql += "values({0},{1})"; sql = string.Format(sql, objSetInfo.PatientBednum, objSetInfo.IsEnable); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int AddSetInfo(SetInfo objSetInfo)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
public int Addbednum(int bednum) { string sql = "insert into Patients(PatientBednum,UseFlag)"; sql += "values({0},{1})"; sql = string.Format(sql, bednum, 0); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int Addbednum(int bednum)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
public int AddUsbPatient(PatientInfo objPatientInfo) { string sql = "insert into Patients(PatientBednum,Patientstarttime,UseFlag)"; sql += " values({0},'{1}',{2})"; sql = string.Format(sql, objPatientInfo.PatientBednum, objPatientInfo.Patientstarttime, 0); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int AddUsbPatient(PatientInfo objPatientInfo)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
/// <summary> /// 添加病人信息 /// </summary> /// <param name="objPatientInfo"></param> /// <returns></returns> public int AddPatients(PatientInfo objPatientInfo) { string sql = "insert into Patients(PatientName,PatientBednum,PatientGender,PatientAge,Patientstarttime,PatientDepartment,PatientNum,UseFlag)"; sql += "values('{0}',{1},'{2}','{3}','{4}','{5}','{6}',{7})"; sql = string.Format(sql, objPatientInfo.PatientName, objPatientInfo.PatientBednum, objPatientInfo.PatientGender, objPatientInfo.PatientAge , objPatientInfo.Patientstarttime, objPatientInfo.PatientDepartment, objPatientInfo.PatientNum, 0); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { throw new Exception("添加数据出错!" + ex.Message); } }
public int AddPatientSaveInfo(PatientSaveData objPatientSaveData) { string sql = "insert into PatientSaveData(Time,Mode,Bloodo2,Pluse,Flow,Error,GetO2Time,GetO2AllTime)"; sql += "values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')"; sql = string.Format(sql, objPatientSaveData.PatientBodyInfotime, objPatientSaveData.Model , objPatientSaveData.BloodO2, objPatientSaveData.Pluse, objPatientSaveData.Flux, objPatientSaveData.Error, objPatientSaveData.GetO2time, objPatientSaveData.GetO2totaltime); try { return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int AddPatientSaveInfo(PatientSaveData objPatientSaveData)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
public int SetShowInfo(int a) { string sql = " update ShowInfo set AllOrPart=" + a.ToString(); try { return(Convert.ToInt32(SQLiteHelper.Update(sql))); } catch (SQLiteException ex) { SQLiteHelper.WriteLog(" public int SetShowInfo(int a)", ex.Message); throw new Exception("数据库操作出现异常!具体信息:\r\n" + ex.Message); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int SetShowInfo(int a)", ex.Message); throw ex; } }
/// <summary> /// 出院 /// </summary> /// <param name="budnum"></param> /// <returns></returns> public int addendtime(int budnum) { string sql = " update AdditionalPatients set Patientendtime = '{0}' where PatientBednum=" + budnum.ToString() + " and UseFlag=0"; sql = string.Format(sql, DateTime.Now.ToString()); try { return(Convert.ToInt32(SQLiteHelper.Update(sql))); } catch (SqlException ex) { SQLiteHelper.WriteLog(" public int addendtime(int budnum)", ex.Message); throw new Exception("数据库操作出现异常!具体信息:\r\n" + ex.Message); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int addendtime(int budnum)", ex.Message); throw ex; } }
/// <summary> /// 根据接收到的数据添加到数据库 /// </summary> /// <param name="objPatientBodyInfo"></param> /// <returns></returns> public int AddPatientBodyInfo(PatientBodyInfo objPatientBodyInfo) { if (objPatientBodyInfo == null) { return(0); } string sql = "insert into PatientBodyInfo(PatientBodyInfotime,PatientBednum,BloodO2,Pluse,GetO2time,Flux,Model,Error,GetO2totaltime,UseFlag)"; sql += "values('{0}',{1},'{2}','{3}','{4}','{5}','{6}','{7}','{8}',{9})"; sql = string.Format(sql, objPatientBodyInfo.PatientBodyInfotime, objPatientBodyInfo.PatientBednum, objPatientBodyInfo.BloodO2, objPatientBodyInfo.Pluse, objPatientBodyInfo.GetO2time, objPatientBodyInfo.Flux, objPatientBodyInfo.Model, objPatientBodyInfo.Error, objPatientBodyInfo.GetO2totaltime, objPatientBodyInfo.UseFlag); try { // SQLiteHelper.WriteLog(" public int AddPatientBodyInfo(PatientBodyInfo objPatientBodyInfo)", ex.Message); return(SQLiteHelper.Update(sql)); } catch (Exception ex) { SQLiteHelper.WriteLog(" public int AddPatientBodyInfo(PatientBodyInfo objPatientBodyInfo)", ex.Message); throw new Exception("添加数据出错!" + ex.Message); } }
public int Clear() { string sql = "DELETE FROM PatientSaveData "; return(SQLiteHelper.Update(sql)); }