/// <summary> /// 查询是否存在指定ID的记录 /// </summary> /// <param name="ipatientInfLocalId"></param> /// <returns></returns> public override bool Exists(IModel ipatientInfLocalId) { MPatientInfLocalId patientInfLocalId = (MPatientInfLocalId)ipatientInfLocalId; strSql = "select * from " + TableName + " where PATIENT_ID='" + patientInfLocalId.PATIENT_ID + "' and " + "LOCAL_ID_CLASS = '" + patientInfLocalId.LOCAL_ID_CLASS + "'"; return(recordIsExist(strSql)); }
/// <summary> /// 插入一条病人信息与本地ID对照记录 /// </summary> /// <param name="ipatientInfLocalId"></param> /// <returns></returns> public override int Add(IModel ipatientInfLocalId) { MPatientInfLocalId patientInfLocalId = (MPatientInfLocalId)ipatientInfLocalId; Hashtable ht = new Hashtable(); ht.Add("PATIENT_ID", patientInfLocalId.PATIENT_ID); ht.Add("LOCAL_ID_CLASS", patientInfLocalId.LOCAL_ID_CLASS); ht.Add("PATIENT_LOCAL_ID", patientInfLocalId.PATIENT_LOCAL_ID); ht.Add("EXAM_TIMES", patientInfLocalId.EXAM_TIMES); return(ExecuteSql(StringConstructor.InsertSql(TableName, ht).ToString())); }
/// <summary> /// 获取指定病人ID、本地ID类别的对照记录 /// </summary> /// <param name="PATIENT_ID"></param> /// <param name="LOCAL_ID_CLASS"></param> /// <returns></returns> public override IModel GetModel(string PATIENT_ID, string LOCAL_ID_CLASS) { strSql = "select * from " + TableName + " where PATIENT_ID = '" + PATIENT_ID + "' and LOCAL_ID_CLASS = '" + LOCAL_ID_CLASS + "'"; DataTable dt = GetDataTable(strSql); if (dt.Rows.Count == 0) { return(null); } MPatientInfLocalId mPatientInfLocalId = new MPatientInfLocalId(); mPatientInfLocalId.PATIENT_ID = dt.Rows[0]["PATIENT_ID"].ToString(); mPatientInfLocalId.PATIENT_LOCAL_ID = dt.Rows[0]["PATIENT_LOCAL_ID"].ToString(); mPatientInfLocalId.LOCAL_ID_CLASS = dt.Rows[0]["LOCAL_ID_CLASS"].ToString(); if (dt.Rows[0]["EXAM_TIMES"].ToString() == "") { mPatientInfLocalId.EXAM_TIMES = null; } else { mPatientInfLocalId.EXAM_TIMES = Convert.ToInt32(dt.Rows[0]["EXAM_TIMES"].ToString()); } return(mPatientInfLocalId); }