Exemple #1
0
 public SignUpViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest, IFileService fileService)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest, fileService: fileService)
 {
     SignUpCommand      = new DelegateCommand(SignupExcute);
     EditCommand        = new DelegateCommand(EditUserExcute);
     ChoosePhotoCommand = new DelegateCommand(async() => await ChoosePhotoReceiveExecute());
 }
Exemple #2
0
 public ChartService(ISqLiteService sqLiteService)
 {
     _sqLiteService      = sqLiteService;
     _weightForAgeData   = ReadCsv("wfa-g-z");
     _lengthForAgeData   = ReadCsv("lfa-g-z");
     _headSizeForAgeData = ReadCsv("hfa-g-z");
     _bmiForAgeData      = ReadCsv("bfa-g-z");
 }
 public WalletBalancePageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest)
 {
     AddMoneyCommand = new DelegateCommand(AddMoneyExcute);
     if (App.Settings.IsLogin)
     {
         UserInfo = SqLiteService.Get <UserModel>(user => user.Id != -1);
     }
     AmountCoin = 100;
 }
Exemple #4
0
 public HomeController(
     IImportService importService,
     ISqLiteService sqLiteService,
     IChartService chartService,
     IAccountService accountService)
 {
     _importService  = importService;
     _sqLiteService  = sqLiteService;
     _chartService   = chartService;
     _accountService = accountService;
 }
Exemple #5
0
 public AddMoneyPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest)
 {
     AddCoinCommand        = new DelegateCommand(AddCoinExcute);
     ChooseWayCheckoutList = new ObservableCollection <string>()
     {
         "ATM", "Visa/Credit Card", "Paypal"
     };
     if (App.Settings.IsLogin)
     {
         UserInfo = SqLiteService.Get <UserModel>(user => user.Id != -1);
     }
 }
Exemple #6
0
        public CategoryPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService)
            : base(navigationService: navigationService, sqliteService: sqLiteService)
        {
            IsSearchCommand         = new DelegateCommand(IsSearchChangeExcute);
            SelectedCategoryCommand = new DelegateCommand(SelectedCategoryExcute);

            var list = SqLiteService.GetList <Category>(x => x.Id != -1).ToList();

            if (list.Count > 0)
            {
                CategoryList = new ObservableCollection <Category>(list);
            }
            else
            {
                CategoryList = new ObservableCollection <Category>()
                {
                    new Category()
                    {
                        Id           = 1,
                        CategoryName = TranslateExtension.Get("ElectronicsAndGadgets"),
                        Image        = "ic_history",
                    },
                    new Category()
                    {
                        Id           = 2,
                        CategoryName = TranslateExtension.Get("HomeAndFurniture"),
                        Image        = "ic_history",
                    }, new Category()
                    {
                        Id           = 3,
                        CategoryName = TranslateExtension.Get("SportAndHealth"),
                        Image        = "ic_history",
                    }, new Category()
                    {
                        Id           = 4,
                        CategoryName = TranslateExtension.Get("Fashion"),
                        Image        = "ic_history",
                    }, new Category()
                    {
                        Id           = 5,
                        CategoryName = TranslateExtension.Get("OfficeAndIndustry"),
                        Image        = "ic_history",
                    }
                };
                foreach (var item in CategoryList)
                {
                    SqLiteService.Insert(item);
                }
            }
        }
 public MemoriesService(IConfiguration configuration,
                        IMjmlServices mjmlServices,
                        IAccountService accountService,
                        ISqLiteService sqLiteService,
                        ISendGridClient sendGridClient,
                        ILogger <MemoriesService> logger)
 {
     _configuration  = configuration;
     _mjmlServices   = mjmlServices;
     _accountService = accountService;
     _sqLiteService  = sqLiteService;
     _sendGridClient = sendGridClient;
     _logger         = logger;
 }
Exemple #8
0
        public ProfileUserPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest, IAppInfo appInfo)
            : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest, appInfo: appInfo)
        {
            LoginSignupCommand        = new DelegateCommand(NavigateToLoginPage);
            NavigateWalletBalancePage = new DelegateCommand(NavigateWalletBalancePageExcute);
            CheckInformationCommand   = new DelegateCommand(CheckInformationExcute);
            PurchasedProdcutCommand   = new DelegateCommand(PurchasedProdcutExcute);
            ViewedProdcutCommand      = new DelegateCommand(ViewedProdcutExcute);
            UploadItemCommand         = new DelegateCommand(UploadItemExcute);
            GoToShopCommand           = new DelegateCommand(GoToShopExcute);
            SelledProdcutCommand      = new DelegateCommand(SelledProductExcute);
            StatisticCommand          = new DelegateCommand(StatisticExcute);

            LogOutCommand = new DelegateCommand(LogOutExcute);
            // IsLogin = App.Settings.IsLogin;
        }
Exemple #9
0
 public ShowCardPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest)
 {
     if (!IsNullCart)
     {
         var listItemOfCartTemp = SqLiteService.GetList <OrderDetails>(x => x.Id != "");
         ItemOfOrder = new ObservableCollection <OrderDetails>();
         if (listItemOfCartTemp != null)
         {
             ItemOfOrder = new ObservableCollection <OrderDetails>(listItemOfCartTemp);
             foreach (var item in ItemOfOrder)
             {
                 Total += item.Amount * item.Price;
             }
         }
     }
     NavigateToCheckoutCommand = new DelegateCommand(NavigateToCheckoutExcute);
 }
