Beispiel #1
0
        private async void LoadData()
        {
            mGlobalLocations = await mLocationDataService.GetAll();

            mGlobalProducts = await mProductDataService.GetAll();

            mGlobalStorages = await mStorageDataService.GetAll();

            mGlobalCategories = await mCategoryDataService.GetAll();

            mGlobalUserLocs = await mUserLocationDataService.GetAll();

            mGlobalUserDatas = await mUserDataDataService.GetAll();

            mGlobalInventories = new List <InventoryViewModel>();

            List <InventoryViewModel> tempInventories = await mInventoryDataService.GetAll();

            for (int i = 0; i < tempInventories.Count(); i++)
            {
                for (int j = 0; j < mGlobalProducts.Count(); j++)
                {
                    if (tempInventories[i].ProductId == mGlobalProducts[j].Id)
                    {
                        tempInventories[i].ItemName = mGlobalProducts[j].Name;
                        mGlobalInventories.Add(tempInventories[i]);
                    }
                }
            }
        }
Beispiel #2
0
 protected override async Task OnInitializedAsync()
 {
     QueryParameters = new ProductListParameters();
     Elements        = (await DataService.Get(QueryParameters)).ToArray();
     Categories      = (await CategoryDataService.GetAll()).ToArray();
     Warehouses      = (await WarehouseDataService.GetAll()).ToArray();
     Taxes           = (await TaxDataService.GetAll()).ToArray();
     UnitOfMeasures  = (await UnitOfMeasureDataService.GetAll()).ToArray();
 }
Beispiel #3
0
        private async void LoadItemData()
        {
            //Spinner Adapter Category
            this.mCategories = await mCategoryDataService.GetAll();

            var adapterCategories = new SpinnerCategoryAdapter(this.Activity, mCategories);

            mSpinnerCategories.Adapter = adapterCategories;

            mSpinnerCategories.ItemSelected += SpinnerCategory_ItemSelected;
            mSpinnerCategories.SetSelection(0);

            //Spinner Adapter Storage
            List <StorageViewModel> tempStorages = new List <StorageViewModel>();

            tempStorages = await mStorageDataService.GetAll();

            for (int i = 0; i < tempStorages.Count(); i++)
            {
                if (tempStorages[i].LocationId == MainActivity.StaticActiveLocationClass.Id)
                {
                    mStorages.Add(tempStorages[i]);
                }
            }
            var adapterStorages = new SpinnerStorageAdapter(this.Activity, mStorages);

            mSpinnerStorages.Adapter = adapterStorages;

            mSpinnerStorages.ItemSelected += SpinnerStorage_ItemSelected;
            mSpinnerStorages.SetSelection(0);

            //Get data product
            this.mProducts = new List <ProductViewModel>();
            this.mProducts = await mProductDataService.GetAll();

            this.mProducts.Count();
            List <ProductViewModel> tempProduct = new List <ProductViewModel>();

            tempProduct = await mProductDataService.GetAll();

            for (int i = 0; tempProduct.Count() > i; i++)
            {
                mProductAdapter.Add(tempProduct[i].Name);
            }
            var adapter = new ArrayAdapter <String>(this.Activity, Resource.Layout.support_simple_spinner_dropdown_item, mProductAdapter);

            mName.Adapter = adapter;
        }
Beispiel #4
0
        private async void LoadStoragesData()
        {
            mProgressDialog  = ProgressDialog.Show(this, "Please wait...", "Getting Storage data...", true);
            this.mCategories = new List <CategoryViewModel>();
            this.mCategories = await mCategoryDataService.GetAll();

            this.mCategories.OrderBy(o => o.Name).ToList();

            if (mCategories != null)
            {
                this.mCategoryAdapter            = new CategoryRecyclerAdapter(this.mCategories, this);
                this.mCategoryAdapter.ItemClick += OnStorageClicked;

                this.mListViewCategory.SetAdapter(this.mCategoryAdapter);
            }
            mProgressDialog.Hide();
        }
