public async void SelectionChange(object sender, SelectedItemChangedEventArgs e)
        {
            //ShareUserData.listStore.Add(new ListStores {listStore = autoComplete.Text});



            if (ShareUserData.listStore == null)
            {
            }
            else
            {
                list = ShareUserData.listStore;
            }


            string     storeName = autoComplete.Text;
            ListStores listData  = new ListStores()
            {
                store = storeName
            };

            list.Add(listData);
            ShareUserData.listStore = list;

            await Navigation.PopModalAsync();
        }
        public void AddStore(Object sender, EventArgs e)
        {
            //  Navigation.PushModalAsync(new StoresAdd());
            if (ShareUserData.listStore == null)
            {
            }
            else
            {
                lists = ShareUserData.listStore;
            }


            string storeName   = autoComplete.Text;
            bool   checkStores = true;

            foreach (ListStores list in lists)
            {
                if (storeName == list.store)
                {
                    checkStores = false;
                }
            }

            if (checkStores)
            {
                string storeSuburbs = "(No Suburb)";
                if (storesSuburb.Text == "")
                {
                    storesSuburb.Text = "(No Suburb)";
                }
                else
                {
                    storeSuburbs = storesSuburb.Text;
                }
                ListStores listData = new ListStores()
                {
                    store       = storeName,
                    storeSuburb = storeSuburbs
                };
                lists.Add(listData);
                ShareUserData.listStore = lists;
            }
            else
            {
                DisplayAlert("", "The Store is already exist in below list", "Ok");
            }

            listView.ItemsSource = null;
            listView.ItemsSource = ShareUserData.listStore;
            autoComplete.Text    = "";
            storesSuburb.Text    = "";
            if (listView.ItemsSource == null)
            {
                listValidationText.Text = "There is no Selected Stroes";
            }
            else
            {
                listValidationText.Text = "";
            }
        }
        public void ItemTappedEvent(Object sender, ItemTappedEventArgs e)
        {
            ListStores list = e.Item as ListStores;

            Navigation.PushModalAsync(new Hotels(new HotelsGroupViewModel(), list));
            // DisplayAlert("", "" + list.store, "Ok");
        }
        //Button b = null;
        public void SaveHandler(Object sender, SelectedItemChangedEventArgs e)
        {
            b = (Button)sender;
            AbsoluteLayout relative = (AbsoluteLayout)b.ParentView;
            Entry          entry1   = (Entry)relative.Children[2];
            ListStores     listData = new ListStores()
            {
                store       = entry1.Text,
                storeSuburb = "(No Suburb)",
                storeDetail = "(0 Items)"
            };
            int findLastIndex = lists.Count - 1;

            lists.RemoveAt(findLastIndex);
            lists.Insert(findLastIndex, listData);
            entry1.IsVisible = false;

            listView.ItemsSource = null;
            listView.ItemsSource = lists;

            Label labelStore1 = (Label)relative.Children[0];
            Label labelStore2 = (Label)relative.Children[1];

            labelStore1.IsVisible = true;
            labelStore2.IsVisible = true;
            Button updateStoreBtn = (Button)relative.Children[5];

            updateStoreBtn.IsVisible = false;
        }
        public void ItemSelect(Object sender, SelectedItemChangedEventArgs e)
        {
            // var store = e.SelectedItem as ListStores;

            try
            {
                counter = 0;
                if (e.SelectedItem == null)
                {
                    return;
                }
                ListStores storeTitle = e.SelectedItem as ListStores;

                list = SharedUserData.addProduct;
                // listItems.Clear();
                if (list != null)
                {
                    foreach (ListProduct listData in list)
                    {
                        if (listData.store == storeTitle.store)
                        {
                            //    listItems.Add(listData);
                            counter++;
                        }
                    }
                }


                string trolliTitleVar = trolliTitle.Text;
                if (trolliTitleVar == "")
                {
                    Navigation.PushModalAsync(new AddProduct(storeTitle.store, storeTitle.storeSuburb, counter, "", storeTitle.rewardCard), true);
                }
                else
                {
                    Navigation.PushModalAsync(new AddProduct(storeTitle.store, storeTitle.storeSuburb, counter, trolliTitleVar, storeTitle.rewardCard), true);
                }
                ((ListView)sender).SelectedItem = null;
            }
            catch (Exception ex) {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }

            /*   if (_oldData == store)
             * {
             *     store.IsVisible = !store.IsVisible;
             * }
             * else {
             *     if(_oldData != null) {
             *         _oldData.IsVisible = false;
             *     }
             *     store.IsVisible = true;
             *
             * }
             * _oldData = store;
             * //        var product = e.SelectedItem as ListStores;
             * listView.ItemsSource = null;
             * listView.ItemsSource = ShareUserData.listStore;
             */
        }
        public void UpdateStoreList()
        {
            try
            {
                ObservableCollection <ListStores> lists = SharedUserData.listStore;

                foreach (ListStores list in lists)
                {
                    if (stores.Contains(list.store))
                    {
                        ListStores update = new ListStores()
                        {
                            store       = list.store,
                            storeSuburb = list.storeSuburb,
                            storeDetail = storeItemCount
                        };
                        lists[lists.IndexOf(list)] = update;
                        //   int index = lists.IndexOf(list);
                        //   lists.RemoveAt(index);
                        //   lists.Insert(index, update);
                    }
                }

                SharedUserData.listStore = lists;
            }
            catch (Exception ex)
            {
                // DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
        public void NextButton(object sender, EventArgs e)
        {
            try
            {
                SharedUserData.listStore  = new ObservableCollection <ListStores>();
                SharedUserData.addProduct = new ObservableCollection <ListProduct>();

                ListStores listData = new ListStores()
                {
                    store       = "Any Store",
                    storeSuburb = "(No Suburb)",
                    storeDetail = "Any Store (0 Items)"
                };

                list.Add(listData);
                SharedUserData.listStore = list;

                saveTrollyFees();
                Navigation.PushAsync(new PaymentCardInfo(ob));
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
                //Exception Class
            }
        }
Exemple #8
0
        private void lookUpEditStores_EditValueChanged(object sender, EventArgs e)
        {
            Store store = null;

            if (lookUpEditStores.EditValue != null)
            {
                long storeid = Convert.ToInt64(lookUpEditStores.EditValue);

                StoreView sw = ListStores.GetById(storeid);

                if (sw != null)
                {
                    store = sw.Entity;
                    //Domain.Country country = _listStores.GetCountry(sw.CountryID);

                    if (sw.CountryID == ClientEnvironment.CountryService.AustriaCountryID)
                    {
                        _EnabledEdit = false;
                    }
                    else
                    {
                        _EnabledEdit = true;
                    }
                    //if (sw.Co
                }
            }

            EntityStore = store;
        }
Exemple #9
0
 public Hotels(HotelsGroupViewModel viewModel, ListStores list)
 {
     InitializeComponent();
     this.ViewModel  = viewModel;
     listStore       = list;
     storeTitle.Text = list.store;
     ListProduct();
     CheckList();
     statesPicker.SelectedIndex = 0;
     Unit.SelectedIndex         = 3;
 }
        public void AddStore(Object sender, EventArgs e)
        {
            ListStores listData = new ListStores()
            {
                store       = "Any Store",
                storeSuburb = "(No Suburb)",
                storeDetail = "(0 Items)"
            };

            lists.Add(listData);

            listView.ItemsSource = null;
            listView.ItemsSource = lists;
        }
Exemple #11
0
 protected override void EntityChanged()
 {
     if (Entity != null)
     {
         GenerateEmployeeList();
         // ACPRO #121486 - show Peronal ID or Personal Number, depending of store's country
         Domain.Country storeCountry = ListStores.GetCountry(ListStores.GetById(EntityStore.ID).CountryID);
         gridColumn_PersonID.Visible = (storeCountry.PersShowMode == PersShowModeType.PersonalID ||
                                        storeCountry.PersShowMode == PersShowModeType.All);
         gridColumn_PersNumber.Visible = (storeCountry.PersShowMode == PersShowModeType.PersonalNumber ||
                                          storeCountry.PersShowMode == PersShowModeType.All);
     }
     base.EntityChanged();
 }
 private void ItadSelectCountry_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ItadSelectCountry.SelectedItem != null)
     {
         settings.Country = (string)ItadSelectCountry.SelectedItem;
         GetInfosRegion(settings.Region);
         if (!IsFirst)
         {
             ListStores.Text        = "";
             StoresItems            = isThereAnyDealApi.GetRegionStores(settings.Region, settings.Country);
             ListStores.ItemsSource = StoresItems;
             ListStores.UpdateLayout();
         }
     }
 }
