/// <summary> /// 创建门诊号 /// </summary> /// <returns></returns> public string CreateVisitNo() { Model.MZ_SERIAL_NO mz_serial_no = null; mz_serial_no = BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).GetModel(""); if (mz_serial_no == null) { mz_serial_no = new HIS.Model.MZ_SERIAL_NO( ); mz_serial_no.VISIT_NO = 1; BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).Add(mz_serial_no); } mz_serial_no.VISIT_NO = mz_serial_no.VISIT_NO + 1; BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).Update("", BLL.Tables.mz_serial_no.VISIT_NO + oleDb.EuqalTo() + mz_serial_no.VISIT_NO); string lastNum = ""; if (mz_serial_no.VISIT_NO.ToString().Length > 4) { string no = mz_serial_no.VISIT_NO.ToString(); lastNum = no.Substring(no.Length - 4, 4); } else { lastNum = mz_serial_no.VISIT_NO.ToString("0000"); } string tmp = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime.ToString("yyyyMMdd") + lastNum; return(tmp); }
/// <summary> /// 获得当前门诊号 /// </summary> private void GetCurrentVisitNo() { //计算病人门诊号 Model.MZ_SERIAL_NO mz_serial_no = BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).GetModel(""); if (mz_serial_no == null) { mz_serial_no = new HIS.Model.MZ_SERIAL_NO(); mz_serial_no.VISIT_NO = 1; BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).Add(mz_serial_no); } mz_serial_no.VISIT_NO = mz_serial_no.VISIT_NO + 1; BindEntity <Model.MZ_SERIAL_NO> .CreateInstanceDAL(oleDb).Update(mz_serial_no); string visit_no_s = mz_serial_no.VISIT_NO.ToString("0000"); string visit_no = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime.ToString("yyyyMMdd") + visit_no_s.Substring(visit_no_s.Length - 4); _patList.VisitNo = visit_no; }