Exemplo n.º 1
0
 public HomeFragment()
 {
     this.RetainInstance = true;
     _catalogDataService = new CatalogDataService();
     _connection         = new ConnectionService();
     baseService         = new BaseService();
 }
        /// <summary>
        /// Initializes a new instance for the <see cref="DetailPageViewModel" /> class.
        /// </summary>
        public DetailPageViewModel(string callerPage, ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                   IWishlistDataService wishlistDataService, Product selectedProduct)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;
            this.selectedProduct     = selectedProduct;

            Device.BeginInvokeOnMainThread(() =>
            {
                AddRecentProduct(selectedProduct.ID.ToString());
                FetchProduct(selectedProduct.ID.ToString());
                UpdateCartItemCount();
            });

            AddFavouriteCommand = new DelegateCommand(AddFavouriteClicked);
            NotificationCommand = new DelegateCommand(NotificationClicked);
            AddToCartCommand    = new DelegateCommand(AddToCartClicked);
            LoadMoreCommand     = new DelegateCommand(LoadMoreClicked);
            ShareCommand        = new DelegateCommand(ShareClicked);
            VariantCommand      = new DelegateCommand(VariantClicked);
            CardItemCommand     = new DelegateCommand(CartClicked);
            BackButtonCommand   = new DelegateCommand(BackButtonClicked);


            MessagingCenter.Subscribe <RecorderViewModel, PredictionData>(this, callerPage, MessageCenterSubmitAsync);
        }
Exemplo n.º 3
0
 public ProductDetailsViewModel(
     ICatalogDataService catalogDataService
     )
 {
     _catalogDataService = catalogDataService;
     Promotions          = new ObservableCollection <PromotionModel>();
 }
Exemplo n.º 4
0
 public PieCatalogViewModel(IConnectionService connectionService,
                            INavigationService navigationService, IDialogService dialogService,
                            ICatalogDataService catalogDataService)
     : base(connectionService, navigationService, dialogService)
 {
     _catalogDataService = catalogDataService;
 }
Exemplo n.º 5
0
 public ShoppingCartViewModel(
     ICatalogDataService catalogDataService,
     IOrderDataService orderDataService
     )
 {
     _catalogDataService = catalogDataService;
     _orderDataService   = orderDataService;
 }
Exemplo n.º 6
0
 public AddPromotionViewModel(
     ICatalogDataService catalogDataService,
     INotificationService notificationService
     )
 {
     _catalogDataService  = catalogDataService;
     _notificationService = notificationService;
 }
Exemplo n.º 7
0
 public CategoriesFragment(int v1, string v2)
 {
     this.v1             = v1;
     this.v2             = v2;
     _catalogDataService = new CatalogDataService();
     _connection         = new ConnectionService();
     baseService         = new BaseService();
 }
Exemplo n.º 8
0
        public HomeViewModel(IConnectionService connectionService,
                             INavigationService navigationService,
                             IDialogService dialogService,
                             ICatalogDataService catalogDataService) : base(connectionService, navigationService, dialogService)
        {
            _catalogDataService = catalogDataService;

            ProductsOfTheWeek = new ObservableCollection <Product>();
        }
