Exemplo n.º 1
0
 public OfferedServiceLogic()
 {
     _offeredServiceContext = ContextFactory.CreateOfferedServiceContext();
     _usedServiceLogic      = new UsedServiceLogic();
     _categoryLogic         = new CategoryLogic();
     _reviewLogic           = new ReviewLogic();
 }
Exemplo n.º 2
0
 public ShopController(IProductContext productContext, IReviewContext reviewContext, IOrderContext orderContext, IBillingContext billingContext)
 {
     productLogic = new ProductLogic(productContext);
     reviewLogic  = new ReviewLogic(reviewContext);
     orderLogic   = new OrderLogic(orderContext);
     billingLogic = new BillingLogic(billingContext);
 }
Exemplo n.º 3
0
 public AdminController()
 {
     _userLogic           = LogicFactory.CreateUserLogic();
     _offeredServiceLogic = LogicFactory.CreateOfferedServiceLogic();
     _usedServiceLogic    = LogicFactory.CreateUsedServiceLogic();
     _imageLogic          = LogicFactory.CreateImageLogic();
     _reviewLogic         = LogicFactory.CreateReviewLogic();
 }
Exemplo n.º 4
0
 public MarketController()
 {
     _offeredServiceLogic = LogicFactory.CreateOfferedServiceLogic();
     _userLogic           = LogicFactory.CreateUserLogic();
     _categoryLogic       = LogicFactory.CreateCategoryLogic();
     _imageLogic          = LogicFactory.CreateImageLogic();
     _reviewLogic         = LogicFactory.CreateReviewLogic();
 }
Exemplo n.º 5
0
        public static void Main()
        {
            NinjectCommon.NinjectCommon.Registration();

            _userLogic = NinjectCommon.NinjectCommon.Kernel.Get<IUserLogic>();
            _reviewLogic = NinjectCommon.NinjectCommon.Kernel.Get<IReviewLogic>();

            var userIllario = new User {Id = 3, Name = "Illario", Password = "******", Role = 3};
            _userLogic.AddUser(userIllario);
            _reviewLogic.AddReview(userIllario.Id, new Review {Id = 2, Name = "Google Play", Comment = "OK"});

            Console.WriteLine("Users: ");
            foreach (var item in _userLogic.GetUsers())
            {
                Console.WriteLine($"{item.Id} : {item.Name} : {item.Role} ");
            }

            Console.WriteLine();

            Console.WriteLine("Reviews: ");
            foreach (var item in _reviewLogic.GetReviews())
            {
                Console.WriteLine($"{item.Id} : {item.Name} : {item.Comment}");
            }

            Console.WriteLine();

            foreach (var item in _reviewLogic.GetReviewsForUser(1))
            {
                Console.WriteLine($"{item.Name} : {item.Comment}");
            }

            _reviewLogic.AddReview(userIllario.Id, new Review {Id = 1, Name = "App store", Comment = "Not OK"});

            Console.WriteLine("Reviews: ");
            foreach (var item in _reviewLogic.GetReviews())
            {
                Console.WriteLine($"{item.Id} : {item.Name} : {item.Comment}");
            }

            _userLogic.UpdateUserForAdmin(1, 2);
            _userLogic.UpdateUserForUsers(1, "Petro");

            _reviewLogic.UpdateReview(1, "App store", "Now it's OK");

            _userLogic.DeleteUser(4);
            _reviewLogic.DeleteReview(3);

            var user = _userLogic.GetUserById(1);

            Console.WriteLine(user.Name);

            var review = _reviewLogic.GetReviewById(1);

            Console.WriteLine(review.Name);

            Console.ReadKey();
        }
Exemplo n.º 6
0
 public ReviewsController(IReviewLogic reviewLogic)
 {
     _reviewLogic = reviewLogic;
 }
Exemplo n.º 7
0
 public ReviewController(ILoggerManager logger, IReviewLogic reviewLogic)
 {
     _logger      = logger;
     _reviewLogic = reviewLogic;
 }
Exemplo n.º 8
0
 public ProductController(IProductContext productContext, IReviewContext reviewContext)
 {
     productLogic = new ProductLogic(productContext);
     reviewLogic  = new ReviewLogic(reviewContext);
 }
Exemplo n.º 9
0
 public ReviewController(IReviewLogic reviewLogic)
 {
     this.reviewLogic = reviewLogic;
 }
