Esempio n. 1
0
        private async void CustomerDetail()
        {
            var customerItemViewModel = new CustomerItemViewModel
            {
                Address          = Address,
                City             = City,
                CityId           = CityId,
                CompanyCustomers = CompanyCustomers,
                CustomerId       = CustomerId,
                Department       = Department,
                DepartmentId     = DepartmentId,
                FirstName        = FirstName,
                IsUpdated        = IsUpdated,
                LastName         = LastName,
                Latitude         = Latitude,
                Longitude        = Longitude,
                Orders           = Orders,
                Phone            = Phone,
                Photo            = Photo,
                Sales            = Sales,
                UserName         = UserName,
            };

            var mainViewModel = MainViewModel.GetInstance();

            mainViewModel.SetCurrentCustomer(customerItemViewModel);
            await navigationService.Navigate("CustomerDetailsPage");
        }
        public MainViewModel()
        {
            // Singleton
            instance = this;

            // Instance services
            navigationService = new NavigationService();
            dataService       = new DataService();
            apiService        = new ApiService();
            netService        = new NetService();

            // Create Observable Collections
            Pins      = new ObservableCollection <Pin>();
            Menu      = new ObservableCollection <MenuItemViewModel>();
            Products  = new ObservableCollection <ProductItemViewModel>();
            Customers = new ObservableCollection <CustomerItemViewModel>();

            // Create Views
            NewLogin        = new LoginViewModel();
            UserLoged       = new UserViewModel();
            NewCustomer     = new CustomerItemViewModel();
            CurrentCustomer = new CustomerItemViewModel();

            // Load Data
            LoadMenu();
            LoadProducts();
            LoadCustomers();
        }
Esempio n. 3
0
        public MainViewModel()
        {
            //Singleton
            instance = this;

            //Create observable collections
            Menu      = new ObservableCollection <MenuItemViewModel>();
            Products  = new ObservableCollection <ProductItemViewModel>();
            Customers = new ObservableCollection <Customer>();
            Pins      = new ObservableCollection <Pin>();
            Orders    = new ObservableCollection <OrderItemViewModel>();

            //Create views
            NewLogin        = new LoginViewModel();
            UserLoged       = new UserViewModel();
            CurrentCustomer = new CustomerItemViewModel();
            NewCustomer     = new CustomerItemViewModel()
            {
                UserName = "******", Phone = "ss", FirstName = "aaa", LastName = "bbb", Address = "dir", CityId = 19, DepartmentId = 15
            };

            //Create instences service
            dataService       = new DataService();
            apiService        = new ApiService();
            netService        = new NetService();
            navigationService = new NavigationService();
            scanService       = new ScanService();

            LoadMenu();
            LoadProducts();
            LoadCustomers();
            LoadOrders();
        }
 public void SetCurrentCustomer(CustomerItemViewModel customerItemViewModel)
 {
     CurrentCustomer = customerItemViewModel;
 }