Esempio n. 1
0
        } //-----------------------------

        //this function gets a new registration system id
        public static String GetNewSysIDPatientRegistration(CommonExchange.SysAccess userInfo)
        {
            Int32  rowCount = 0;
            String regId    = "";

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

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

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

            do
            {
                regId = "SYSREG" + ProcStatic.EightDigitZero(++rowCount);
            } while (IsExistsSysIDPatientRegistration(userInfo.UserId, userInfo.Connection, regId));

            return(regId);
        }