Exemplo n.º 1
0
        private void addSt_Click(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter    userAdp = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.studentsTableAdapter stAdp   = new DataSet1TableAdapters.studentsTableAdapter();
            userAdp.addUser(userName.Text, userPass.Text, userType.Text);
            int?id = (int?)userAdp.getUserID(userName.Text);

            stAdp.addStudent(id, FName.Text, LName.Text);
        }
Exemplo n.º 2
0
        private void editSecretary_Click(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter       userAdo = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.secretariesTableAdapter secAdp  = new DataSet1TableAdapters.secretariesTableAdapter();
            int?id = (int?)userAdo.getUserID(userName.Text);

            secAdp.UpdateSec(FName.Text, LName.Text, (int)id);
            MessageBox.Show("modified successfully");
            updateSec();
        }
Exemplo n.º 3
0
        private void editTeacher_Click(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter    userAdo = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.trainersTableAdapter traAdp  = new DataSet1TableAdapters.trainersTableAdapter();
            int?id = (int?)userAdo.getUserID(userName.Text);

            traAdp.UpdateTrainer(FName.Text, LName.Text, Class.Text, (int)id);
            MessageBox.Show("modified successfully");
            updateTr();
        }
Exemplo n.º 4
0
        private void deleteTeacher_Click(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter    userAdo = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.trainersTableAdapter traAdp  = new DataSet1TableAdapters.trainersTableAdapter();
            int?id = (int?)userAdo.getUserID(userName.Text);

            traAdp.DeleteTrainer(id);
            userAdo.DeleteUser((int)id);
            MessageBox.Show("Deleted successfully");
            updateTr();
        }
Exemplo n.º 5
0
        private void editStudent_Click(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter    userAdo = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.studentsTableAdapter stAdp   = new DataSet1TableAdapters.studentsTableAdapter();
            int?id = (int?)userAdo.getUserID(userName.Text);

            stAdp.UpdateStudent(FName.Text, LName.Text, Class.Text, (int)id);
            MessageBox.Show("modified successfully");
            updateCsRecords();
            updateFBRecords();
            updateJee();
        }
Exemplo n.º 6
0
        private void deleteStudent_Click_1(object sender, RoutedEventArgs e)
        {
            DataSet1TableAdapters.usersTableAdapter    userAdo = new DataSet1TableAdapters.usersTableAdapter();
            DataSet1TableAdapters.studentsTableAdapter stAdp   = new DataSet1TableAdapters.studentsTableAdapter();
            int?id = (int?)userAdo.getUserID(userName.Text);

            stAdp.DeleteStudent(id);
            userAdo.DeleteUser((int)id);
            MessageBox.Show("Deleted successfully");
            updateCsRecords();
            updateFBRecords();
            updateJee();
        }
Exemplo n.º 7
0
        //Implemented buttons

        private void addSecretary_Click_1(object sender, RoutedEventArgs e)
        {
            if (userName.Text == string.Empty || userPass.Text == string.Empty || FName.Text == string.Empty || LName.Text == string.Empty)
            {
                MessageBox.Show("Something missing, please retry");
                return;
            }
            else
            {
                DataSet1TableAdapters.usersTableAdapter       userAdp = new DataSet1TableAdapters.usersTableAdapter();
                DataSet1TableAdapters.secretariesTableAdapter secAdp  = new DataSet1TableAdapters.secretariesTableAdapter();
                userAdp.addUser(userName.Text, userPass.Text, "secretary");
                int?id = (int?)userAdp.getUserID(userName.Text);
                secAdp.addSecretary(id, FName.Text, LName.Text);
                MessageBox.Show("Added successfully");
            }
            updateSec();
        }
Exemplo n.º 8
0
        //Implemented Buttons

        private void addTeacher_Click(object sender, RoutedEventArgs e)
        {
            if (userName.Text == string.Empty || userPass.Text == string.Empty || FName.Text == string.Empty || LName.Text == string.Empty || Class.Text == string.Empty)
            {
                MessageBox.Show("Something missing, please retry");
                return;
            }
            else
            {
                DataSet1TableAdapters.usersTableAdapter    userAdp = new DataSet1TableAdapters.usersTableAdapter();
                DataSet1TableAdapters.trainersTableAdapter trAdp   = new DataSet1TableAdapters.trainersTableAdapter();
                userAdp.addUser(userName.Text, userPass.Text, "trainer");
                int?id = (int?)userAdp.getUserID(userName.Text);
                trAdp.addTrainer(id, FName.Text, LName.Text, Class.Text);
                MessageBox.Show("Added successfully");
            }
            updateTr();
        }
Exemplo n.º 9
0
 //Implemented Buttons
 private void addStudent_Click(object sender, RoutedEventArgs e)
 {
     if (userName.Text == string.Empty || userPass.Text == string.Empty || FName.Text == string.Empty || LName.Text == string.Empty || Class.Text == string.Empty)
     {
         MessageBox.Show("Something missing, please retry");
         return;
     }
     else
     {
         DataSet1TableAdapters.usersTableAdapter    userAdp = new DataSet1TableAdapters.usersTableAdapter();
         DataSet1TableAdapters.studentsTableAdapter stAdp   = new DataSet1TableAdapters.studentsTableAdapter();
         userAdp.addUser(userName.Text, userPass.Text, "student");
         int?id = (int?)userAdp.getUserID(userName.Text);
         stAdp.AddStudent(id, FName.Text, LName.Text, Class.Text);
         MessageBox.Show("Added successfully");
     }
     updateCsRecords();
     updateFBRecords();
     updateJee();
 }