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

        //this function gets a new receipt no
        public static String GetNewReceiptNoPaymentDetails(CommonExchange.SysAccess userInfo)
        {
            Int32  rowCount  = 0;
            String receiptNo = "";

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

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

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

            do
            {
                receiptNo = "RN" + ProcStatic.TenDigitZero(++rowCount);
            } while (IsExistsReceiptNoPaymentDetails(userInfo.UserId, userInfo.Connection, receiptNo));

            return(receiptNo);
        }