Ejemplo n.º 1
0
        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!");
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }