예제 #1
0
        private void fillDataForm(int ID)
        {
            Studnets objStu = new Studnets();
            DataRow  Stu    = objStu.drSearchStudent(ID);

            if (Stu != null)
            {
                labStudentName.Text    = Stu["StudentName"].ToString();
                labStudentNmuber.Text  = Stu["UniversityID"].ToString();
                labSectionStudent.Text = Stu["SectionName"].ToString();
                labCollage.Text        = Stu["CollageName"].ToString();
            }
            PullCourseClass obj = new PullCourseClass();
            int             id  = Convert.ToInt32(Request.QueryString["id"]);
            DataRow         dr  = obj.drgetform(id);

            if (dr != null)
            {
                txtTimeCourse1.Text  = dr["Course1time"].ToString();
                txtTimeCourse2.Text  = dr["Course2time"].ToString();
                txtTimeCourse3.Text  = dr["Course3time"].ToString();
                txtReason.Text       = dr["Description"].ToString();
                txtNmberHours.Text   = dr["NumHourRegester"].ToString();
                txtNumHourAfter.Text = dr["NumAfterPull"].ToString();
            }
            labDate.Text = DateTime.Today.ToString();
        }
예제 #2
0
        private void fillDataForm(int ID)
        {
            PullCourseClass obj = new PullCourseClass();
            int             id  = Convert.ToInt32(Request.QueryString["id"]);
            DataRow         dr  = obj.drgetform(id);

            if (dr != null)
            {
                int      STUid  = Convert.ToInt32(dr["StudentID"].ToString());
                Studnets objStu = new Studnets();
                DataRow  Stu    = objStu.drSearchStudent(STUid);
                if (Stu != null)
                {
                    labStudentName.Text    = Stu["StudentName"].ToString();
                    labStudentNmuber.Text  = Stu["UniversityID"].ToString();
                    labSectionStudent.Text = Stu["SectionName"].ToString();
                    labCollage.Text        = Stu["CollageName"].ToString();
                }

                labDate.Text         = dr["Date"].ToString();
                txtTimeCourse1.Text  = dr["Course1time"].ToString();
                txtTimeCourse2.Text  = dr["Course2time"].ToString();
                txtTimeCourse3.Text  = dr["Course3time"].ToString();
                txtReason.Text       = dr["Description"].ToString();
                txtNmberHours.Text   = dr["NumHourRegester"].ToString();
                txtNumHourAfter.Text = dr["NumAfterPull"].ToString();
                txtNumCourse1.Text   = dr["Subject1ID"].ToString();
                txtNumCourse2.Text   = dr["Subject2ID"].ToString();
                txtNumCourse3.Text   = dr["Subject3ID"].ToString();

                string           Year     = dr["Year"].ToString();
                string           Semester = dr["Semester"].ToString();
                RegistredCourses Subj     = new RegistredCourses();

                if (Convert.ToInt32(txtNumCourse1.Text.ToString()) != 0)
                {
                    int     Course1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course1, Year, Semester);
                    labTeacher1.Text             = Sub["EmployeeName"].ToString();
                    ddlNameCourse1.SelectedValue = txtNumCourse1.Text.ToString();
                    //ddlNameCourse1.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                }
                if (Convert.ToInt32(txtNumCourse2.Text.ToString()) != 0)
                {
                    int     Course2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course2, Year, Semester);
                    labTeacher2.Text = Sub["EmployeeName"].ToString();
                    //ddlNameCourse2.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                    ddlNameCourse2.SelectedValue = txtNumCourse2.Text.ToString();
                }
                if (Convert.ToInt32(txtNumCourse3.Text.ToString()) != 0)
                {
                    int     Course3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course3, Year, Semester);
                    labTeacher3.Text = Sub["EmployeeName"].ToString();
                    //ddlNameCourse3.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                    ddlNameCourse3.SelectedValue = txtNumCourse3.Text.ToString();
                }
            }
        }
