예제 #1
0
        protected void OnButtonAddClicked(object sender, EventArgs e)
        {
            ITdiTab mytab = DialogHelper.FindParentTab(this);

            if (mytab == null)
            {
                return;
            }

            var parentDlg = DialogHelper.FindParentEntityDialog(this);

            if (parentDlg == null)
            {
                return;
            }

            if (parentDlg.UoW.IsNew)
            {
                if (CommonDialogs.SaveBeforeCreateSlaveEntity(parentDlg.EntityObject.GetType(), typeof(Contact)))
                {
                    parentDlg.UoW.Save();
                }
                else
                {
                    return;
                }
            }

            ITdiDialog dlg = new ContactDlg(CounterpartyUoW.Root);

            mytab.TabParent.AddTab(dlg, mytab);
        }
예제 #2
0
        protected void OnButtonEditClicked(object sender, EventArgs e)
        {
            ITdiTab mytab = DialogHelper.FindParentTab(this);

            if (mytab == null)
            {
                return;
            }


            ContactDlg dlg = new ContactDlg(datatreeviewContacts.GetSelectedId());

            mytab.TabParent.AddSlaveTab(mytab, dlg);
        }