public ExpensesStatisticsService(int userId, DateTime dateFrom, DateTime dateTo) { context = new HomeBudgetContext(); this.userId = userId; this.dateFrom = dateFrom; this.dateTo = dateTo; }
public Authentication(string userName, string password, string email) { _context = new HomeBudgetContext(); _userName = userName; _password = password; _email = email; }
public static bool AreCredentialsCorrect(string login, string password) { HomeBudgetContext context = new HomeBudgetContext(); if (context.Users.Any(x => x.Login.Equals(login, StringComparison.OrdinalIgnoreCase) && x.Password.Equals(password, StringComparison.Ordinal))) { return(true); } return(false); }
public static bool Exist(string login) { HomeBudgetContext context = new HomeBudgetContext(); if (context.Users.Any(x => x.Login.Equals(login, StringComparison.OrdinalIgnoreCase))) { return(true); } return(false); }
public DbDataReadPermission(int userId, int?catId = null, int?unitId = null) { HomeBudgetContext context = new HomeBudgetContext(); if (catId.HasValue && !context.Categories.Any(x => x.Id == catId.Value && (x.UserId == null || x.UserId == userId))) { HasPermission = false; ObjectNamesWithoutPermission.Add(nameof(Categories)); } if (unitId.HasValue && !context.Units.Any(x => x.Id == unitId.Value)) { HasPermission = false; ObjectNamesWithoutPermission.Add(nameof(Units)); } }
public ExpensesService(int userId) { context = new HomeBudgetContext(); this.userId = userId; }
// 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, HomeBudgetContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); HomeBudgetInitializer.Initialize(context); }
public UserInfo(string login) { User = new HomeBudgetContext().Users.First(x => x.Login == login); }
public UnitsService() { context = new HomeBudgetContext(); }
public CategoryController(HomeBudgetContext hbContext) { _context = hbContext; }
public CategoriesService(int userId) { context = new HomeBudgetContext(); this.userId = userId; }
public RealizationController(HomeBudgetContext hbContext) { _context = hbContext; }
public PlanController(HomeBudgetContext hbContext) { _context = hbContext; }
public Searcher(string text, int maxResultCount) { this.text = text; this.maxResultCount = maxResultCount; context = new HomeBudgetContext(); }
public CentralTendencyExpense(string name, int userId) { context = new HomeBudgetContext(); this.name = name; this.userId = userId; }
public AddingExpenseService() { context = new HomeBudgetContext(); }
public ExpenseService(int expenseId, int userId) { this.userId = userId; context = new HomeBudgetContext(); Expense = context.Expenses.Include(x => x.Category).Include(x => x.Unit).FirstOrDefault(x => x.Id == expenseId && x.UserId == userId); }