Exemplo n.º 9
0
 public LoginPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, ICatalogDataService catalogDataService)
 {
     _navigationService  = navigationService;
     _pageDialogService  = pageDialogService;
     _catalogDataService = catalogDataService;
     if (_isRemebered)
     {
         ExecuteOnLoginCommand();
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(ICatalogDataService catalogDataService)
        {
            AddItemToBasketCommand = new RelayCommand(AddItemToBasketMethod);
            MoveLeftCommand        = new RelayCommand(MoveLeftMethod);
            MoveRightCommand       = new RelayCommand(MoveRightMethod);

            _catalogItems = catalogDataService.GetAllCatalogItems();

            _maxIndex = _catalogItems.Count - 1;

            SelectFirstFromCatalog();
        }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance for the <see cref="CatalogPageViewModel" /> class.
        /// </summary>
        public CatalogPageViewModel(ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                    IWishlistDataService wishlistDataService, string selectedCategory)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;

            Device.BeginInvokeOnMainThread(() =>
            {
                UpdateCartItemCount();
                FetchProducts(selectedCategory);
            });
        }
Exemplo n.º 12
0
        public HomeViewModel(IConnectionService connectionService,
                             INavigationService navigationService,
                             IDialogService dialogService,
                             ICatalogDataService catalogDataService,
                             ISettingsService settingsService) : base(connectionService, navigationService, dialogService)
        {
            _catalogDataService = catalogDataService;
            _settingsService    = settingsService;

            PiesOfTheWeek = new ObservableCollection <Pie>();
            MessagingCenter.Subscribe <PieCatalogViewModel>(this, "Pies_added", refreshpie);
            //initialise();
        }
        public HomeViewModel(
            IConnectionService connectionService,
            INavigationService navigationService,
            IDialogService dialogService,
            ICatalogDataService catalogDataService)
        {
            _connectionService  = connectionService;
            _navigationService  = navigationService;
            _dialogService      = dialogService;
            _catalogDataService = catalogDataService;

            PiesOfTheWeak = new ObservableCollection <Pie>();
        }
Exemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance for the <see cref="CatalogPageViewModel" /> class.
        /// </summary>
        public CatalogPageViewModel(string callerPage, ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                    IWishlistDataService wishlistDataService, string selectedCategory)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;

            Device.BeginInvokeOnMainThread(() =>
            {
                UpdateCartItemCount();
                FetchProducts(selectedCategory);
            });

            MessagingCenter.Subscribe <RecorderViewModel, PredictionData>(this, callerPage, MessageCenterSubmitAsync);
        }
        public ProductHomePageViewModel(IProductHomeDataService productHomeDataService,
                                        ICatalogDataService catalogDataService)
        {
            this.productHomeDataService = productHomeDataService;
            this.catalogDataService     = catalogDataService;

            Device.BeginInvokeOnMainThread(() =>
            {
                FetchBannerImage();
                FetchOfferProducts();
                FetchRecentProducts();
            });

            //this.itemSelectedCommand = new DelegateCommand(this.ItemSelected);
        }
Exemplo n.º 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _catalogDataService = new CatalogDataService();
            _connection         = new ConnectionService();
            baseService         = new BaseService();
            var idCategoria   = base.Intent.Extras.GetInt("id", -1);
            var nameCategoria = base.Intent.Extras.GetString("title");
            var toolbar       = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarPrincipal);

            base.SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            this.Title             = nameCategoria;
            SupportActionBar.Title = Title;
            GetProductListCategory(idCategoria, nameCategoria);
            GetProductListCategoryByRecicle(idCategoria, nameCategoria);
        }
Exemplo n.º 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _catalogDataService = new CatalogDataService();
            _connection         = new ConnectionService();
            baseService         = new BaseService();


            list = FindViewById <ListView>(Resource.Id.List);
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarPrincipal);

            base.SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetTitle(Resource.String.carrinho);
            LoadListCart();
            // Create your application here
        }
