Exemple #1
0
 public BaseController(AirportCoreContext _db, IServiceProvider serviceProvider)
 {
     db                  = _db;
     UserManager         = serviceProvider.GetService <UserManager <ApplicationUser> >();
     httpContextAccessor = serviceProvider.GetService <HttpContextAccessor>();
     config              = serviceProvider.GetService <IOptions <MyConfiguration> >();
 }
 public ContentManagementsController(AirportCoreContext context, IHostingEnvironment hostingEnvironment)
 {
     ViewData["Title"]          = "General";
     ViewData["ControllerName"] = "ContentManagements";
     _context            = context;
     _hostingEnvironment = hostingEnvironment;
 }
 public BaseController(IServiceProvider serviceProvider)
 {
     db            = serviceProvider.GetService <AirportCoreContext>();
     UserManager   = serviceProvider.GetService <UserManager <ApplicationUser> >();
     SignInManager = serviceProvider.GetService <SignInManager <ApplicationUser> >();
     RoleManager   = serviceProvider.GetService <RoleManager <ApplicationRole> >();
     config        = serviceProvider.GetService <IOptions <MyConfiguration> >();
 }
 public LoginModel(ApplicationSignInManager signInManager,
                   UserManager <ApplicationUser> userManager,
                   ILogger <LoginModel> logger, AirportCoreContext db)
 {
     _signInManager = signInManager;
     _userManager   = userManager;
     _logger        = logger;
     _db            = db;
 }
 public DeletePersonalDataModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <DeletePersonalDataModel> logger,
     AirportCoreContext airportCoreContext)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _context       = airportCoreContext;
 }
Exemple #6
0
 public RegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     AirportCoreContext context)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _emailSender   = emailSender;
     _context       = context;
 }
Exemple #7
0
 public ExternalLoginModel(
     SignInManager <ApplicationUser> signInManager,
     UserManager <ApplicationUser> userManager,
     ILogger <ExternalLoginModel> logger,
     IEmailSender emailSender,
     AirportCoreContext context)
 {
     _signInManager = signInManager;
     _userManager   = userManager;
     _logger        = logger;
     _emailSender   = emailSender;
     _context       = context;
 }
Exemple #8
0
 public IndexModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     AirportCoreContext context,
     IFileProvider fileProvider,
     IHostingEnvironment env)
 {
     _userManager        = userManager;
     _signInManager      = signInManager;
     _emailSender        = emailSender;
     _context            = context;
     _fileProvider       = fileProvider;
     _hostingEnvironment = env;
 }
Exemple #9
0
 public SupplierRegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender,
     AirportCoreContext context,
     IServiceProvider serviceProvider,
     IFileProvider fileProvider,
     IHostingEnvironment env)
 {
     _userManager        = userManager;
     _signInManager      = signInManager;
     _logger             = logger;
     _emailSender        = emailSender;
     _context            = context;
     _serviceProvider    = serviceProvider;
     _fileProvider       = fileProvider;
     _hostingEnvironment = env;
 }
 public SupplierContactsController(AirportCoreContext context)
 {
     _context = context;
 }
