Exemplo n.º 1
0
        private void cmdAddressDelete_Click(object sender, RoutedEventArgs e)
        {
            MEntityAddress pp = (MEntityAddress)(sender as Button).Tag;

            mv.RemoveAddressItem(pp);
            mv.IsModified = true;
        }
        private Boolean validateAddress <T>(ObservableCollection <T> collection, TabItem titem) where T : MBaseModel
        {
            int idx = 0;

            foreach (MBaseModel c in collection)
            {
                idx++;
                MEntityAddress bi = (MEntityAddress)c;

                if (bi.AddressType.Equals(""))
                {
                    CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null);
                    titem.IsSelected = true;

                    return(false);
                }

                if (bi.Address.Equals(""))
                {
                    CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null);
                    titem.IsSelected = true;

                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
        private void loadFileEntity()
        {
            loader.ProcessFile();

            ArrayList arr = loader.GetRows();
            int       cnt = 0;

            foreach (MEntity en in arr)
            {
                cnt++;

                en.EntityType  = "1";
                en.EntityGroup = "3";
                en.Category    = "1";
                en.WebSite     = en.ContactBy + "|" + en.NamePrefixDesc;

                if (!en.Phone.Equals(""))
                {
                    en.Phone = en.Phone + "," + en.MobilePhone;
                }
                else
                {
                    en.Phone = en.MobilePhone;
                }

                en.AddAddress();

                MEntityAddress ea = en.AddressItems[0];
                ea.Address     = en.EntityAddress;
                ea.AddressType = "16";
                ea.ExtFlag     = "A";

                OnixWebServiceAPI.CreateEntity(en.GetDbObject());

                importStatusUpdate(cnt, arr.Count);
            }

            importStatusUpdate(cnt, arr.Count);
        }