public string GetNextNumber(AccountData account, int entity_desc)
        {
            Log.Info("Accessing AccountRepo GetNextNumber function");
            var pcol = new List <SqlParameter>()
            {
                Mapper.BuildParam("@entity_key", account.AccountKey)
            };

            using (entity_context)
            {
                switch (entity_desc)
                {
                case 2:
                    return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_order_num", pcol));

                case 1:
                    return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_invoice_num", pcol));

                case 6:
                    return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_contact_num", pcol));

                default:
                    return("");
                }
                //if (entity_desc == 2)
                //    return entity_context.ExecuteSqlStatementAsScalar<string>("usp_get_next_order_num", pcol);
                //else
                //    return entity_context.ExecuteSqlStatementAsScalar<string>("usp_get_next_invoice_num", pcol);
            }
        }
        public string GetNextNumber(CompanyData company, int number_type)
        {
            Log.Info("Accessing AccountRepo GetNextNumber function");
            var pcol = new List <SqlParameter>()
            {
                Mapper.BuildParam("@entity_key", company.CompanyKey)
            };

            switch (number_type)
            {
            case 3:
                return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_emp_num", pcol));

            case 4:
                return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_acct_num", pcol));

            case 5:
                return(entity_context.ExecuteSqlStatementAsScalar <string>("usp_get_next_vend_num", pcol));

            default:
                return("");
            }
        }