Пример #1
0
        private void attachToOrgButton_Click(object sender, EventArgs e)
        {
            DataRowView curPersonRow = _personBS.Current as DataRowView;

            if (curPersonRow == null)
            {
                MainForm.ShowInfoMessage("Необходимо выбрать запись!", "Внимание");
                return;
            }
            AnketaPersonOrgForm tmpform = new AnketaPersonOrgForm(curPersonRow.Row, _operator, _org.idVal, _connection);

            tmpform.FormClosed += new FormClosedEventHandler(AnketaPersonOrgForm_FormClosed);
            tmpform.Owner       = this;
            tmpform.ShowDialog(this);
        }
Пример #2
0
 private void AnketaPersonOrgForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (sender != null)
     {
         if (sender is AnketaPersonOrgForm)
         {
             AnketaPersonOrgForm tmpForm = sender as AnketaPersonOrgForm;
             if (tmpForm.DialogResult == DialogResult.OK)
             {
                 if (_personBS.Current != null)
                 {
                     long personID = (long)(_personBS.Current as DataRowView)[PersonView.id];
                     _personTable.Rows.Clear();
                     _personAdapter.Fill(_personTable);
                     _personBS.Position = _personBS.Find(PersonInfo.id, personID);
                 }
             }
         }
     }
 }