Beispiel #5
0
        private async void LoadCategoriesData()
        {
            List <CategoryViewModel> mCategoriesByUser = await mCategoryDataService.GetAll();

            mCategories = new List <CategoryViewModel>();
            for (int i = 0; mCategoriesByUser.Count > i; i++)
            {
                if (mCategoriesByUser[i].UserId == LoginPageActivity.StaticUserClass.ID.ToString())
                {
                    mCategories.Add(mCategoriesByUser[i]);
                }
            }
            if (mCategories != null)
            {
                mCategoryAdapter            = new CategoryRecyclerAdapter(mCategories, this.Activity);
                mCategoryAdapter.ItemClick += OnLocationClicked;
                mListViewCategory.SetAdapter(this.mCategoryAdapter);
            }
        }
Beispiel #6
0
        private async void LoadData()
        {
            LoginPageActivity.mGlobalLocations = await mLocationDataService.GetAll();

            LoginPageActivity.mGlobalStorages = await mStorageDataService.GetAll();

            LoginPageActivity.mGlobalCategories = await mCategoryDataService.GetAll();

            LoginPageActivity.mGlobalUserLocs = await mUserLocationDataService.GetAll();

            LoginPageActivity.mGlobalUserDatas = await mUserDataDataService.GetAll();

            LoginPageActivity.mGlobalShopList = await mShopListDataService.GetAll();

            LoginPageActivity.mGlobalShopItem = await mShopItemDataService.GetAll();

            LoginPageActivity.mGlobalProducts = await mProductDataService.GetAll();

            LoginPageActivity.mGlobalInventories = new List <InventoryViewModel>();

            List <InventoryViewModel> tempInventories = await mInventoryDataService.GetAll();

            for (int i = 0; i < tempInventories.Count(); i++)
            {
                for (int j = 0; j < LoginPageActivity.mGlobalProducts.Count(); j++)
                {
                    if (tempInventories[i].ProductId == LoginPageActivity.mGlobalProducts[j].Id)
                    {
                        tempInventories[i].ItemName = LoginPageActivity.mGlobalProducts[j].Name;
                        LoginPageActivity.mGlobalInventories.Add(tempInventories[i]);
                    }
                    if (LoginPageActivity.mGlobalProducts[j].AddedUserId == LoginPageActivity.StaticUserClass.ID.ToString())
                    {
                        LoginPageActivity.mGlobalProductsByUser.Add(LoginPageActivity.mGlobalProducts[j]);
                    }
                }
            }
        }
Beispiel #7
0
        private async void LoadItemData()
        {
            mProgressDialog = ProgressDialog.Show(this, "Please wait...", "Getting data...", true);

            //Spinner Adapter Category
            this.mCategories = await mCategoryDataService.GetAll();

            var adapterCategories = new SpinnerCategoryAdapter(this, mCategories);

            mSpinnerCategories.Adapter       = adapterCategories;
            mSpinnerCategories.ItemSelected += SpinnerCategory_ItemSelected;

            //Spinner Adapter Storage
            List <StorageViewModel> tempStorages = new List <StorageViewModel>();

            tempStorages = await mStorageDataService.GetAll();

            for (int i = 0; tempStorages.Count() > i; i++)
            {
                if (tempStorages[i].LocationId == LoginActivity.StaticLocationClass.Id)
                {
                    mStorages.Add(tempStorages[i]);
                }
            }

            var adapterStorages = new SpinnerStorageAdapter(this, mStorages);

            mSpinnerStorages.Adapter       = adapterStorages;
            mSpinnerStorages.ItemSelected += SpinnerStorage_ItemSelected;

            //Get data product
            this.mProducts = new List <ProductViewModel>();
            this.mProducts = await mProductDataService.GetAll();

            this.mProducts.Count();

            mProgressDialog.Dismiss();
        }