Exemple #13
0
        public void UpdateStoreList()
        {
            try
            {
                string store          = "";
                string storeItemCount = "";
                int    counter        = 0;

                int length = listData.Count;
                listx = SharedUserData.addProduct;
                ObservableCollection <ListStores> lists = new ObservableCollection <ListStores>();

                if (listx != null)
                {
                    for (int i = 0; i < length; i++)
                    {
                        foreach (ListProduct listDatas in listx)
                        {
                            if (listData.ElementAt(i) == listDatas.store)
                            {
                                store = listDatas.store;
                                counter++;
                            }
                        }
                        storeItemCount = store + " (" + counter + " Items)";
                        counter        = 0;
                        ListStores update = new ListStores()
                        {
                            store       = listData.ElementAt(i),
                            storeSuburb = "(No Suburb)",
                            storeDetail = storeItemCount
                        };
                        lists.Add(update);
                    }
                }
                listData = new List <string>();
                SharedUserData.listStore = null;

                SharedUserData.listStore = lists;
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
Exemple #14
0
        public void ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            try
            {
                if (e.SelectedItem == null)
                {
                    return;
                }
                ListStores trollyDetail = e.SelectedItem as ListStores;
                Navigation.PushAsync(new MyTrollyItems(items, trollyDetail.store));

                ((ListView)sender).SelectedItem = null;
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
                //Exception Class
            }
        }
        protected override void OnAppearing()
        {
            try
            {
                listView.ItemsSource = null;
                listView.ItemsSource = SharedUserData.listStore;
                scheduleButtonEnable();
                if (listView.ItemsSource == null)
                {
                    // listValidationText.Text = "There is no Selected Stroes";
                    ListStores listData = new ListStores()
                    {
                        store       = "Any Store",
                        storeSuburb = "(No Suburb)",
                        storeDetail = "Any Store (0 Items)"
                    };

                    lists.Add(listData);
                    SharedUserData.listStore = lists;
                    listView.ItemsSource     = null;
                    listView.ItemsSource     = SharedUserData.listStore;
                }
                else
                {
                    //  listValidationText.Text = "";

                    listView.ItemsSource = null;
                    listView.ItemsSource = SharedUserData.listStore;
                }
                ItemsCount();


                mainGrid.Height = 1;

                listSection.TranslateTo(0, 0, 100);

                listSection1.TranslateTo(0, 0, 100);
                base.OnAppearing();
            }catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
        public async void DeleteHandler(Object sender, EventArgs e)
        {
            bool check = await DisplayAlert("", "All your grocery list under this store will also be removed. Are you sure you want to delete this store from the list?", "Yes", "Cancel");

            if (check)
            {
                ListStores content = (sender as Button).CommandParameter as ListStores;
                list = ShareUserData.addProduct;

                if (list != null)
                {
                    IEnumerable <ListProduct> obsCollection = (IEnumerable <ListProduct>)ShareUserData.addProduct;
                    var lists = new List <ListProduct>(obsCollection);
                    foreach (ListProduct listData in lists)
                    {
                        if (listData.store == content.store)
                        {
                            ShareUserData.addProduct.Remove(listData);
                        }
                    }
                }
                ShareUserData.listStore.Remove(content);
            }
        }
        public async void DeleteHandler(Object sender, EventArgs e)
        {
            try
            {
                bool check = await DisplayAlert("", "All your grocery list under this store will also be removed. Are you sure you want to delete this store from the list?", "Yes", "No");

                if (check)
                {
                    ListStores content = (sender as Button).CommandParameter as ListStores;
                    list = SharedUserData.addProduct;

                    if (list != null)
                    {
                        IEnumerable <ListProduct> obsCollection = (IEnumerable <ListProduct>)SharedUserData.addProduct;
                        var lists = new List <ListProduct>(obsCollection);
                        foreach (ListProduct listData in lists)
                        {
                            if (listData.store == content.store)
                            {
                                SharedUserData.addProduct.Remove(listData);
                            }
                        }
                    }

                    int index = SharedUserData.listStore.IndexOf(content);
                    SharedUserData.listStore.RemoveAt(index);

                    listView.ItemsSource = null;
                    listView.ItemsSource = SharedUserData.listStore;
                    ItemsCount();
                }
            }catch (Exception ex)
            {
                await DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
Exemple #18
0
        public void CloneHandle(Object sender, EventArgs e)
        {
            try
            {
                //   if (e.SelectedItem == null) return;
                TrollyCreation trollyDetail = (sender as Button).CommandParameter as TrollyCreation;
                ObservableCollection <ListProduct> dataItems = new ObservableCollection <ListProduct>();

                ObservableCollection <ListStores> listStores = new ObservableCollection <ListStores>();
                SharedUserData.addProduct = null;
                string trollyData = "[" + trollyDetail.trollyDetail + "]";
                List <Dictionary <string, object> > posts = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(trollyData);
                //   listView.ItemsSource = posts;

                bool check = true;
                foreach (Dictionary <string, object> i in posts)
                {
                    ListProduct ob = new ListProduct()
                    {
                        detailItem  = Convert.ToString(i["detailItem"]),
                        description = Convert.ToString(i["description"]),
                        items       = Convert.ToString(i["items"]),
                        quantity    = Convert.ToInt32(i["quantity"]),
                        size        = Convert.ToString(i["size"]),
                        store       = Convert.ToString(i["store"]),
                        storeSuburb = Convert.ToString(i["storeSuburb"]),
                        unit        = Convert.ToString(i["unit"])
                    };

                    if (check)
                    {
                        listData.Add(ob.store);

                        ListStores listStore = new ListStores()
                        {
                            store       = Convert.ToString(i["store"]),
                            storeSuburb = Convert.ToString(i["storeSuburb"])
                        };
                        listStores.Add(listStore);
                        check = false;
                    }
                    else
                    {
                        if (listData.Contains(ob.store))
                        {
                        }
                        else
                        {
                            listData.Add(ob.store);

                            ListStores listStore = new ListStores()
                            {
                                store       = Convert.ToString(i["store"]),
                                storeSuburb = Convert.ToString(i["storeSuburb"])
                            };
                            listStores.Add(listStore);
                        }
                    }

                    dataItems.Add(ob);
                }

                //  SharedUserData.listStore = listStores;


                SharedUserData.addProduct = dataItems;
                UpdateStoreList();
                Navigation.PushAsync(new CreateTrolli());
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
Exemple #19
0
        public void LoadData(TrollyCreation trollyCreation)
        {
            try
            {
                //   if (e.SelectedItem == null) return;
                //   TrollyCreation trollyDetail = (sender as Button).CommandParameter as TrollyCreation;
                ObservableCollection <ListProduct> dataItems = new ObservableCollection <ListProduct>();

                ObservableCollection <ListStores> listStores = new ObservableCollection <ListStores>();
                SharedUserData.addProduct = null;
                string trollyData = "[" + trollyCreation.trollyDetail + "]";
                List <Dictionary <string, object> > posts = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(trollyData);
                //   listView.ItemsSource = posts;

                bool check = true;
                foreach (Dictionary <string, object> i in posts)
                {
                    ListProduct ob = new ListProduct()
                    {
                        detailItem  = Convert.ToString(i["detailItem"]),
                        description = Convert.ToString(i["description"]),
                        items       = Convert.ToString(i["items"]),
                        quantity    = Convert.ToInt32(i["quantity"]),
                        size        = Convert.ToString(i["size"]),
                        store       = Convert.ToString(i["store"]),
                        storeSuburb = Convert.ToString(i["storeSuburb"]),
                        unit        = Convert.ToString(i["unit"])
                    };

                    if (check)
                    {
                        listData.Add(ob.store);

                        ListStores listStore = new ListStores()
                        {
                            store       = Convert.ToString(i["store"]),
                            storeSuburb = Convert.ToString(i["storeSuburb"])
                        };
                        listStores.Add(listStore);
                        check = false;
                    }
                    else
                    {
                        if (listData.Contains(ob.store))
                        {
                        }
                        else
                        {
                            listData.Add(ob.store);

                            ListStores listStore = new ListStores()
                            {
                                store       = Convert.ToString(i["store"]),
                                storeSuburb = Convert.ToString(i["storeSuburb"])
                            };
                            listStores.Add(listStore);
                        }
                    }

                    dataItems.Add(ob);
                }

                List <ListStores> listViewStore = new List <ListStores>();

                if (listStores != null)
                {
                    foreach (ListStores listStore in listStores)
                    {
                        int counter = 0;
                        foreach (ListProduct listData in dataItems)
                        {
                            if (listData.store == listStore.store)
                            {
                                counter++;
                            }
                        }
                        ListStores listStorez = new ListStores()
                        {
                            store       = listStore.store,
                            storeSuburb = listStore.storeSuburb,
                            storeDetail = listStore.store + " (" + counter + " Items)"
                        };

                        listViewStore.Add(listStorez);
                    }

                    //  SharedUserData.listStore = listStores;
                }
                listView.ItemsSource = listViewStore;
            }

            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
        public void AddStore(Object sender, EventArgs e)
        {
            //  Navigation.PushModalAsync(new StoresAdd());
            try
            {
                string storeNamee = autoComplete.Text;

                if (storeNamee == "")
                {
                    DisplayAlert("", "Please Select any Store", "Ok");
                }
                else
                {
                    bool checkStoress = true;
                    foreach (ListStores list in lists)
                    {
                        if (storeNamee == list.store)
                        {
                            checkStoress = false;
                        }
                    }

                    if (check == 1) // True, When user Update the Store Name
                    {
                        if (checkStoress)
                        {
                            /*    ObservableCollection<ListStores> listStores = SharedUserData.listStore;
                             *  ObservableCollection<ListProduct> listProducts = SharedUserData.addProduct;
                             *
                             *  AbsoluteLayout relative = (AbsoluteLayout)b.ParentView; //Change var into AbsoluteLayout
                             *
                             *
                             *  //   Button b2 = (Button)sender; //Change var into Button
                             *
                             *  //   AbsoluteLayout relative2 = (AbsoluteLayout)b2.ParentView; //Change var into AbsoluteLayout
                             *  //   SfAutoComplete viewEntry1 = // (SfAutoComplete)relative.Children[2]; //Change var into SfAutoComplete
                             *  //   Entry viewEntry2 = (Entry)relative.Children[3]; //Change var into Entry
                             *
                             *  //  Label labelStore1 = (Label)relative.Children[0]; //Change var into Label
                             *  // labelStore1.IsVisible = false;
                             *
                             *  //  Label labelStore2 = (Label)relative.Children[1]; //Change var into Label
                             *  //  labelStore2.IsVisible = false;
                             *
                             *
                             *  foreach (ListStores list in listStores)
                             *  {
                             *      if (updateStore.Contains(list.store))
                             *      {
                             *          list.store = autoComplete.Text;
                             *
                             *          //  Label labelStore1 = (Label)relative.Children[0];
                             *
                             *          //  labelStore1.Text = autoComplete.Text;
                             *
                             *          if (storesSuburb.Text == "")
                             *          {
                             *              list.storeSuburb = "(No Suburbs)";
                             *
                             *          }
                             *          else
                             *          {
                             *              list.storeSuburb = storesSuburb.Text;
                             *          }
                             *      }
                             *  }
                             *
                             *  if (listProducts != null)
                             *  {
                             *      foreach (ListProduct listProduct in listProducts)
                             *      {
                             *          if (updateStore.Contains(listProduct.store))
                             *          {
                             *              listProduct.store = autoComplete.Text;
                             *
                             *              listProduct.detailItem = listProduct.quantity + " " + listProduct.unit + " " + listProduct.items + " " + listProduct.size + " FROM " + autoComplete.Text;
                             *
                             *          }
                             *      }
                             *  }
                             *  SharedUserData.listStore = listStores;
                             *  SharedUserData.addProduct = listProducts;
                             *  b = null;
                             *  //viewEntry1.IsVisible = false;
                             *  // labelStore1.IsVisible = true;
                             *  //labelStore2.IsVisible = true;
                             */
                            ObservableCollection <ListStores>  listStores   = SharedUserData.listStore; //Change ObservableCollection into List
                            ObservableCollection <ListProduct> listProducts = SharedUserData.addProduct;


                            foreach (ListStores list in listStores)
                            {
                                if (updateStoreName.Contains(list.store))
                                {
                                    list.store = autoComplete.Text;
                                    if (storesSuburb.Text == "")
                                    {
                                        list.storeSuburb = "(No Suburbs)";
                                    }
                                    else
                                    {
                                        list.storeSuburb = storesSuburb.Text;
                                    }
                                }
                            }

                            if (listProducts != null)
                            {
                                foreach (ListProduct listProduct in listProducts)
                                {
                                    if (updateStoreName.Contains(listProduct.store))
                                    {
                                        listProduct.store = autoComplete.Text;

                                        listProduct.detailItem = listProduct.quantity + " " + listProduct.unit + " " + listProduct.items + " " + listProduct.size + " FROM " + autoComplete.Text;
                                    }
                                }
                            }
                            SharedUserData.listStore  = listStores;
                            SharedUserData.addProduct = listProducts;
                            //  viewEntry1.IsVisible = false;
                            //  labelStore1.IsVisible = true;
                            //  labelStore2.IsVisible = true;
                            ItemsCount();
                            //  listView.ItemsSource = null;
                            //  listView.ItemsSource = SharedUserData.listStore;

                            string trolliTitleVar = trolliTitle.Text;
                            if (trolliTitleVar == "")
                            {
                                Navigation.PushModalAsync(new AddProduct(autoComplete.Text, storesSuburb.Text, 0, "", rewardCardSelection), true);
                            }
                            else
                            {
                                Navigation.PushModalAsync(new AddProduct(autoComplete.Text, storesSuburb.Text, 0, trolliTitleVar, rewardCardSelection), true);
                            }
                        }
                        else
                        {
                            DisplayAlert("", "The Store is already exist in below list", "Ok");
                        }
                        check             = 0;
                        addStore.Text     = "Add Store";
                        autoComplete.Text = "";
                        storesSuburb.Text = "";
                    }

                    else
                    {
                        if (SharedUserData.listStore == null)
                        {
                        }
                        else
                        {
                            lists = SharedUserData.listStore;
                        }

                        string storeName   = autoComplete.Text;
                        bool   checkStores = true;
                        foreach (ListStores list in lists)
                        {
                            if (storeName == list.store)
                            {
                                checkStores = false;
                            }
                        }

                        if (checkStores)
                        {
                            string storeSuburbs = "(No Suburb)";
                            if (storesSuburb.Text == "")
                            {
                                storesSuburb.Text = "(No Suburb)";
                            }
                            else
                            {
                                storeSuburbs = storesSuburb.Text;
                            }
                            ListStores listData = new ListStores()
                            {
                                store       = storeName,
                                storeSuburb = storeSuburbs,
                                storeDetail = storeName + " (0 Items)",
                                rewardCard  = rewardCardSelection
                            };

                            lists.Add(listData);
                            SharedUserData.listStore = lists;


                            listView.ItemsSource = null;
                            listView.ItemsSource = SharedUserData.listStore;

                            string trolliTitleVar = trolliTitle.Text;
                            if (trolliTitleVar == "")
                            {
                                Navigation.PushModalAsync(new AddProduct(storeName, storesSuburb.Text, 0, "", rewardCardSelection), true);
                            }
                            else
                            {
                                Navigation.PushModalAsync(new AddProduct(storeName, storesSuburb.Text, 0, trolliTitleVar, rewardCardSelection), true);
                            }
                        }
                        else
                        {
                            DisplayAlert("", "The Store is already exist in below list", "Ok");
                        }

                        autoComplete.Text = "";
                        storesSuburb.Text = "";
                        if (listView.ItemsSource == null)
                        {
                            //  listValidationText.Text = "There is no Selected Stroes";
                        }
                        else
                        {
                            //   listValidationText.Text = "";
                        }
                    }
                }
                scheduleButtonEnable();
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }
Exemple #21
0
        public void CloneHandle(Object sender, EventArgs e)
        {
            try
            {
                //   if (e.SelectedItem == null) return;
                TrollyCreation trollyDetail = (sender as Button).CommandParameter as TrollyCreation;
                ObservableCollection <ListProduct> dataItems = new ObservableCollection <ListProduct>();

                ObservableCollection <ListStores> listStores = new ObservableCollection <ListStores>();
                SharedUserData.addProduct = null;
                string trollyData = "[" + trollyDetail.trollyDetail + "]";
                List <Dictionary <string, object> > posts = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(trollyData);
                //   listView.ItemsSource = posts;

                bool check = true;
                foreach (Dictionary <string, object> i in posts)
                {
                    ListProduct ob = new ListProduct()
                    {
                        detailItem  = Convert.ToString(i["detailItem"]),
                        description = Convert.ToString(i["description"]),
                        items       = Convert.ToString(i["items"]),
                        quantity    = Convert.ToInt32(i["quantity"]),
                        size        = Convert.ToString(i["size"]),
                        store       = Convert.ToString(i["store"]),
                        storeSuburb = Convert.ToString(i["storeSuburb"]),
                        unit        = Convert.ToString(i["unit"])
                    };

                    if (check)
                    {
                        listData.Add(ob.store);

                        ListStores listStore = new ListStores()
                        {
                            store       = Convert.ToString(i["store"]),
                            storeSuburb = Convert.ToString(i["storeSuburb"])
                        };
                        listStores.Add(listStore);
                        check = false;
                    }
                    else
                    {
                        if (listData.Contains(ob.store))
                        {
                        }
                        else
                        {
                            listData.Add(ob.store);

                            ListStores listStore = new ListStores()
                            {
                                store       = Convert.ToString(i["store"]),
                                storeSuburb = Convert.ToString(i["storeSuburb"])
                            };
                            listStores.Add(listStore);
                        }
                    }

                    dataItems.Add(ob);
                }

                //  SharedUserData.listStore = listStores;


                SharedUserData.addProduct = dataItems;
                UpdateStoreList();


                if (trollyDetail.status == "Draft")
                {
                    TrollyCreation trolly = new TrollyCreation
                    {
                        createdDate          = trollyDetail.createdDate,
                        lastModifiedDate     = DateTime.Now.ToString("dd/MM/yyyy"),
                        trollyTitle          = trollyDetail.trollyTitle,
                        trollyDetail         = trollyDetail.trollyDetail,
                        trolliId             = trollyDetail.trolliId,
                        clientId             = trollyDetail.clientId,//Convert.ToString(userData["UniqueID"]),
                        status               = "Draft",
                        deliveryDateTime     = trollyDetail.deliveryDateTime,
                        assigneeId           = " ",
                        clientNotificationId = trollyDetail.clientNotificationId,
                        SBNotificationId     = " "
                    };

                    SharedUserData.draftRecord = trolly;
                }

                Navigation.PushAsync(new CreateTrolli());
            }
            catch (Exception ex)
            {
                DisplayAlert("", ExceptionManagement.LogException(ex), "Ok");
            }
        }