Example #1
0
        public int GetTransactionNumber(InsurerDbContext _context)
        {
            string query = "SELECT * FROM ClaimTransactionGenerator " +
                           "WHERE TransactionNumber IN (SELECT MAX(TransactionNumber) " +
                           "FROM ClaimTransactionGenerator)";

            var result = _context.ClaimTransactionGenerators
                         .FromSql(query)
                         .AsNoTracking()
                         .ToList();

            return((result.Count == 0) ? 1 : _context.ClaimTransactionGenerators.Max(b => b.TransactionNumber) + 1);
        }
Example #2
0
        //  This method gets called by the runtime.
        //  Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ILoggerFactory loggerFactory, InsurerDbContext context,
                              UserManager <ApplicationUser> _userManager, RoleManager <IdentityRole> _roleManager)
        {
            if (env.IsDevelopment())
            {
                // When the app runs in the Development environment:
                //   Use the Developer Exception Page to report app runtime errors.
                //   Use the Database Error Page to report database runtime errors.
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();

                app.UseBrowserLink();
            }
            else
            {
                // When the app doesn't run in the Development environment:
                //   Enable the Exception Handler Middleware to catch exceptions
                //     thrown in the following middlewares.
                app.UseExceptionHandler("/Home/Error");
            }

            // Return static files and end the pipeline.
            // Static files not compressed by Static File Middleware.
            app.UseStaticFiles();

            // Use Cookie Policy Middleware to conform to EU General Data
            // Protection Regulation (GDPR) regulations.
            app.UseCookiePolicy();

            //  Response Compression Middleware
            app.UseResponseCompression();

            // Authenticate before the user accesses secure resources.
            app.UseAuthentication();

            IdentityDataInitializer.SeedData(_userManager, _roleManager);

            // If the app uses session state, call Session Middleware after Cookie
            // Policy Middleware and before MVC Middleware.
            app.UseSession();

            // Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715
            // Add MVC to the request pipeline.
            app.UseMvcWithDefaultRoute();

            //  Initialise the database with sample data
            //DbInitializer.Initialize(context);    -- Commented by Levi Nkata - 02/05/2019
        }
Example #3
0
        public int GetBulkHandle(InsurerDbContext _context)
        {
            var    todaydate = DateTime.Now.ToString("yyyyMMdd");
            string dy        = todaydate.Substring(6, 2);
            string mn        = todaydate.Substring(4, 2);
            string yr        = todaydate.Substring(0, 4);

            string seed    = yr + mn + dy;
            var    myParam = seed + '%';

            string query = "SELECT * FROM BulkHandleGenerator " +
                           "WHERE CAST(BulkNumber AS varchar(9)) LIKE {0}";

            var result = _context.BulkHandleGenerators
                         .FromSql(query, myParam)
                         .AsNoTracking()
                         .ToList();

            string bulkhandle = (result.Count == 0) ? seed + '1' : (_context.BulkHandleGenerators.Max(b => b.BulkNumber) + 1).ToString();

            return(int.Parse(bulkhandle));
        }
Example #4
0
 public RisksController(InsurerDbContext context)
 {
     _context = context;
 }
 public TransactionTypesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #6
0
 public WallTypesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #7
0
 public PropertiesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #8
0
 public LoansController(InsurerDbContext context)
 {
     _context = context;
 }
Example #9
0
 public ThirdPartiesController(InsurerDbContext context)
 {
     _context = context;
 }
 public ClaimTransactionsController(InsurerDbContext context)
 {
     _context = context;
 }
Example #11
0
 public ContainersController(InsurerDbContext context)
 {
     _context = context;
 }
Example #12
0
 public MotorsViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
Example #13
0
 public PayablesController(InsurerDbContext context, IHostingEnvironment env)
 {
     _context   = context;
     hostingEnv = env;
 }
Example #14
0
 public InvoicesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #15
0
 public AllRisksViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
 public PolicyRiskTotalsViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
 public CommercialsViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
Example #18
0
 public ClaimStatusController(InsurerDbContext context)
 {
     _context = context;
 }
Example #19
0
 public PremiumsController(InsurerDbContext context)
 {
     _context = context;
 }
Example #20
0
 public PolicyStatusController(InsurerDbContext context)
 {
     _context = context;
 }
Example #21
0
 public MotorModelsController(InsurerDbContext context)
 {
     _context = context;
 }
Example #22
0
 public CommercialsController(InsurerDbContext context)
 {
     _context = context;
 }
Example #23
0
 public CoveragesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #24
0
 public BankBranchesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #25
0
 public PremiumsViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
Example #26
0
 public ClaimTransactionsViewComponent(InsurerDbContext context)
 {
     _context = context;
 }
Example #27
0
 public ClientTypesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #28
0
 public DriverTypesController(InsurerDbContext context)
 {
     _context = context;
 }
Example #29
0
 public RegionsController(InsurerDbContext context)
 {
     _context = context;
 }
Example #30
0
 public InvoiceNumbers(InsurerDbContext context)
 {
     _context = context;
 }