Esempio n. 1
0
        private void butOK_Click(object sender, EventArgs e)
        {
            //PatNumChild already set
            //PatNumGuardian already set
            _guardianCur.IsGuardian = checkIsGuardian.Checked;
            string        relatName = comboRelationship.Items[comboRelationship.SelectedIndex].ToString();
            List <string> listRelationshipNamesRaw = new List <string>(Enum.GetNames(typeof(GuardianRelationship)));

            _guardianCur.Relationship = (GuardianRelationship)listRelationshipNamesRaw.IndexOf(relatName);
            if (_guardianCur.IsNew)
            {
                Guardians.Insert(_guardianCur);
            }
            else
            {
                Guardians.Update(_guardianCur);
            }
            DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (GuardianCur.PatNumGuardian == 0)
     {
         MsgBox.Show(this, "Please set a guardian first.");
         return;
     }
     //PatNumChild already set
     //PatNumGuardian already set
     GuardianCur.Relationship = (GuardianRelationship)listRelationship.SelectedIndex;
     if (GuardianCur.IsNew)
     {
         Guardians.Insert(GuardianCur);
     }
     else
     {
         Guardians.Update(GuardianCur);
     }
     DialogResult = DialogResult.OK;
 }