Exemplo n.º 1
0
        private void addLec_Click(object sender, EventArgs e)
        {
            Lecturer lecturer = new Lecturer();

            if (eidtxt.Text.Length != 6)
            {
            }
            else
            {
                lecturer.lecName    = nametxt.Text;
                lecturer.eid        = eidtxt.Text;
                lecturer.faculty    = factxt.Text;
                lecturer.department = depttxt.Text;
                lecturer.center     = centertxt.Text;
                lecturer.buildng    = buildingtxt.Text;
                lecturer.level      = leveltxt.Text;
                lecturer.rank       = ranktxt.Text;

                ranktxt.Text = lecturer.level + "." + lecturer.eid;

                LectureController leccrl = new LectureController();
                leccrl.insertLecturerDetails(lecturer);

                nametxt.Text     = "";
                eidtxt.Text      = "";
                factxt.Text      = "";
                depttxt.Text     = "";
                centertxt.Text   = "";
                buildingtxt.Text = "";
                leveltxt.Text    = "";
                ranktxt.Text     = "";

                lecturerTble.DataSource = leccrl.getdatatoTable();
            }
        }
Exemplo n.º 2
0
        public LecturerForm()
        {
            InitializeComponent();
            LectureController lectureController = new LectureController();

            lecturerTble.DataSource = lectureController.getdatatoTable();
            //lecturerTble.DataBindings();
        }
Exemplo n.º 3
0
        private void editLec_Click(object sender, EventArgs e)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.lecName    = nametxt.Text;
            lecturer.eid        = eidtxt.Text;
            lecturer.faculty    = factxt.Text;
            lecturer.department = depttxt.Text;
            lecturer.center     = centertxt.Text;
            lecturer.buildng    = buildingtxt.Text;
            lecturer.level      = leveltxt.Text;
            lecturer.rank       = ranktxt.Text;

            ranktxt.Text = lecturer.level + "." + lecturer.eid;

            LectureController ctrl = new LectureController();

            ctrl.UpdateLecturer(lecturer);

            lecturerTble.DataSource = ctrl.getdatatoTable();
        }
Exemplo n.º 4
0
        private void editLec_Click(object sender, EventArgs e)
        {
            if (nametxt.Text != "" && eidtxt.Text != "" && factxt.Text != "" && depttxt.Text != "" && centertxt.Text != "" && buildingtxt.Text != "" && leveltxt.Text != "" && ranktxt.Text != "")
            {
                Lecturer lecturer = new Lecturer();

                lecturer.lecName    = nametxt.Text;
                lecturer.eid        = eidtxt.Text;
                lecturer.faculty    = factxt.Text;
                lecturer.department = depttxt.Text;
                lecturer.center     = centertxt.Text;
                lecturer.buildng    = buildingtxt.Text;
                lecturer.level      = leveltxt.Text;
                lecturer.rank       = ranktxt.Text;

                ranktxt.Text = lecturer.level + "." + lecturer.eid;

                LectureController ctrl = new LectureController();
                ctrl.UpdateLecturer(lecturer);

                nametxt.Text     = "";
                eidtxt.Text      = "";
                factxt.Text      = "";
                depttxt.Text     = "";
                centertxt.Text   = "";
                buildingtxt.Text = "";
                leveltxt.Text    = "";
                ranktxt.Text     = "";
                eidtxt.ReadOnly  = false;

                lecturerTble.DataSource = ctrl.getdatatoTable();
                addLec.Enabled          = true;
            }
            else
            {
                MessageBox.Show("Please Fill the all the required fields ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
        private void delLec_Click(object sender, EventArgs e)
        {
            Lecturer lecturer = new Lecturer();

            lecturer.eid = eidtxt.Text;

            LectureController lectureController = new LectureController();

            lectureController.DeleteLecturer(lecturer);

            nametxt.Text     = "";
            eidtxt.Text      = "";
            factxt.Text      = "";
            depttxt.Text     = "";
            centertxt.Text   = "";
            buildingtxt.Text = "";
            leveltxt.Text    = "";
            ranktxt.Text     = "";
            eidtxt.ReadOnly  = false;


            lecturerTble.DataSource = lectureController.getdatatoTable();
        }