private void SaveNewKin()
 {
     foreach (Kin k in listRelatives)
     {
         kin           = k;
         kin.idStudent = student.idStudent;
         SaveKin();
     }
 }
 private void bAddKin_Click(object sender, EventArgs e)
 {
     kin = new Kin();
     tbPlaceEmployment.Text        = null;
     tbFIOKin.Text                 = null;
     maskedTextBoxKinPhone.Text    = null;
     kin.disabilityKin             = false;
     listBoxKinStatus.SelectedItem = listBoxKinStatus.Items[0];
     panelRelatives.Visible        = true;
 }
 public StudentForm(int idGroup)
 {
     InitializeComponent();
     student                       = new Student();
     residence                     = new Residence();
     residenceTemp                 = new Residence();
     kin                           = new Kin();
     family                        = new Family();
     student.idGroup               = idGroup;
     comboBoxLang.DataSource       = DBobjects.Entities.Language.ToList();
     dateTimePickerDateBirth.Value = DateTime.Now;
     dateTimePickerLern.Value      = DateTime.Now;
     listRelatives                 = new List <Kin>();
     this.MaximumSize              = Screen.PrimaryScreen.WorkingArea.Size;
 }
 private void dgvKin_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         bDeleteKin.Visible     = true;
         panelRelatives.Visible = true;
         kin           = (Kin)dgvKin.Rows[e.RowIndex].DataBoundItem;
         tbFIOKin.Text = kin.fullNameKin;
         listBoxKinStatus.SelectedItem = kin.kinStatus;
         maskedTextBoxKinPhone.Text    = kin.telephoneKin;
         if (kin.disabilityKin == true)
         {
             radioButtonInvKinT.Checked = true;
         }
         else
         {
             radioButtonInvKinF.Checked = true;
         }
         tbPlaceEmployment.Text = kin.placeOfWorkKin;
     }
 }