Exemplo n.º 1
0
        public IEnumerable <TransactionType> GetAllTransactionTypes()
        {
            string script = ScriptsUtils.GetSqlScript("TransactionTypes\\GetAllTransactionTypes.sql");
            IEnumerable <TransactionType> transactionTypes = _context.TransactionTypes.FromSqlRaw(script);

            return(transactionTypes);
        }
Exemplo n.º 2
0
        public IEnumerable <TransactionView> GetTransactionsTable()
        {
            string script = ScriptsUtils.GetSqlScript("Transactions\\GetTransactionsTable.sql");
            IEnumerable <TransactionView> transactions = _context.TransactionView.FromSqlRaw(script);

            return(transactions);
        }
Exemplo n.º 3
0
        public IEnumerable <Organisation> GetAllOrganisations()
        {
            string script = ScriptsUtils.GetSqlScript("Organisations\\GetAllOrganisations.sql");
            IEnumerable <Organisation> organisations = _context.Organisations.FromSqlRaw(script);

            return(organisations);
        }
Exemplo n.º 4
0
        public IEnumerable <Price> GetAllPrices()
        {
            string script = ScriptsUtils.GetSqlScript("Prices\\GetAllPrices.sql");
            IEnumerable <Price> prices = _context.Prices.FromSqlRaw(script);

            return(prices);
        }
Exemplo n.º 5
0
        public IEnumerable <Locality> GetAllLocalities()
        {
            string script = ScriptsUtils.GetSqlScript("Localities\\GetAllLocalities.sql");
            IEnumerable <Locality> localitys = _context.Localities.FromSqlRaw(script);

            return(localitys);
        }
Exemplo n.º 6
0
        public IEnumerable <PriceView> GetPricesTable()
        {
            string script = ScriptsUtils.GetSqlScript("Prices\\GetPricesTable.sql");
            IEnumerable <PriceView> prices = _context.PriceView.FromSqlRaw(script);

            return(prices);
        }
Exemplo n.º 7
0
        public IEnumerable <Account> GetAllAccounts()
        {
            string script = ScriptsUtils.GetSqlScript("Accounts\\GetAllAccounts.sql");
            IEnumerable <Account> accounts = _context.Accounts.FromSqlRaw(script);

            return(accounts);
        }
        public int Seed()
        {
            string script = ScriptsUtils.GetSqlScript("Seed.sql");
            int    numberOfAffectedRows = _context.Database.ExecuteSqlRaw(script);

            return(numberOfAffectedRows);
        }
Exemplo n.º 9
0
        public IEnumerable <Call> GetAllCalls()
        {
            string             script = ScriptsUtils.GetSqlScript("Calls\\GetAllCalls.sql");
            IEnumerable <Call> calls  = _context.Calls.FromSqlRaw(script);

            return(calls);
        }
Exemplo n.º 10
0
        public IEnumerable <AccountView> GetAccountsTable()
        {
            string script = ScriptsUtils.GetSqlScript("Accounts\\GetAccountsTable.sql");
            IEnumerable <AccountView> accounts = _context.AccountView.FromSqlRaw(script);

            return(accounts);
        }
Exemplo n.º 11
0
        public IEnumerable <SubscriberView> GetSubscribersTable()
        {
            string script = ScriptsUtils.GetSqlScript("Subscribers\\GetSubscribersTable.sql");
            IEnumerable <SubscriberView> subscribers = _context.SubscriberView.FromSqlRaw(script);

            return(subscribers);
        }
Exemplo n.º 12
0
        public IEnumerable <Subscriber> GetAllSubscribers()
        {
            string script = ScriptsUtils.GetSqlScript("Subscribers\\GetAllSubscribers.sql");
            IEnumerable <Subscriber> subscribers = _context.Subsrcibers.FromSqlRaw(script);

            return(subscribers);
        }
        public IEnumerable <Daytime> GetAllDaytimes()
        {
            string script = ScriptsUtils.GetSqlScript("Daytimes\\GetAllDaytimes.sql");
            IEnumerable <Daytime> daytimes = _context.Daytimes.FromSqlRaw(script);

            return(daytimes);
        }
        public IEnumerable <DaytimePriceView> GetDaytimePricesTable()
        {
            string script = ScriptsUtils.GetSqlScript("DaytimePrices\\GetDaytimePricesTable.sql");
            IEnumerable <DaytimePriceView> daytimePrices = _context.DaytimePriceView.FromSqlRaw(script);

            return(daytimePrices);
        }
