public A_editingFlowchart_DepartmentHead(HeadDepartment hd)
        {
            InitializeComponent();
            //this.dep = hd;
            this.dep = new HeadDepartment();
            this.dep = hd;

            label1.Text       = this.dep.getdeparName();
            label2_last.Text  = this.dep.getLastName();
            label2_first.Text = this.dep.getFirstName();

            con = new SqlConnection("Data Source=p17server.database.windows.net;Initial Catalog=P17DATABASE;Persist Security Info=True;User ID=P17;Password=Hadas@2017");

            sda  = new SqlDataAdapter("SELECT num,Year, CourseName, Precourse, Blockscourse,CreditCourseName FROM Asyllabus WHERE DepName = '" + this.dep.getdeparName() + "'", con);
            data = new DataTable();

            data.Columns.Add("num", typeof(int));
            data.Columns.Add("Year", typeof(string));
            data.Columns.Add("CourseName", typeof(string));
            data.Columns.Add("Precourse", typeof(string));
            data.Columns.Add("Blockscourse", typeof(string));
            data.Columns.Add("CreditCourseName", typeof(int));

            sda.Fill(data);
            dataGridView1.DataSource = data;
        }
        public A_DepartmentHead(HeadDepartment hd)   // parametric constructor
        {
            InitializeComponent();

            //this.dep = hd;
            //this.dep = new HeadDepartment();
            this.dep = hd;
        }
