Esempio n. 1
0
        //this function gets a new patient system id
        public static String GetNewSysIDPatientInformation(CommonExchange.SysAccess userInfo)
        {
            Int32  rowCount  = 0;
            String patientId = "";

            using (SqlCommand sqlComm = new SqlCommand())
            {
                sqlComm.Connection  = userInfo.Connection;
                sqlComm.CommandType = CommandType.StoredProcedure;
                sqlComm.CommandText = "dental.GetCountPatientInformation";

                sqlComm.Parameters.Add("@system_user_id", SqlDbType.VarChar).Value = userInfo.UserId;

                rowCount = (Int32)sqlComm.ExecuteScalar();
            }

            do
            {
                patientId = "SYSPNT" + ProcStatic.NineDigitZero(++rowCount);
            } while (IsExistsSysIDPatientInformation(userInfo.UserId, userInfo.Connection, patientId));

            return(patientId);
        }