public ComputerController(ComputerShopContext context, IApiClient apiClient,
                           IWebHostEnvironment webHostEnvironment)
 {
     _context            = context;
     _apiClient          = apiClient;
     _webHostEnvironment = webHostEnvironment;
 }
        public HomeController(ILogger <HomeController> logger, ComputerShopContext dbContext)
        {
            _logger  = logger;
            _context = dbContext;
            //_context.Descriptions.Add(new Domain.Entities.Description()
            //{
            //	Name = "TestDescription",
            //	Value = "test",
            //	KitID = Guid.Empty

            //});
            //_context.Kits.Add(new Domain.Entities.Kit()
            //{
            //	ImageLink = " ",
            //	Price = 3m,
            //	Descriptions = new List<Domain.Entities.Description>()
            //	{
            //		new Domain.Entities.Description()
            //	{
            //		Name = "TestDescription",
            //		Value = "test",
            //		KitID = Guid.Empty

            //	}
            //	}
            //});
            //_context.SaveChanges();
        }
 private void ExecuteLoadMainWindow()
 {
     try
     {
         using (ComputerShopContext computerShopContext = new ComputerShopContext())
         {
             CustomerRepository = new CustomerRepository(computerShopContext);
             Customer customer = CustomerRepository.FindByPredicate(cust => cust.Login == Login).FirstOrDefault();
             if (customer != null)
             {
                 if (Password != null && CustomerRepository.HashEquals(Password, customer.Password))
                 {
                     MainWindow mainWindow = new MainWindow(customer);
                     mainWindow.Show();
                     View.Close();
                 }
                 else
                 {
                     MessageBox.Show("Введен неверный пароль");
                 }
             }
             else
             {
                 MessageBox.Show("Неверно введен логин");
             }
         }
     }
     catch (Exception e)
     {
         MessageBox.Show($"{e}\t{e.Message}");
     }
 }
 public OrderController(ComputerShopContext context, UserManager <User> userManager,
                        SignInManager <User> signInManager, IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _httpContextAccessor = httpContextAccessor;
 }
Example #5
0
 public AssemblyService(ComputerShopContext context)
 {
     categoryRepo            = new CategoryRepository(context);
     productRepo             = new ProductRepository(context);
     assemblyRepo            = new AssemblyRepository(context);
     featureRepo             = new FeatureRepository(context);
     featuresForCategoryRepo = new FeaturesForCategoryRepository(context);
     featureValueRepo        = new FeatureValueRepository(context);
     userRepo = new UserRepository(context);
 }
Example #6
0
 public ShopService(ComputerShopContext context)
 {
     productRepo    = new ProductRepository(context);
     categoryRepo   = new CategoryRepository(context);
     basketRepo     = new BasketRepository(context);
     userRepo       = new UserRepository(context);
     basketItemRepo = new BasketItemRepository(context);
     orderRepo      = new OrderRepository(context);
     addressRepo    = new AddressRepository(context);
 }
Example #7
0
 public AdminService(ComputerShopContext context)
 {
     groupRepo              = new GroupRepository(context);
     categoryRepo           = new CategoryRepository(context);
     producentRepo          = new ProducentRepository(context);
     featureRepo            = new FeatureRepository(context);
     featureValueRepo       = new FeatureValueRepository(context);
     featureForCategoryRepo = new FeaturesForCategoryRepository(context);
     productRepo            = new ProductRepository(context);
     featureValueRepo       = new FeatureValueRepository(context);
     userRepo = new UserRepository(context);
     featureValueForProductRepo = new FeatureValueForProductRepository(context);
 }
Example #8
0
        public PartialViewResult Edit(ApplicationUser ApplicationUser)
        {
            if (ModelState.IsValid)
            {
                ComputerShopContext  db  = new ComputerShopContext();
                ApplicationDbContext App = new ApplicationDbContext();
                var user = App.Users.Find(ApplicationUser.Id);
                user.Name      = ApplicationUser.Name;
                user.Surname   = ApplicationUser.Surname;
                user.Address   = ApplicationUser.Address;
                user.Email     = ApplicationUser.Email;
                user.Telephone = ApplicationUser.Telephone;

                App.Entry(user).State = EntityState.Modified;
                App.SaveChanges();
                return(PartialView("~/Views/Manage/Index.cshtml", user));
            }
            return(PartialView());
        }
 public CategoriesController(ComputerShopContext context)
 {
     _context = context;
 }
 public RecommendationController(ComputerShopContext context)
 {
     _context = context;
 }
Example #11
0
 public ProducentRepository(ComputerShopContext context)
 {
     this.context = context;
 }
Example #12
0
 public AbstractRepository()
 {
     ComputerShopContext = new ComputerShopContext();
 }
Example #13
0
 public AbstractRepository(ComputerShopContext computerShopContext)
 {
     ComputerShopContext = computerShopContext;
 }
 public OrderItemsController(ComputerShopContext context)
 {
     _context = context;
 }
Example #15
0
 public DeliveredToWareHouseRepository(ComputerShopContext context) : base(context)
 {
 }
Example #16
0
 public CategoryRepository(ComputerShopContext context)
 {
     this.context = context;
 }
Example #17
0
 public AddressRepository(ComputerShopContext context)
 {
     this.context = context;
 }
Example #18
0
 public SupplyRepository(ComputerShopContext context) : base(context)
 {
 }
Example #19
0
 public ProductsController(ShopService shopService, AdminService adminService, ComputerShopContext context)
 {
     this.shopService  = new ShopService(context);
     this.adminService = new AdminService(context);
 }
        protected ComputerShopController()
        {
            ComputerShopContext = new ComputerShopContext();

            ContextProvider = new EFContextProvider<ComputerShopContext>();
        }
Example #21
0
 public GroupRepository(ComputerShopContext context)
 {
     this.context = context;
 }
 public FeatureValueRepository(ComputerShopContext context)
 {
     this.context = context;
 }
Example #23
0
 public ProductRepository(ComputerShopContext context) : base(context)
 {
 }
 public CustomerKitsController(ComputerShopContext context)
 {
     _context = context;
 }
 public NavbarDropdownViewComponent(ComputerShopContext context)
 {
     _context = context;
 }
Example #26
0
 public BasketRepository(ComputerShopContext context)
 {
     this.context = context;
 }
 public OrderedRepository(ComputerShopContext context) : base(context)
 {
 }
 public CustomerRepository(ComputerShopContext context) : base(context)
 {
 }
Example #29
0
 public InvoicesController(ComputerShopContext context)
 {
     _context = context;
 }
Example #30
0
 public KitsController(ComputerShopContext context)
 {
     _context = context;
 }
Example #31
0
 public OrderRepository(ComputerShopContext context)
 {
     this.context = context;
 }