示例#3
0
 //private string str;
 public A_DHadd(HeadDepartment hd)
 {
     InitializeComponent();
     //if (strId != null)
     //    this.str = strId;
     //this.dep = strId;
     // this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#4
0
 public Department(int deptID, string deptName)
 {
     this.IDdepartment = deptID;
     this.DeptName     = deptName;
     this.numCourses   = 0;
     this.courses      = null;
     this.numStudents  = 0;
     this.students     = null;
     this.numLectures  = 0;
     this.lecturers    = null;
     this.numTA        = 0;
     this.TAssistant   = null;
     this.DeptHead     = null;
 }
        //private string str;
        public A_addingFlowchart_DepartmentHead(HeadDepartment hd)
        {
            InitializeComponent();
            this.dep = hd;
            //this.dep = new HeadDepartment();
            this.dep = hd;

            label_show.Text = this.dep.getdeparName();
            userName.Text   = this.dep.getFirstName();
            lastname.Text   = this.dep.getLastName();
            comboBox1.Items.Add("a");
            comboBox1.Items.Add("b");
            comboBox1.Items.Add("c");
            comboBox1.Items.Add("d");
        }
 public A_creditsForCourse_DH(HeadDepartment hd)
 {
     InitializeComponent();
     //this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#7
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            bool          login = false;
            SqlConnection cn    = new SqlConnection("Data Source=p17server.database.windows.net;Initial Catalog=P17DATABASE;Persist Security Info=True;User ID=P17;Password=Hadas@2017");

            cn.Open();
            SqlCommand    cmd = new SqlCommand("select * from Users where ID ='" + this.id_text.Text + "' and Password = '******'", cn);
            SqlDataReader dr;

            dr = cmd.ExecuteReader();

            string headDepartment;
            string userType, user_name;
            int    result = 0;

            while (dr.Read())
            {
                login = true;

                userType = dr["Type"].ToString();

                //We dont have Student - therefor we doesnt need to know his type

                if (userType == "2")//for Lecturer Type
                {
                    result = 2;
                    lec    = new Lecturer();
                    lec.setID(int.Parse(dr["ID"].ToString()));
                    lec.setdeparName(dr["Departments"].ToString());
                    lec.setFirstName(dr["FirstName"].ToString());
                    lec.setLastName(dr["LastName"].ToString());
                }

                if (userType == "3")//for Teaching Assitant Type
                {
                    result = 3;
                    ta     = new TeachingAssitant();
                    ta.setID(int.Parse(dr["ID"].ToString()));
                    ta.setdeparName(dr["Departments"].ToString());
                    ta.setFirstName(dr["FirstName"].ToString());
                    ta.setLastName(dr["LastName"].ToString());
                }

                if (userType == "4")//for Head Department Type
                {
                    result         = 4;
                    dh             = new HeadDepartment();
                    headDepartment = dr["ID"].ToString();
                    dh.setID(int.Parse(headDepartment));
                    dh.setdeparName(dr["Departments"].ToString());
                    dh.setFirstName(dr["FirstName"].ToString());
                    dh.setLastName(dr["LastName"].ToString());
                }

                if (userType == "5")//for Secretary Type
                {
                    result = 5;
                }
            }
            dr.Close();
            cn.Close();

            if (login)
            {
                //MessageBox.Show("Connect SUCCESSFULY");

                if (result == 2)// in case user is Lecturer
                {
                    this.Hide();
                    A_LecturerMenu lec = new A_LecturerMenu(this.lec);

                    lec.ShowDialog();
                }

                if (result == 3)//in case user is Teaching Assitant
                {
                    this.Hide();
                    A_TeachingAssistant ta = new A_TeachingAssistant(this.ta);
                    ta.ShowDialog();
                }

                if (result == 4)// in case the user is Department Head
                {
                    this.Hide();
                    //A_DepartmentHead depHead = new A_DepartmentHead();
                    A_DepartmentHead depHead = new A_DepartmentHead(this.dh);
                    depHead.ShowDialog();
                }

                if (result == 5)// in case the user is secretary
                {
                    this.Hide();
                    A_menuForSecretary sec = new A_menuForSecretary();
                    sec.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Login FAILED !!! Invalid ID/Password");
            }

            this.id_text.Clear();
            this.password_text.Clear();
        }
 public A_AverageGradesInCoursses_HD(HeadDepartment hd)
 {
     InitializeComponent();
     //this.dep = new HeadDepartment();
     this.dep = hd;
 }
 public A_DHview(HeadDepartment hd)
 {
     InitializeComponent();
     // this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#10
0
 public A_DHschedualing(HeadDepartment hd)
 {
     InitializeComponent();
     // this.dep = new HeadDepartment();
     this.dep = hd;
 }
 public A_student_report_forDH(HeadDepartment hd)
 {
     InitializeComponent();
     //  this.dep = new HeadDepartment();
     this.dep = hd;
 }
 public A_allocateNumSeatsToCourse_DH(HeadDepartment hd)
 {
     InitializeComponent();
     //  this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#13
0
 public A_addLecturer_DH(HeadDepartment hd)
 {
     InitializeComponent();
     this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#14
0
 public A_remove_TA_DH(HeadDepartment hd)
 {
     InitializeComponent();
     //this.dep = new HeadDepartment();
     this.dep = hd;
 }
 public A_HD_ExamList(HeadDepartment hd)
 {
     InitializeComponent();
     this.dep = hd;
 }
示例#16
0
 public A_stutent_report_perYear(HeadDepartment hd)
 {
     InitializeComponent();
     //this.dep = new HeadDepartment();
     this.dep = hd;
 }
 public A_schedLectToCourse_forDH(HeadDepartment hd)
 {
     InitializeComponent();
     // this.dep = new HeadDepartment();
     this.dep = hd;
 }
示例#18
0
        private void Login_button_Click(object sender, EventArgs e)
        {
            if (ID_Box.TextLength != 9)
            {
                MessageBox.Show("ooops Wrong ID please try again");
                ID_Box.Text       = "";
                Password_box.Text = "";
            }
            SqlConnection connect = new SqlConnection(Return_Connection_String_Class.Return_Connection_String());

            try
            {
                connect.Open();
            }
            catch (Exception ex)
            {
                // output the error to see what's going on
                MessageBox.Show(ex.Message);
            }

            if (connect.State == System.Data.ConnectionState.Open)
            {
                string        command = "select * from Users where ID = '" + ID_Box.Text + "' and Password = '******'";
                SqlCommand    cmd     = new SqlCommand(command, connect);
                SqlDataReader dataRead;
                dataRead = cmd.ExecuteReader();
                int    type = 0;
                string Messenge1 = "", Messenge2 = "";

                while (dataRead.Read())
                {
                    type = Convert.ToInt32(dataRead["Type"]);
                    int    id   = Convert.ToInt32(dataRead["ID"]);
                    string ln   = (dataRead["LastName"].ToString());
                    string fn   = (dataRead["FirstName"].ToString());
                    string depa = (dataRead["Departments"].ToString());
                    if (type == 1)
                    {
                        // 317509073/

                        //int id = Convert.ToInt32(dataRead["ID"]);
                        //string ln = (dataRead["LastName"].ToString());
                        //string fn = (dataRead["FirstName"].ToString());
                        string year = (dataRead["Year"].ToString());
                        //string depa = (dataRead["Departments"].ToString());
                        int semester = Convert.ToInt32(dataRead["Semester"]);
                        S1 = new StudentClass(id, fn, ln, type, year, semester, depa);
                        string        readMassange       = "select * from Messege_Box where ID = '" + S1.getID().ToString() + "'";
                        SqlCommand    ReadMessageCommand = new SqlCommand(readMassange, connect);
                        SqlDataReader messangeRead;
                        messangeRead = ReadMessageCommand.ExecuteReader();
                        while (messangeRead.Read())
                        {
                            Messenge1 = (messangeRead["S_Messege"].ToString());
                            Messenge2 = (messangeRead["L_Messege"].ToString());
                        }
                    }

                    if (type == 2) // to create the object Lecturer
                    {
                        int    pid   = Convert.ToInt32(dataRead["ID"]);
                        string pln   = (dataRead["LastName"].ToString());
                        string pfn   = (dataRead["FirstName"].ToString());
                        string pdepa = (dataRead["Departments"].ToString());
                        P1 = new ProfessorClass(pid, pln, pfn, type, pdepa);
                        string        readMassange       = "select * from Messege_Box where ID = '" + P1.getID().ToString() + "'";
                        SqlCommand    ReadMessageCommand = new SqlCommand(readMassange, connect);
                        SqlDataReader messangeRead;
                        messangeRead = ReadMessageCommand.ExecuteReader();
                        while (messangeRead.Read())
                        {
                            Messenge1 = (messangeRead["S_Messege"].ToString());
                            Messenge2 = (messangeRead["L_Messege"].ToString());
                        }
                        lec = new Lecturer();
                        this.lec.setLastName(ln);
                        this.lec.setFirstName(fn);
                        this.lec.setID(id);
                        this.lec.setdeparName(depa);
                    }


                    if (type == 3)     // to create the object TeachingAssitant
                    {
                        ta = new TeachingAssitant();
                        this.ta.setLastName(ln);
                        this.ta.setFirstName(fn);
                        this.ta.setID(id);
                        this.ta.setdeparName(depa);
                    }

                    if (type == 4) // to create the object HeadDepartmrent
                    {
                        hd = new HeadDepartment();
                        this.hd.setLastName(ln);
                        this.hd.setFirstName(fn);
                        this.hd.setID(id);
                        this.hd.setdeparName(depa);
                    }

                    if (type == 5)
                    {
                        sec = new Secretary();
                        this.sec.setLastName(ln);
                        this.sec.setFirstName(fn);
                        this.sec.setID(id);
                        this.sec.setdeparName(depa);
                    }
                    if (type == 7)
                    {
                        sec = new Secretary();
                        this.sec.setLastName(ln);
                        this.sec.setFirstName(fn);
                        this.sec.setID(id);
                        this.sec.setdeparName(depa);
                    }
                }
                if (save_id.Checked)
                {
                    Properties.Settings.Default.IDREMEMBER = ID_Box.Text.ToString();
                    Properties.Settings.Default.Save();
                }
                if (!save_id.Checked)
                {
                    Properties.Settings.Default.IDREMEMBER = "";
                    Properties.Settings.Default.Save();
                }

                if (type == 1)
                {
                    MessageBox.Show("wellcome " + S1.getFirstName() + " to student menu your ID " + S1.getID() + "");
                    this.Hide();
                    Student_Menu_B student = new Student_Menu_B();
                    if (Messenge1 != "" || Messenge2 != "")
                    {
                        student.Massange = true;
                    }
                    connect.Close();
                    student.passValue = S1;
                    dataRead.Close();
                    student.Show();
                }
                else if (type == 2)
                {
                    MessageBox.Show("wellcome " + P1.getFirstName() + " to Lecturer Menu your ID " + P1.getID() + "");
                    this.Hide();
                    //Proffesor_Menu_B professor = new Proffesor_Menu_B();
                    A_LecturerMenu lecMenu = new A_LecturerMenu(lec);
                    lecMenu.passValue = P1;
                    connect.Close();
                    dataRead.Close();
                    lecMenu.ShowDialog();

                    /*
                     * this.Hide();
                     * A_LecturerMenu lecMenu = new A_LecturerMenu(lec);
                     * lecMenu.ShowDialog();
                     */
                    //MessageBox.Show("Connceted Professor");
                    //this.Hide();
                    //Proffesor_Menu_B professor = new Proffesor_Menu_B();
                    //professor.Show();
                    // קבוצה B שימו לב !!!!!!!!
                    // אתם צריכים לשנות את הסוג של פרופסור אצלכם ל-2 ולשנות את זה בכל מקום! גם בקוד וגם בדטהבייס
                    // ואז לשלוח אותו לפורם הבא: A_lecturerMenu  אחרי שתאחדו את הדרישות שלכם בפורם הזה
                }

                else if (type == 3)
                {
                    this.Hide();
                    MessageBox.Show("wellcome " + ta.getFirstName() + " to Teaching Assistant Menu your ID " + ta.getID() + "");
                    A_TeachingAssistant taMenu = new A_TeachingAssistant(ta);
                    taMenu.passValue = ta;
                    connect.Close();
                    dataRead.Close();
                    taMenu.ShowDialog();



                    //change branch B ---  type of proffesor to type 2
                    //MessageBox.Show("Connceted Professor");
                    //this.Hide();
                    //Proffesor_Menu_B professor = new Proffesor_Menu_B();
                    //professor.Show();
                }
                else if (type == 4)
                {
                    this.Hide();
                    //HeadDepartment hd = new HeadDepartment();
                    A_DepartmentHead hdMenu = new A_DepartmentHead();
                    hdMenu.passValue = hd;
                    connect.Close();
                    dataRead.Close();
                    hdMenu.ShowDialog();
                }
                else if (type == 5)
                {
                    MessageBox.Show("wellcome " + sec.getFirstName() + " to Secretary Menu your ID " + sec.getID() + "");
                    this.Hide();
                    Secretary_Menu_B secretary = new Secretary_Menu_B();
                    secretary.passsec = sec;
                    secretary.Show();
                }
                else if (type == 6)
                {
                    MessageBox.Show("Connceted TECH");
                    this.Hide();
                    support__manager supp = new support__manager();
                    supp.Show();
                }
                else if (type == 7)
                {
                    this.Hide();

                    MessageBox.Show("wellcome " + sec.getFirstName() + " to Secretary Menu your ID " + sec.getID() + "");
                    A_menuForSecretary secMenu = new A_menuForSecretary();
                    // secMenu.passValue = sec;
                    //connect.Close();
                    //dataRead.Close();
                    secMenu.Show();
                }
                else
                {
                    MessageBox.Show("Wrong password");
                    Password_box.Text = "";
                }
            }
        }
示例#19
0
 public A_viewReportHoursOf_Lecturer_forDH(HeadDepartment hd)
 {
     InitializeComponent();
     // this.dep = new HeadDepartment();
     this.dep = hd;
 }