private void cmdModify_Click(object sender, EventArgs e) { fInsert Insert; Insert = new fInsert(); if (lsvTeachers.SelectedItems.Count > 0) { Teacher teacher = (Teacher)lsvTeachers.SelectedItems[0].Tag; Insert.txtFirstName.Text = teacher.FirstName; Insert.txtSecondName.Text = teacher.SecondName; Insert.txtPassword.Text = teacher.Password; Insert.dtpBirthDate.Value = teacher.BirthDate; Insert.ShowDialog(); if (Insert.bOk == true) { teacher.FirstName = Insert.UserProperties.FirstName; teacher.SecondName = Insert.UserProperties.SecondName; teacher.BirthDate = Insert.UserProperties.BirthDate; teacher.Password = Insert.UserProperties.Password; teacher.SaveAsync(); ShowTeachers(); } } else { MessageBox.Show("Seleziona un record!"); } }
private void cmdInsert_Click(object sender, EventArgs e) { fInsert Insert; Insert = new fInsert(); Insert.ShowDialog(); if (Insert.bOk == true) { Teacher newTeacher = new Teacher(Insert.UserProperties); newTeacher.SaveAsync(); ShowTeachers(); } }
private void cmdInsertA_Click(object sender, EventArgs e) { fInsert Insert; Insert = new fInsert(); Insert.ShowDialog(); if (Insert.bOk == true) { Administrator newAdmin = new Administrator(Insert.UserProperties); newAdmin.SaveAsync(); ShowAdministrators(); } }