public short GetList(string szPatientID, string szVisitNo, ref List <DiagComparing> lstDiagnosisDict) { if (base.HerenHisAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } StringBuilder sbField = new StringBuilder(); sbField.AppendFormat("*"); string szCondition = string.Format("1=1"); szCondition = string.Format("{0} AND {1} = '{2}' AND {3}='{4}'" , szCondition , SystemData.DiagComparingTable.PATIENT_ID , szPatientID , SystemData.DiagComparingTable.VISIT_NO , szVisitNo); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE , sbField.ToString(), TableName, szCondition); IDataReader dataReader = null; try { dataReader = base.HerenHisAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (lstDiagnosisDict == null) { lstDiagnosisDict = new List <DiagComparing>(); } lstDiagnosisDict.Clear(); do { DiagComparing model = new DiagComparing(); for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.IsDBNull(i)) { continue; } PropertyInfo property = Reflect.GetPropertyInfo(typeof(DiagComparing), dataReader.GetName(i)); bool result = Reflect.SetPropertyValue(model, property, dataReader.GetValue(i)); } lstDiagnosisDict.Add(model); } while (dataReader.Read()); return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { base.HerenHisAccess.CloseConnnection(false); } }
public short GetBAJK13s(decimal brxh, ref List <BAJK13> lstBAJK13s) { if (base.BAJKDataAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } StringBuilder sbField = new StringBuilder(); sbField.AppendFormat("*"); string szCondition = string.Format("1=1"); szCondition = string.Format("{0} AND {1} = {2} " , szCondition , SystemData.BAJK13Table.KEY1301 , brxh); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE , sbField.ToString(), TableName, szCondition); IDataReader dataReader = null; try { dataReader = base.BAJKDataAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (lstBAJK13s == null) { lstBAJK13s = new List <BAJK13>(); } do { BAJK13 BAJK13 = new BAJK13(); for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.IsDBNull(i)) { continue; } PropertyInfo property = Reflect.GetPropertyInfo(typeof(BAJK13), dataReader.GetName(i)); bool result = Reflect.SetPropertyValue(BAJK13, property, dataReader.GetValue(i)); } lstBAJK13s.Add(BAJK13); } while (dataReader.Read()); return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { base.BAJKDataAccess.CloseConnnection(false); } }
public short GetBAJK08s(string patientID, string visitID, ref BAJK08 bAJK08) { if (base.BAJKDataAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } StringBuilder sbField = new StringBuilder(); sbField.AppendFormat("*"); string szCondition = string.Format("1=1"); szCondition = string.Format("{0} AND {1} = '{2}' AND {3}={4} " , szCondition , SystemData.BAJK08Table.COL0801 , patientID , SystemData.BAJK08Table.COL0804 , visitID); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE , sbField.ToString(), TableName, szCondition); IDataReader dataReader = null; try { dataReader = base.BAJKDataAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } if (bAJK08 == null) { bAJK08 = new BAJK08(); } for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.IsDBNull(i)) { continue; } PropertyInfo property = Reflect.GetPropertyInfo(typeof(BAJK08), dataReader.GetName(i)); bool result = Reflect.SetPropertyValue(bAJK08, property, dataReader.GetValue(i)); } return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { base.BAJKDataAccess.CloseConnnection(false); } }
public short GetModel(string id, ref RecBrowseRequest model) { if (base.MedQCAccess == null) { return(SystemData.ReturnValue.PARAM_ERROR); } StringBuilder sbField = new StringBuilder(); sbField.AppendFormat("*"); string szCondition = string.Format("1=1"); szCondition = string.Format("{0} AND {1} = '{2}' " , szCondition , KeyName , id); string szSQL = string.Format(SystemData.SQL.SELECT_WHERE , sbField.ToString(), TableName, szCondition); IDataReader dataReader = null; try { dataReader = base.MedQCAccess.ExecuteReader(szSQL, CommandType.Text); if (dataReader == null || dataReader.IsClosed || !dataReader.Read()) { return(SystemData.ReturnValue.RES_NO_FOUND); } model = new RecBrowseRequest(); for (int i = 0; i < dataReader.FieldCount; i++) { if (dataReader.IsDBNull(i)) { continue; } PropertyInfo property = Reflect.GetPropertyInfo(typeof(RecBrowseRequest), dataReader.GetName(i)); bool result = Reflect.SetPropertyValue(model, property, dataReader.GetValue(i)); } return(SystemData.ReturnValue.OK); } catch (Exception ex) { LogManager.Instance.WriteLog("", new string[] { "szSQL" }, new object[] { szSQL }, ex); return(SystemData.ReturnValue.EXCEPTION); } finally { base.MedQCAccess.CloseConnnection(false); } }