예제 #3
0
        protected void fillEditddl()
        {
            PullCourseClass  obj      = new PullCourseClass();
            int              id       = Convert.ToInt32(Request.QueryString["id"]);
            DataRow          dr       = obj.drgetform(id);
            RegistredCourses obj1     = new RegistredCourses();
            int              ID       = Convert.ToInt32(Session["ID"].ToString());
            int              CourseID = 0;
            DataRow          dr1;

            if (dr != null)
            {
                ddlNameCourse1.SelectedValue = dr["Subject1ID"].ToString();
                ddlNameCourse2.SelectedValue = dr["Subject2ID"].ToString();
                ddlNameCourse3.SelectedValue = dr["Subject3ID"].ToString();
                if (ddlNameCourse1.SelectedIndex != 0 && ddlNameCourse1.SelectedIndex != -1)
                {
                    txtNumCourse1.Text = ddlNameCourse1.SelectedValue.ToString();
                    CourseID           = Convert.ToInt32(ddlNameCourse1.SelectedValue.ToString());
                    dr1 = obj1.drSearchRegisterSubjectTeacher(ID, CourseID);
                    if (dr1 != null)
                    {
                        labTeacher1.Text = dr1["EmployeeName"].ToString();
                    }
                }
                if (ddlNameCourse3.SelectedIndex != 0 && ddlNameCourse3.SelectedIndex != -1)
                {
                    txtNumCourse3.Text = ddlNameCourse3.SelectedValue.ToString();
                    CourseID           = Convert.ToInt32(ddlNameCourse3.SelectedValue.ToString());
                    dr1 = obj1.drSearchRegisterSubjectTeacher(ID, CourseID);
                    if (dr1 != null)
                    {
                        labTeacher3.Text = dr1["EmployeeName"].ToString();
                    }
                }
                if (ddlNameCourse2.SelectedIndex != 0 && ddlNameCourse2.SelectedIndex != -1)
                {
                    txtNumCourse2.Text = ddlNameCourse2.SelectedValue.ToString();
                    ID       = Convert.ToInt32(Session["ID"].ToString());
                    CourseID = Convert.ToInt32(ddlNameCourse2.SelectedValue.ToString());

                    dr1 = obj1.drSearchRegisterSubjectTeacher(ID, CourseID);
                    if (dr1 != null)
                    {
                        labTeacher2.Text = dr1["EmployeeName"].ToString();
                    }
                }
            }
        }
        protected void btnSaveHead_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"].ToString());
            string Path   = "";
            string Data   = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() +
                            txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString() + rbtAceptHead.SelectedValue.ToString();

            if (fuSignatureHead.HasFile)
            {
                string Private = fuSignatureHead.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignatureHead.SaveAs(Server.MapPath("Test") + "/" + fuSignatureHead.FileName);
                SignatureEmployee newSig     = new SignatureEmployee();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }

            if (Result == true)
            {
                PullCourseClass obj        = new PullCourseClass();
                int             id         = Convert.ToInt32(Request.QueryString["id"]);
                int             AcceptHead = Convert.ToInt32(rbtAceptHead.SelectedValue.ToString());
                string          HeadDec    = txtDescriptionHead.Text.ToString();
                if (obj.AcceptHeadPullCourse(id, AcceptHead, HeadDec) == 1)
                {
                    DataRow dr    = obj.drgetform(id);
                    int     STUid = Convert.ToInt32(dr["StudentID"].ToString());

                    SentMail s = new SentMail();
                    s.sendemailDean(STUid);
                    Response.Redirect("ProcessRequest.aspx");
                }

                errorHead.Visible = false;
            }
            else
            {
                errorHead.Text    = "التوقيع المدخل خاطئ او كلمة المرور";
                errorHead.Visible = true;
            }
        }
        private void fillData(int p)
        {
            PullCourseClass obj = new PullCourseClass();
            int             id  = Convert.ToInt32(Request.QueryString["id"]);
            DataRow         dr  = obj.drgetform(id);

            if (dr != null)
            {
                int      STUid  = Convert.ToInt32(dr["StudentID"].ToString());
                Studnets objStu = new Studnets();
                DataRow  Stu    = objStu.drSearchStudent(STUid);
                if (Stu != null)
                {
                    labStudentName.Text    = Stu["StudentName"].ToString();
                    labStudentNmuber.Text  = Stu["UniversityID"].ToString();
                    labSectionStudent.Text = Stu["SectionName"].ToString();
                    labCollage.Text        = Stu["CollageName"].ToString();
                }
                labDateReg.Text      = DateTime.UtcNow.ToString("yyyy-MM-dd");
                labDate.Text         = dr["Date"].ToString();
                txtTimeCourse1.Text  = dr["Course1time"].ToString();
                txtTimeCourse2.Text  = dr["Course2time"].ToString();
                txtTimeCourse3.Text  = dr["Course3time"].ToString();
                txtReason.Text       = dr["Description"].ToString();
                txtNmberHours.Text   = dr["NumHourRegester"].ToString();
                txtNumHourAfter.Text = dr["NumAfterPull"].ToString();
                txtNumCourse1.Text   = dr["Subject1ID"].ToString();
                txtNumCourse2.Text   = dr["Subject2ID"].ToString();
                txtNumCourse3.Text   = dr["Subject3ID"].ToString();

                string           Year     = dr["Year"].ToString();
                string           Semester = dr["Semester"].ToString();
                RegistredCourses Subj     = new RegistredCourses();

                if (Convert.ToInt32(txtNumCourse1.Text.ToString()) != 0)
                {
                    int     Course1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course1, Year, Semester);
                    labTeacher1.Text = Sub["EmployeeName"].ToString();
                    ddlNameCourse1.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                }
                if (Convert.ToInt32(txtNumCourse2.Text.ToString()) != 0)
                {
                    int     Course2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course2, Year, Semester);
                    labTeacher2.Text = Sub["EmployeeName"].ToString();
                    ddlNameCourse2.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                }
                if (Convert.ToInt32(txtNumCourse3.Text.ToString()) != 0)
                {
                    int     Course3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
                    DataRow Sub     = Subj.drSearchRegisterSubjectID(Course3, Year, Semester);
                    labTeacher3.Text = Sub["EmployeeName"].ToString();
                    ddlNameCourse3.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0"));
                }


                txtDescriptionHead.Text = dr["HeadDescription"].ToString();
                string HeadAccept = dr["HeadAccept"].ToString();
                if (HeadAccept == "1")
                {
                    rbtAceptHead.SelectedValue = "1";
                }
                else if (HeadAccept == "2")
                {
                    rbtAceptHead.SelectedValue = "2";
                }
                string DeanAccept = dr["DeanAccept"].ToString();
                if (DeanAccept == "1")
                {
                    rbtAcceptDean.SelectedValue = "1";
                }
                else if (DeanAccept == "2")
                {
                    rbtAcceptDean.SelectedValue = "2";
                }

                string RegAccept = dr["RegestrationAccept"].ToString();
                if (RegAccept == "1")
                {
                    rbtAcceptRegistration.SelectedValue = "1";
                }
                else if (RegAccept == "2")
                {
                    rbtAcceptRegistration.SelectedValue = "2";
                }
                txtDescriptionDean.Text = dr["DeanDescription"].ToString();
            }
        }