Exemple #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]);
                    }
                }
            }
        }
Exemple #2
0
        private async void LoadLocationData()
        {
            List <UserLocationViewModel> mSharedUserByLocation = await userLocationDataService.GetAll();

            List <UserLocationViewModel> mTempUserLocation = mSharedUserByLocation.Where(s => s.LocationId == LoginPageActivity.StaticActiveLocationClass.Id).ToList();
            List <UserDataViewModel>     mUserData         = LoginPageActivity.mGlobalUserDatas;

            if (mTempUserLocation != null)
            {
                userLocationAdapter            = new UserLocationRecyclerAdapter(mTempUserLocation, mUserData, this.Activity);
                userLocationAdapter.ItemClick += OnLocationClicked;
                mListViewSharedLocation.SetAdapter(this.userLocationAdapter);
            }
        }
Exemple #3
0
        private async void LoadLocationData()
        {
            List <UserLocationViewModel> mSharedUserByLocation = await userLocationDataService.GetAll();

            int test = mSharedUserByLocation.Count;
            List <UserLocationViewModel> mTempUserLocation = new List <UserLocationViewModel>();
            List <UserDataViewModel>     mUserData         = LoginPageActivity.mGlobalUserDatas;

            for (int i = 0; mSharedUserByLocation.Count > i; i++)
            {
                if (mSharedUserByLocation[i].LocationId == MainActivity.StaticActiveLocationClass.Id)
                {
                    mTempUserLocation.Add(mSharedUserByLocation[i]);
                }
            }
            if (mTempUserLocation != null)
            {
                userLocationAdapter            = new UserLocationRecyclerAdapter(mTempUserLocation, mUserData, this.Activity);
                userLocationAdapter.ItemClick += OnLocationClicked;
                mListViewSharedLocation.SetAdapter(this.userLocationAdapter);
            }
        }
Exemple #4
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]);
                    }
                }
            }
        }