Exemplo n.º 10
0
 public MockReviewController()
 {
     _reviewLogic = new MockReviewLogic();
     _controller  = new ReviewsController(_reviewLogic);
 }
Exemplo n.º 11
0
        public MainViewModel(IKnifeStoreLogic knifeStoreLogic, IKnifeLogic knifeLogic, IReviewLogic reviewLogic, IHostSettings hostSettings)
        {
            this.knifeStoreLogic = knifeStoreLogic;
            this.knifeLogic      = knifeLogic;
            this.reviewLogic     = reviewLogic;
            this.hostSettings    = hostSettings;

            if (!this.IsInDesignMode)
            {
            }
            else
            {
                this.KnifeStores = new ObservableCollection <KnifeStore>();
                KnifeStore ks1 = new KnifeStore()
                {
                    Address = "Random Strt 8.", Name = "BladeHQ", Website = "www.bladehq.com"
                };
                KnifeStore ks2 = new KnifeStore()
                {
                    Address = "Random Strt 69.", Name = "KnifeCenter", Website = "www.knifecenter.com"
                };
                KnifeStore ks3 = new KnifeStore()
                {
                    Address = "Random Strt 12.", Name = "Boker", Website = "www.boker.de"
                };
                KnifeStore ks4 = new KnifeStore()
                {
                    Address = "Random Strt 9.", Name = "BladeShop", Website = "www.bladeshop.hu"
                };
                KnifeStore ks5 = new KnifeStore()
                {
                    Address = "Random Strt 617.", Name = "KnivesAndtools", Website = "www.knivesandtools.uk"
                };
                this.KnifeStores.Add(ks1);
                this.KnifeStores.Add(ks2);
                this.KnifeStores.Add(ks3);
                this.KnifeStores.Add(ks4);
                this.KnifeStores.Add(ks5);
            }

            this.AddKnifeStoreCmd = new RelayCommand(() => {
                this.knifeStoreLogic.AddKnifeStore(this.KnifeStores, token);
                RefreshKnifeStores();
            }, true);
            this.ModKnifeStoreCmd = new RelayCommand(() => this.knifeStoreLogic.ModKnifeStore(this.SelectedKnifeStore, token), true);
            this.DelKnifeStoreCmd = new RelayCommand(() => {
                this.knifeStoreLogic.DelKnifeStore(this.KnifeStores, this.SelectedKnifeStore, token);
                Knives  = new ObservableCollection <Knife>();
                Reviews = new ObservableCollection <Review>();
            }, true);

            this.AddKnifeCmd = new RelayCommand(() => {
                this.knifeLogic.AddKnife(this.Knives, selectedKnifeStore == null ? string.Empty : selectedKnifeStore.StorageId, token);
                RefreshKnives();
            }, true);
            this.ModKnifeCmd = new RelayCommand(() => this.knifeLogic.ModKnife(SelectedKnife, token), true);
            this.DelKnifeCmd = new RelayCommand(() => {
                this.knifeLogic.DelKnife(Knives, SelectedKnife, token);
                Reviews = new ObservableCollection <Review>();
            }, true);

            this.AddReviewCmd = new RelayCommand(() => {
                this.reviewLogic.AddReview(this.Reviews, selectedKnife == null ? string.Empty : SelectedKnife.SerialNumber, token);
                RefreshReview();
            }, true);
            this.ModReviewCmd = new RelayCommand(() => this.reviewLogic.ModReview(SelectedReview, token), true);
            this.DelReviewCmd = new RelayCommand(() => this.reviewLogic.DelReview(Reviews, SelectedReview, token), true);

            this.GenerateCmd = new RelayCommand(() => GenerateSample(), true);
            this.UpdateCmd   = new RelayCommand(() => RefreshKnifeStores(), true);
            this.GetKnives   = new RelayCommand(() => { RefreshKnives(); Reviews = new ObservableCollection <Review>(); selectedReview = null; }, true);
            this.GetReviews  = new RelayCommand(() => RefreshReview(), true);
            this.UpdateToken = new RelayCommand(() => SetToken(), true);
        }
Exemplo n.º 12
0
 public ReviewController(ConestogaCarpoolContext context, IReviewLogic reviewLogic)
 {
     _context     = context;
     _reviewLogic = reviewLogic;
 }
Exemplo n.º 13
0
 public ReviewController(IReviewLogic logic, IUserSession usersession)
 {
     _userSession = usersession;
     _logic       = logic;
 }