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); }
// 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 }
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)); }
public RisksController(InsurerDbContext context) { _context = context; }
public TransactionTypesController(InsurerDbContext context) { _context = context; }
public WallTypesController(InsurerDbContext context) { _context = context; }
public PropertiesController(InsurerDbContext context) { _context = context; }
public LoansController(InsurerDbContext context) { _context = context; }
public ThirdPartiesController(InsurerDbContext context) { _context = context; }
public ClaimTransactionsController(InsurerDbContext context) { _context = context; }
public ContainersController(InsurerDbContext context) { _context = context; }
public MotorsViewComponent(InsurerDbContext context) { _context = context; }
public PayablesController(InsurerDbContext context, IHostingEnvironment env) { _context = context; hostingEnv = env; }
public InvoicesController(InsurerDbContext context) { _context = context; }
public AllRisksViewComponent(InsurerDbContext context) { _context = context; }
public PolicyRiskTotalsViewComponent(InsurerDbContext context) { _context = context; }
public CommercialsViewComponent(InsurerDbContext context) { _context = context; }
public ClaimStatusController(InsurerDbContext context) { _context = context; }
public PremiumsController(InsurerDbContext context) { _context = context; }
public PolicyStatusController(InsurerDbContext context) { _context = context; }
public MotorModelsController(InsurerDbContext context) { _context = context; }
public CommercialsController(InsurerDbContext context) { _context = context; }
public CoveragesController(InsurerDbContext context) { _context = context; }
public BankBranchesController(InsurerDbContext context) { _context = context; }
public PremiumsViewComponent(InsurerDbContext context) { _context = context; }
public ClaimTransactionsViewComponent(InsurerDbContext context) { _context = context; }
public ClientTypesController(InsurerDbContext context) { _context = context; }
public DriverTypesController(InsurerDbContext context) { _context = context; }
public RegionsController(InsurerDbContext context) { _context = context; }
public InvoiceNumbers(InsurerDbContext context) { _context = context; }