Exemple #11
0
 public BaseController(AirportCoreContext airportCoreContext)
 {
     db = airportCoreContext;
 }
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            Dictionary <string, string> sessionActive = HttpContext.Session.GetComplexData <Dictionary <string, string> >("Active");
            string controllerName = ControllerContext.RouteData.Values["controller"].ToString();
            string actionName     = ControllerContext.RouteData.Values["action"].ToString();

            //if (sessionActive == null)
            //{
            sessionActive = new Dictionary <string, string>
            {
                { "ContentManagements", "" },
                { "ContentManagements.Index", "" },
                { "ContentManagements.Create", "" },

                { "FuelSuppliers", "" },
                { "FuelSuppliers.Index", "" },
                { "FuelSuppliers.Create", "" },

                { "Customers", "" },
                { "Customers.Index", "" },
                { "Customers.Create", "" },

                { "PaymentPackageFeatures", "" },
                { "PaymentPackageFeatures.Index", "" },
                { "PaymentPackageFeatures.Details", "" },

                { "ContactUs", "" },
                { "ContactUs.Index", "" },
                { "ContactUs.Details", "" },

                //
                { "AdvertisementCategories", "" },
                { "AdvertisementOwners", "" },
                { "Advertisements", "" },
                { "Advertisements.Index", "" },
                { "Advertisements.RequestedIndex", "" },
                { "Advertisements.ArchivedIndex", "" },
                { "Airports", "" },
                { "Cities", "" },
                { "ColorPalettes", "" },
                { "Companies", "" },
                { "Contacts", "" },
                { "Continents", "" },
                { "Countries", "" },
                { "Features", "" },
                { "Home", "" },
                { "Logs", "" },
                { "MainCategories", "" },
                { "News", "" },
                { "PaymentPackages", "" },
                { "Properties", "" },
                { "Services", "" },
                { "SubCategories", "" },
                { "Suppliers", "" },
                { "SupplierTypes", "" },
                { "UserSpecializations", "" }
            };
            //}

            SetActive(sessionActive, controllerName, actionName);
            HttpContext.Session.SetComplexData("Active", sessionActive);
            HttpContext.Session.SetString("ControllerName", controllerName);
            HttpContext.Session.SetString("ActionName", actionName);

            if (db == null)
            {
                db = context.HttpContext.RequestServices.GetService <AirportCoreContext>();
            }
            int      TodayCustomerCount = db.Customer.Where(o => !o.IsDeleted && o.Created == DateTime.Today)?.ToList()?.Count() ?? 0;
            DateTime d = DateTime.Today.AddDays(-6);
            int      WeekCustomerCount = db.Customer.Where(o => !o.IsDeleted && o.Created < DateTime.Today &&
                                                           o.Created >= d).Count();

            HttpContext.Session.SetInt32("TodayCustomer", TodayCustomerCount);
            HttpContext.Session.SetInt32("WeekCustomer", WeekCustomerCount);

            if ((TodayCustomerCount + WeekCustomerCount) > 0)
            {
                HttpContext.Session.SetInt32("NotificationCount", TodayCustomerCount + WeekCustomerCount);
            }

            HttpContext.Session.SetComplexData("ContactUs", db.ContactUs.Where(c => !c.IsDeleted && c.Created.Date == DateTime.Today)
                                               .OrderByDescending(c => c.Created).ToList());

            HttpContext.Session.SetInt32("UnReadContactUsCount", db.ContactUs.Select(c => !c.IsDeleted && !c.IsRead).ToList().Count);

            // HttpContext.Session.SetInt32("RequestedAdsCount", db.Advertisement.Where(x => !x.IsDeleted
            // && x.Status == "Requested").Count());
            // HttpContext.Session.SetInt32("PiblishedAdsCount", db.Advertisement.Where(x => !x.IsDeleted
            //&& (x.Status == "Piblished" || x.Status == "Pending")).Count());
            // HttpContext.Session.SetInt32("ArchivedAdsCount", db.Advertisement.Where(x => x.IsDeleted
            //|| x.Status == "Archived" || x.Status == "Rejected").Count());

            // if (controllerName == "Advertisements" || controllerName == "Home")
            // {
            //     foreach (var item in db.Advertisement.Where(x => !x.IsDeleted)
            //     .Where(x => x.Status == "Accepted"))
            //     {
            //         if (item.PublishDate <= DateTime.Now && item.EndDate <= DateTime.Now)
            //         {
            //             item.Status = "Archived";
            //         }
            //         else if (item.PublishDate <= DateTime.Now && item.EndDate >= DateTime.Now)
            //         {
            //             item.Status = "Piblished";
            //         }
            //         else if (item.PublishDate >= DateTime.Now && item.EndDate >= DateTime.Now)
            //         {
            //             item.Status = "Pending";
            //         }
            //         db.Entry(item).State = EntityState.Modified;
            //         db.SaveChanges();
            //     }
            // }
            base.OnActionExecuting(context);
        }
Exemple #13
0
 public CitiesController(AirportCoreContext context, IServiceProvider serviceProvider) : base(context, serviceProvider)
 {
 }
Exemple #14
0
 public OffersController(AirportCoreContext context, IHttpContextAccessor httpContextAccessor,
                         SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager) : base(context)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
 }
 public PaymentPackagesController(AirportCoreContext context, IServiceProvider provider, IOptions <StripeSettings> options) : base(context, provider)
 {
     this.StripeOptions = options;
 }
Exemple #16
0
 public HomeController(AirportCoreContext db,
                       IEmailSender emailSender,
                       IServiceProvider provider) : base(db, provider)
 {
     _emailSender = emailSender;
 }
Exemple #17
0
 public RequestsController(AirportCoreContext context, IServiceProvider provider) : base(context, provider)
 {
 }
Exemple #18
0
 public FuelSuppliersController(AirportCoreContext context, IServiceProvider serviceProvider) : base(context, serviceProvider)
 {
 }
Exemple #19
0
 public HomeController(AirportCoreContext airportCoreContext, IServiceProvider provider) : base(airportCoreContext, provider)
 {
 }
 public CustomersController(AirportCoreContext context, IServiceProvider provider) : base(context, provider)
 {
 }
Exemple #21
0
 public StatisticsHelper(AirportCoreContext context)
 {
     _context = context;
 }
 public SuppliersController(AirportCoreContext _db, IServiceProvider provider) : base(_db)
 {
 }
Exemple #23
0
 public AirportsController(AirportCoreContext _db) : base(_db)
 {
 }
 public PaymentPackageFeaturesController(AirportCoreContext context)
 {
     _context = context;
 }
 public ForgotPasswordModel(UserManager <ApplicationUser> userManager, IEmailSender emailSender, AirportCoreContext context)
 {
     _userManager = userManager;
     _emailSender = emailSender;
     _context     = context;
 }