Exemplo n.º 18
0
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            _catalogDataService = new CatalogDataService();
            _connection         = new ConnectionService();
            baseService         = new BaseService();
            var idProduct   = base.Intent.Extras.GetInt("id", -1);
            var nameProduct = base.Intent.Extras.GetString("name");
            var toolbar     = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarPrincipal);

            base.SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            this.Title             = nameProduct;
            SupportActionBar.Title = Title;
            //reciclerView na HomeDetail Layout
            mRecyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            LoadDetailProduct(idProduct, nameProduct);
        }
        /// <summary>
        /// Initializes a new instance for the <see cref="CheckoutPageViewModel" /> class.
        /// </summary>
        public CheckoutPageViewModel(IUserDataService userDataService, ICartDataService cartDataService,
                                     ICatalogDataService catalogDataService, IMyOrdersDataService myOrdersDataService = null)
        {
            this.userDataService    = userDataService;
            this.cartDataService    = cartDataService;
            this.catalogDataService = catalogDataService;
            DeliveryAddress         = new ObservableCollection <Customer>();
            PaymentModes            = new ObservableCollection <Payment>();

            Device.BeginInvokeOnMainThread(() =>
            {
                FetchAddresses();
                FetchPaymentOptions();
                FetchCartList();
            });

            EditCommand          = new DelegateCommand(EditClicked);
            AddAddressCommand    = new DelegateCommand(AddAddressClicked);
            PlaceOrderCommand    = new DelegateCommand(PlaceOrderClicked);
            PaymentOptionCommand = new DelegateCommand(PaymentOptionClicked);
            ApplyCouponCommand   = new DelegateCommand(ApplyCouponClicked);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance for the <see cref="DetailPageViewModel" /> class.
        /// </summary>
        public DetailPageViewModel(ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                   IWishlistDataService wishlistDataService, Product selectedProduct)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;
            this.selectedProduct     = selectedProduct;

            Device.BeginInvokeOnMainThread(() =>
            {
                AddRecentProduct(selectedProduct.ID.ToString());
                FetchProduct(selectedProduct.ID.ToString());
                UpdateCartItemCount();
            });

            AddFavouriteCommand = new DelegateCommand(AddFavouriteClicked);
            NotificationCommand = new DelegateCommand(NotificationClicked);
            AddToCartCommand    = new DelegateCommand(AddToCartClicked);
            LoadMoreCommand     = new DelegateCommand(LoadMoreClicked);
            ShareCommand        = new DelegateCommand(ShareClicked);
            VariantCommand      = new DelegateCommand(VariantClicked);
            CardItemCommand     = new DelegateCommand(CartClicked);
            BackButtonCommand   = new DelegateCommand(BackButtonClicked);
        }
        /// <summary>
        /// Initializes a new instance for the <see cref="CheckoutPageViewModel" /> class.
        /// </summary>
        public CheckoutPageViewModel(string callerPage, IUserDataService userDataService, ICartDataService cartDataService,
                                     ICatalogDataService catalogDataService, IMyOrdersDataService myOrdersDataService = null)
        {
            this.userDataService    = userDataService;
            this.cartDataService    = cartDataService;
            this.catalogDataService = catalogDataService;
            DeliveryAddress         = new ObservableCollection <Customer>();
            PaymentModes            = new ObservableCollection <Payment>();

            Device.BeginInvokeOnMainThread(() =>
            {
                FetchAddresses();
                FetchPaymentOptions();
                FetchCartList();
            });

            EditCommand          = new DelegateCommand(EditClicked);
            AddAddressCommand    = new DelegateCommand(AddAddressClicked);
            PlaceOrderCommand    = new DelegateCommand(PlaceOrderClicked);
            PaymentOptionCommand = new DelegateCommand(PaymentOptionClicked);
            ApplyCouponCommand   = new DelegateCommand(ApplyCouponClicked);

            MessagingCenter.Subscribe <RecorderViewModel, PredictionData>(this, callerPage, MessageCenterSubmitAsync);
        }
 public CardPaymentViewModel(IConnectionService connectionService,
                             INavigationService navigationService,
                             IDialogService dialogService,
                             ICatalogDataService catalogDataService) : base(connectionService, navigationService, dialogService)
 {
 }
 public CatalogDataServiceUnitTest()
 {
     _mockCatalogDataService = new Mock <ICatalogDataService>();
     _catalogDataService     = new CatalogDataService();
 }
 public void SetUp()
 {
     catalogDataService = MockRepository.GenerateMock<ICatalogDataService>();
     catalogService = new CatalogService(catalogDataService);
 }
Exemplo n.º 25
0
 public CatalogService(ICatalogDataService catalogDataService = null)
 {
     if (catalogDataService == null)
         catalogDataService = DAOFactoryMethod.CurrentDAOFactory.CatalogDataService;
     this.catalogDataService = catalogDataService;
 }