Exemplo n.º 15
0
        public IEnumerable <Call> GetCallsBySubscriberId(int subscriber_id)
        {
            string             script       = ScriptsUtils.GetSqlScript("Calls\\GetCallsBySubscriberId.sql");
            var                subscriberId = new SqlParameter("@subscriberId", subscriber_id);
            IEnumerable <Call> calls        = _context.Calls.FromSqlRaw(
                script,
                subscriberId
                );

            return(calls);
        }
        public IEnumerable <DaytimePrice> GetDaytimePricesByPriceId(int price_id)
        {
            string script  = ScriptsUtils.GetSqlScript("DaytimePrices\\GetDaytimePricesByPriceId.sql");
            var    priceId = new SqlParameter("@priceId", price_id);
            IEnumerable <DaytimePrice> daytimePrices = _context.DaytimePrices.FromSqlRaw(
                script,
                priceId
                );

            return(daytimePrices);
        }
Exemplo n.º 17
0
        public async Task <Organisation> GetOrganisationById(int id)
        {
            string script         = ScriptsUtils.GetSqlScript("Organisations\\GetOrganisationById.sql");
            var    organisationId = new SqlParameter("@organisationId", id);

            Organisation organisation = await _context.Organisations.FromSqlRaw(
                script,
                organisationId
                ).FirstAsync();

            return(organisation);
        }
Exemplo n.º 18
0
        public int DeleteSubscriber(int id)
        {
            string script       = ScriptsUtils.GetSqlScript("Subscribers\\DeleteSubscriber.sql");
            var    subscriberId = new SqlParameter("@subscriberId", id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                subscriberId
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 19
0
        public int CreateTransactionType(TransactionType transactionType)
        {
            string script = ScriptsUtils.GetSqlScript("TransactionTypes\\CreateTransactionType.sql");
            var    title  = new SqlParameter("@title", transactionType.title);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                title
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 20
0
        public async Task <Call> GetCallById(int id)
        {
            string script = ScriptsUtils.GetSqlScript("Calls\\GetCallById.sql");
            var    callId = new SqlParameter("@callId", id);

            Call call = await _context.Calls.FromSqlRaw(
                script,
                callId
                ).FirstAsync();

            return(call);
        }
Exemplo n.º 21
0
        public int RestoreCall(int call_id)
        {
            string script = ScriptsUtils.GetSqlScript("Calls\\RestoreCall.sql");
            var    callId = new SqlParameter("@callId", call_id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                callId
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 22
0
        public int CreateOrganisation(Organisation organisation)
        {
            string script = ScriptsUtils.GetSqlScript("Organisations\\CreateOrganisation.sql");
            var    name   = new SqlParameter("@name", organisation.name);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                name
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 23
0
        public async Task <Locality> GetLocalityById(int id)
        {
            string script     = ScriptsUtils.GetSqlScript("Localities\\GetLocalityById.sql");
            var    localityId = new SqlParameter("@localityId", id);

            Locality locality = await _context.Localities.FromSqlRaw(
                script,
                localityId
                ).FirstAsync();

            return(locality);
        }
Exemplo n.º 24
0
        public int DeleteLocality(int id)
        {
            string script     = ScriptsUtils.GetSqlScript("Localities\\DeleteLocality.sql");
            var    localityId = new SqlParameter("@localityId", id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                localityId
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 25
0
        public int CreateLocality(Locality locality)
        {
            string script = ScriptsUtils.GetSqlScript("Localities\\CreateLocality.sql");
            var    name   = new SqlParameter("@name", locality.name);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                name
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 26
0
        public async Task <Price> GetPriceById(int id)
        {
            string script  = ScriptsUtils.GetSqlScript("Prices\\GetPriceById.sql");
            var    priceId = new SqlParameter("@priceId", id);

            Price price = await _context.Prices.FromSqlRaw(
                script,
                priceId
                ).FirstAsync();

            return(price);
        }
Exemplo n.º 27
0
        public int DeleteOrganisation(int id)
        {
            string script         = ScriptsUtils.GetSqlScript("Organisations\\DeleteOrganisation.sql");
            var    organisationId = new SqlParameter("@organisationId", id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                organisationId
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 28
0
        public async Task <TransactionType> GetTransactionTypeById(int id)
        {
            string script            = ScriptsUtils.GetSqlScript("TransactionTypes\\GetTransactionTypeById.sql");
            var    transactionTypeId = new SqlParameter("@transactionTypeId", id);

            TransactionType transactionType = await _context.TransactionTypes.FromSqlRaw(
                script,
                transactionTypeId
                ).FirstAsync();

            return(transactionType);
        }
Exemplo n.º 29
0
        public int DeleteTransactionType(int id)
        {
            string script            = ScriptsUtils.GetSqlScript("TransactionTypes\\DeleteTransactionType.sql");
            var    transactionTypeId = new SqlParameter("@transactionTypeId", id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                transactionTypeId
                );

            return(numberOfAffectedRows);
        }
Exemplo n.º 30
0
        public int DeletePrice(int id)
        {
            string script  = ScriptsUtils.GetSqlScript("Prices\\DeletePrice.sql");
            var    priceId = new SqlParameter("@priceId", id);

            int numberOfAffectedRows = _context.Database.ExecuteSqlRaw(
                script,
                priceId
                );

            return(numberOfAffectedRows);
        }