Exemple #10
0
        public ViewModelBase(INavigationService navigationService = null, IPageDialogService dialogService = null, ISqLiteService sqliteService = null)
        {
            if (navigationService != null)
            {
                Navigation = navigationService;
            }
            if (dialogService != null)
            {
                DialogService = dialogService;
            }
            if (sqliteService != null)
            {
                SqLiteService = sqliteService;
            }

            BackCommand       = new DelegateCommand(async() => await BackExecute());
            BackToRootCommand = new DelegateCommand(async() => await BackToRootExecute());
        }
 public SearchItemPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest)
 {
     ItemTappedCommand = new DelegateCommand(SelectedItemExcutWithoutPara);
 }
Exemple #12
0
 public AppDatabase(ISqLiteService sqLiteService)
 {
     _connection = sqLiteService.GetConnectionAsync();
     _connection.CreateTableAsync <Session>().Wait();
 }
Exemple #13
0
        public ProceedToCheckoutPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
            : base(navigationService: navigationService, dialogService: pageDialogService, sqliteService: sqLiteService, httpRequest: httpRequest)
        {
            NavigateToWalletCommand = new DelegateCommand(NavigateToWalletExcute);
            if (!IsNullCart)
            {
                var listItemOfCartTemp = SqLiteService.GetList <OrderDetails>(x => x.Id != "");
                ItemOfOrder = new ObservableCollection <OrderDetails>();
                if (listItemOfCartTemp != null)
                {
                    ItemOfOrder = new ObservableCollection <OrderDetails>(listItemOfCartTemp);
                    foreach (var item in ItemOfOrder)
                    {
                        Total += item.Amount * item.Price;
                    }
                }
            }
            ChooseShippingList = new ObservableCollection <string>()
            {
                TranslateExtension.Get("FreeShip"),
                TranslateExtension.Get("Standard"),
                TranslateExtension.Get("Express"),
            };

            ChooseScheduleWay = new ObservableCollection <string>()
            {
                TranslateExtension.Get("Once"),
                TranslateExtension.Get("Twice"),
                TranslateExtension.Get("Third"),
            };

            CheckoutCommand = new DelegateCommand(CheckoutExcute);

            if (App.Settings.IsLogin)
            {
                UserInfo = SqLiteService.Get <UserModel>(x => x.Id != -1);
            }
        }
Exemple #14
0
        private void InitDatabase()
        {
            var connectionService = DependencyService.Get <IDatabaseConnection>();

            _sqLiteService = new SqLiteService(connectionService);
        }
Exemple #15
0
 public ItemDatabase(ISqLiteService sqLiteService)
 {
     _connection = sqLiteService.GetConnectionAsync();
     _connection.CreateTableAsync <Item>().Wait();
 }
Exemple #16
0
 public LoginPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService)
     : base(navigationService: navigationService, sqliteService: sqLiteService)
 {
     LoginCommand          = new DelegateCommand(LoginExecute);
     ForgotPasswordCommand = new DelegateCommand(ForgotPasswordExecute);
 }
Exemple #17
0
        public ItemDetailsPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
            : base(navigationService: navigationService, dialogService: pageDialogService, sqliteService: sqLiteService, httpRequest: httpRequest)
        {
            ShowMoreItemDetailCommand = new DelegateCommand(ShowMoreItemDetailExcute);
            NavigateToCartCommand     = new DelegateCommand(NavigateToCartExcute);
            AddToCartCommand          = new DelegateCommand(AddToCartExcute);
            SubmitReviewCommand       = new DelegateCommand(SubmitReviewExcute);

            if (App.Settings.IsLogin)
            {
                UserInfo = SqLiteService.Get <UserModel>(x => x.Id != -1);
            }
        }
 public CategoryDetailsPageViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest)
 {
     IsSearchCommand   = new DelegateCommand(IsSearchChangeExcute);
     ItemTappedCommand = new DelegateCommand(SelectedItemExcutWithoutPara);
 }
Exemple #19
0
 public MessagePageViewModel(INavigationService navigationService, ISqLiteService sqLiteService) : base(navigationService: navigationService, sqliteService: sqLiteService)
 {
     NavigatieMainpageCommand = new DelegateCommand(NavigatieMainpageExcute);
 }
 public MainPageViewModel(INavigationService navigationService, ISqLiteService sqliteService)
     : base(navigationService: navigationService, sqliteService: sqliteService)
 {
     Title         = "Main Page";
     LogoutCommand = new DelegateCommand(LogoutExecute);
 }
Exemple #21
0
 public ProfileUserViewModel(INavigationService navigationService, ISqLiteService sqLiteService, IHttpRequest httpRequest, IAppInfo appInfo)
     : base(navigationService: navigationService, sqliteService: sqLiteService, httpRequest: httpRequest, appInfo: appInfo)
 {
     LoginSignupCommand = new DelegateCommand(NavigateToLoginPage);
     IsLogin            = App.Settings.IsLogin;
 }