private void SetData(object sender, PropertyChangedEventArgs e)
        {
            if (_socketManager.ServerResponse.RequestTarget == "members")
            {
                Data = JsonConvert.DeserializeObject <ObservableCollection <Member> >(
                    _socketManager.ServerResponse.RequestContent.ToString());
            }

            if (_socketManager.ServerResponse.RequestTarget == "clubs")
            {
                AllClubs = JsonConvert.DeserializeObject <ObservableCollection <Club> >(
                    _socketManager.ServerResponse.RequestContent.ToString());

                Clubs.Clear();
            }

            if (_socketManager.ServerResponse.RequestTarget == "sports")
            {
                AllSports = JsonConvert.DeserializeObject <ObservableCollection <Sport> >(
                    _socketManager.ServerResponse.RequestContent.ToString());

                Sports.Clear();
                foreach (Sport s in AllSports)
                {
                    Sports.Add(s);
                }
            }
        }
Esempio n. 2
0
 private void FillSports()
 {
     Sports.Clear();
     foreach (var item in db.Sports.ToList())
     {
         Sports.Add(item);
     }
     SportCount = Sports.Count;
 }
        private async void GetSports()
        {
            var data = await new SportDataService().GetSportsAsync();

            Sports.Clear();
            foreach (var item in data)
            {
                Sports.Add(item);
            }
        }
Esempio n. 4
0
        public void Update()
        {
            IEnumerable <string> sportNames = facade.GetAll();

            Sports.Clear();
            foreach (string sportName in sportNames)
            {
                Sports.Add(sportName);
            }

            RaisePropertyChangedEvent("SelectedSport");
        }
 private void ClearFields()
 {
     Member = new Member();
     MemberClubs.Clear();
     MemberSports.Clear();
     Clubs.Clear();
     Sports.Clear();
     foreach (Sport s in AllSports)
     {
         Sports.Add(s);
     }
 }
Esempio n. 6
0
 private void CanCelData()
 {
     CB_Soko.SelectedIndex    = 1;
     CB_year.Text             = string.Empty;
     CB_OrderAttentionCD.Text = string.Empty;
     CB_ReserveCD.Text        = String.Empty;
     CB_PostageCD.Text        = String.Empty;
     CB_Season.Text           = string.Empty;
     CB_NoticesCD.Text        = string.Empty;
     CB_Tagu1.Text            = String.Empty;
     CB_Tagu2.Text            = String.Empty;
     CB_Tagu3.Text            = String.Empty;
     CB_Tagu4.Text            = String.Empty;
     CB_Tagu5.Text            = String.Empty;
     TB_item.Text             = string.Empty;
     TB_mekashohinCD.Text     = string.Empty;
     TB_Bikokeyword.Text      = string.Empty;
     TB_mekashohinCD.Text     = string.Empty;
     TB_Catalog.Text          = string.Empty;
     TB_item.Text             = string.Empty;
     TB_Shijishobengo.Text    = string.Empty;
     TB_ShinkitorokuF.Text    = String.Empty;
     TB_ShinkitorokuT.Text    = string.Empty;
     TB_Shohinmei.Text        = string.Empty;
     TB_ShoninbiF.Text        = string.Empty;
     TB_ShoninbiT.Text        = string.Empty;
     TB_RackNoF.Text          = string.Empty;
     TB_RackNoT.Text          = string.Empty;
     TB_SaiShuhenkobiF.Text   = string.Empty;
     TB_SaiShuhenkobiT.Text   = String.Empty;
     jan.Clear();
     sku.Clear();
     Shiiresaki.Clear();
     SearchBrand.Clear();
     Maker.Clear();
     Sports.Clear();
     ckM_RB_or.Checked        = true;
     ckM_RB_and.Checked       = false;
     ckM_CKB_Mishohin.Checked = false;
     ckM_CKB_suru.Checked     = false;
     CKB_searchsuru.Checked   = false;
     RB_item.Checked          = false;
     RB_Makashohincd.Checked  = false;
     CB_Soko.Focus();
     GV_Zaiko.DataSource = null;
     dtData.Clear();
 }
        private void ListView_ItemSelection(object sender, SelectionChangedEventArgs e)
        {
            var item = (sender as ListView).SelectedItem as Member;

            if (item != null)
            {
                Member       = item as Member;
                MemberClubs  = new ObservableCollection <Club>();
                MemberSports = new ObservableCollection <Sport>();
                Clubs.Clear();
                Sports.Clear();
                foreach (Sport s in AllSports)
                {
                    Sports.Add(s);
                }

                foreach (Club club in Member.Clubs)
                {
                    MemberClubs.Add(club);
                }

                foreach (Sport sport in Member.Sports)
                {
                    MemberSports.Add(sport);
                    foreach (Club c in sport.Clubs)
                    {
                        Clubs.Add(c);
                    }
                }

                foreach (Club club in MemberClubs)
                {
                    var filteredClub = Clubs.FirstOrDefault(c => c.Id == club.Id);
                    Clubs.Remove(filteredClub);
                }

                foreach (Sport sport in MemberSports)
                {
                    var filteredSport = AllSports.FirstOrDefault(s => s.Id == sport.Id);
                    Sports.Remove(filteredSport);
                }
            }
        }