Example #1
0
        public bool addconstraint(constraints addthis)
        {
            SqlConnection con        = new SqlConnection(constring);
            SqlCommand    newcommand = new SqlCommand("INSERT INTO dbo.Constraints (StartTime,EndTime,Day,CourseID,LecturerID,Lecture_type,ClassID,CourseName,LecturerName,Year,Semester) VALUES (@StartTime,@EndTime,@Day,@CourseID,@LecturerID,@Lecture_type,@ClassID,@CourseName,@LecturerName,@Year,@Semester)", con);

            newcommand.Parameters.Add("@StartTime", addthis.getStart());
            newcommand.Parameters.Add("@EndTime", addthis.getEnd());
            newcommand.Parameters.Add("@Day", addthis.getday());
            newcommand.Parameters.Add("@CourseID", addthis.getcourseid());
            newcommand.Parameters.Add("@LecturerID", addthis.getlecturerid());
            newcommand.Parameters.Add("@Lecture_type", addthis.gettype());
            newcommand.Parameters.Add("@ClassID", addthis.getclassroom());
            newcommand.Parameters.Add("@CourseName", addthis.getcoursename());
            newcommand.Parameters.Add("@LecturerName", addthis.getlecturer());
            newcommand.Parameters.Add("@Year", addthis.getyear());
            newcommand.Parameters.Add("@Semester", addthis.getsemester());
            con.Open();
            if (con.State == System.Data.ConnectionState.Open)
            {
                newcommand.ExecuteNonQuery();
                con.Close();
                return(true);
            }
            return(false);
        }
Example #2
0
 public Teacher_movecon_request(object input_constraint)
 {
     InitializeComponent();
     sending_constraint      = input_constraint as constraints;
     Sender_name_label.Text  = "Username:  "******"\nID:  " + sending_constraint.getlecturerid();
     Subject_fixed_text.Text = "ID:  " + sending_constraint.get_id() + "\nCourse ID:  " + sending_constraint.getcourseid() + "\nCourse Name:  " + sending_constraint.getcoursename()
                               + "\nClass:  " + sending_constraint.getclassroom();
 }
Example #3
0
        public void Rebuild_for_teacher(String Lecturer)
        {
            constID.Enabled        = false;
            constCourse.Enabled    = false;
            constType.Enabled      = false;
            Constclassroom.Enabled = false;
            constDay.Enabled       = false;
            Conststart.Enabled     = false;
            Constend.Enabled       = false;
            Teacherscombox.Visible = false;
            delete_const.Visible   = false;

            System.Windows.Forms.TextBox Teachers_un_textbox = new System.Windows.Forms.TextBox();
            Teachers_un_textbox.BackColor   = System.Drawing.SystemColors.Info;
            Teachers_un_textbox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            Teachers_un_textbox.Location    = new System.Drawing.Point(178, 150);
            Teachers_un_textbox.Name        = "Teachers_un_textbox";
            Teachers_un_textbox.ReadOnly    = true;
            Teachers_un_textbox.Size        = new System.Drawing.Size(100, 20);
            Teachers_un_textbox.TabIndex    = 1;
            Teachers_un_textbox.Visible     = true;
            Teachers_un_textbox.Text        = recived.getlecturer();
            Teachers_un_textbox.Enabled     = false;
            Controls.Add(Teachers_un_textbox);

            System.Windows.Forms.Button Classroom_request = new System.Windows.Forms.Button();
            Classroom_request.Location = new System.Drawing.Point(15, 12);
            Classroom_request.Name     = "Classroom Request";
            Classroom_request.Size     = new System.Drawing.Size(150, 23);
            Classroom_request.TabIndex = 3;
            Classroom_request.Text     = "בקשה לשינוי כיתה";
            Classroom_request.UseVisualStyleBackColor = true;
            Classroom_request.Visible = true;
            Classroom_request.Click  += new System.EventHandler(this.Classroom_request_click);
            Controls.Add(Classroom_request);

            System.Windows.Forms.Button Move_Request = new System.Windows.Forms.Button();
            Move_Request.Location = new System.Drawing.Point(15, 51);
            Move_Request.Name     = "Move Request";
            Move_Request.Size     = new System.Drawing.Size(150, 23);
            Move_Request.TabIndex = 3;
            Move_Request.Text     = "בקשה להזזת האילוץ";
            Move_Request.UseVisualStyleBackColor = true;
            Move_Request.Visible = true;
            Move_Request.Click  += new System.EventHandler(this.Move_Request_click);
            Controls.Add(Move_Request);
        }
Example #4
0
        private String make_the_letter()
        {
            String Letter = "\tSubject:\n\n" + make_the_subject() + "\n\n\n\tLetter: "
                            + "\n\nSender:  " + sending_constraint.getlecturer()
                            + "\nSender`s ID:  " + sending_constraint.getlecturerid()
                            + "\nConstrant`s ID:  " + sending_constraint.get_id()
                            + "\nCourse`s name:  " + sending_constraint.getcoursename()
                            + "\nCourse`s ID:  " + sending_constraint.getcourseid()
                            + "\nYear:  " + sending_constraint.getyear()
                            + "\nSemester:  " + sending_constraint.getsemester()
                            + "\nClassroom:  " + sending_constraint.getclassroom();

            if (FreeText.Text == String.Empty)
            {
                Letter += "\n\n\n\t***No attached message***";
            }
            else
            {
                Letter += "\n\n\n\tAttached message: \n\n" + FreeText.Text;
            }

            return(Letter);
        }