示例#1
0
        private void btnAddRegion_Click(object sender, EventArgs e)
        {
            using (RegionSelectForm frm = new RegionSelectForm())
            {
                frm.ExcludeIds(_RegionBindList.GetIds());

                frm.ShowDialog();
                if (frm.DialogResult == DialogResult.OK)
                {
                    List <Domain.Region> regions = frm.SelectedRegions;
                    if (regions != null)
                    {
                        foreach (Domain.Region region in regions)
                        {
                            object exist = _RegionBindList.GetItemByID(region.ID);

                            if (null == exist)
                            {
                                _RegionBindList.Add(region);
                                Modified         = true;
                                _RegionsModified = true;
                            }
                        }
                    }
                }
            }
        }
示例#2
0
 private void btnAddCountry_Click(object sender, EventArgs e)
 {
     using (CountrySelectFrm frm = new CountrySelectFrm())
     {
         frm.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             foreach (Domain.Country country in frm.SelectedCountries)
             {
                 if (_CountryBindList.GetItemByID(country.ID) == null)
                 {
                     _CountryBindList.Add(country);
                     Modified           = true;
                     _CountriesModified = true;
                 }
             }
         }
     }
 }
示例#3
0
 private void BindStores()
 {
     if (UserEntity != null)
     {
         _StoreBindList = new RelationBindingList <Store>();
         if (!UserEntity.IsNew)
         {
             IList <Store> lst = ClientEnvironment.UserService.GetUserStores(UserEntity.ID);
             if ((lst != null) && (lst.Count > 0))
             {
                 foreach (Store store in lst)
                 {
                     _StoreBindList.Add(store);
                 }
             }
         }
         lbStores.DataSource = _StoreBindList;
     }
 }
示例#4
0
 private void BindRegions()
 {
     if (UserEntity != null)
     {
         _RegionBindList = new RelationBindingList <Domain.Region>();
         if (!UserEntity.IsNew)
         {
             IList <Domain.Region> lst = ClientEnvironment.UserService.GetUserRegions(UserEntity.ID);
             if ((lst != null) && (lst.Count > 0))
             {
                 foreach (Domain.Region region in lst)
                 {
                     _RegionBindList.Add(region);
                 }
             }
         }
         lbRegions.DataSource = _RegionBindList;
     }
 }
示例#5
0
 private void btnAddStore_Click(object sender, EventArgs e)
 {
     using (StoreSelectFrm frm = new StoreSelectFrm())
     {
         frm.ShowDialog();
         if (frm.DialogResult == DialogResult.OK)
         {
             List <Store> stores = frm.SelectedStores;
             foreach (Store store in stores)
             {
                 if (_StoreBindList.GetItemByID(store.ID) == null)
                 {
                     _StoreBindList.Add(store);
                     Modified        = true;
                     _StoresModified = true;
                 }
             }
         }
     }
 }
示例#6
0
        private void BindCountries()
        {
            if (UserEntity != null)
            {
                if (!UserEntity.IsNew)
                {
                    _CountryBindList = new RelationBindingList <Domain.Country>();
                    IList <Domain.Country> lst = ClientEnvironment.UserService.GetUserCountries(UserEntity.ID);
                    if ((lst != null) && (lst.Count > 0))
                    {
                        foreach (Domain.Country country in lst)
                        {
                            _CountryBindList.Add(country);
                        }
                    }
                }
                else
                {
                    _CountryBindList = new RelationBindingList <Domain.Country>();
                }

                lbCountries.DataSource = _CountryBindList;
            }
        }
示例#7
0
 private void BindStores()
 {
     if (UserEntity != null)
     {
         _StoreBindList = new RelationBindingList<Store>();
         if (!UserEntity.IsNew)
         {
             IList<Store> lst = ClientEnvironment.UserService.GetUserStores(UserEntity.ID);
             if ((lst != null) && (lst.Count > 0))
             {
                 foreach (Store store in lst)
                 {
                     _StoreBindList.Add(store);
                 }
             }
         }
         lbStores.DataSource = _StoreBindList;
     }
 }
示例#8
0
 private void BindRegions()
 {
     if (UserEntity != null)
     {
         _RegionBindList = new RelationBindingList<Domain.Region>();
         if (!UserEntity.IsNew)
         {
             IList<Domain.Region> lst = ClientEnvironment.UserService.GetUserRegions(UserEntity.ID);
             if ((lst != null) && (lst.Count > 0))
             {
                 foreach (Domain.Region region in lst)
                 {
                     _RegionBindList.Add(region);
                 }
             }
         }
         lbRegions.DataSource = _RegionBindList;
     }
 }
示例#9
0
        private void BindCountries()
        {
            if (UserEntity != null)
            {
                if (!UserEntity.IsNew)
                {
                    _CountryBindList = new RelationBindingList<Domain.Country>();
                    IList<Domain.Country> lst = ClientEnvironment.UserService.GetUserCountries(UserEntity.ID);
                    if ((lst != null) && (lst.Count > 0))
                    {
                        foreach (Domain.Country country in lst)
                        {
                            _CountryBindList.Add(country);
                        }
                    }
                }
                else
                {
                    _CountryBindList = new RelationBindingList<Domain.Country>();
                }

                lbCountries.DataSource = _CountryBindList;
            }
        }