Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string Reson = "";
            int    NumHoursResginter;
            int    NumpullHours;
            int    CourseNum1 = 0;
            int    CourseNum2 = 0;
            int    CourseNum3 = 0;
            int    CourseNum4 = 0;

            if (txtNumCourse1.Text != string.Empty)
            {
                CourseNum1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
            }

            if (txtNumCourse2.Text != string.Empty)
            {
                CourseNum2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
            }

            if (txtNumCourse3.Text != string.Empty)
            {
                CourseNum3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
            }
            if (txtNmberHours.Text != string.Empty)
            {
                NumHoursResginter = Convert.ToInt32(txtNmberHours.Text.ToString());
            }
            if (txtNumHourAfter.Text != string.Empty)
            {
                NumpullHours = Convert.ToInt32(txtNumHourAfter.Text.ToString());
            }

            string Course1time = txtTimeCourse1.Text.ToString();

            string          Course2time = txtTimeCourse2.Text.ToString();
            string          Course3time = txtTimeCourse3.Text.ToString();
            string          DateNow     = DateTime.Today.ToString();
            int             ID          = Convert.ToInt32(Session["ID"]);
            PullCourseClass obj         = new PullCourseClass();

            if (obj.AddPullCourse(ID, "", CourseNum1, CourseNum2, CourseNum3, DateNow, Reson, "", "", 0, "", "", 0, 0, 5) == 1)
            {
                txtReason.Text               = "";
                txtNumCourse1.Text           = "";
                txtNumCourse2.Text           = "";
                txtNumCourse3.Text           = "";
                ddlNameCourse1.SelectedIndex = -1;
                ddlNameCourse2.SelectedIndex = -1;
                ddlNameCourse3.SelectedIndex = -1;
                labTeacher1.Text             = "";
                labTeacher2.Text             = "";
                labTeacher3.Text             = "";
                txtNmberHours.Text           = "";
                txtNumHourAfter.Text         = "";
                txtTimeCourse1.Text          = "";
                txtTimeCourse2.Text          = "";
                txtTimeCourse3.Text          = "";
            }
        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "C:/Users/Dua'a-Orcas/Desktop/WebApplication1/WebApplication1/WebApplication1/PageStudents/Test/";
            string Data   = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() +
                            txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = Path + Private;
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                //  Path = "/Test/" + fuSignatureStudent.FileName;
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, ID);
                Result = newSig.Decreypt(strencrypt, ID);
            }
            if (Result == true)
            {
                string Reson = "";
                int    NumHoursResginter;
                int    NumpullHours;
                int    CourseNum1 = 0;
                int    CourseNum2 = 0;
                int    CourseNum3 = 0;


                if (txtNumCourse1.Text != string.Empty)
                {
                    CourseNum1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
                }

                if (txtNumCourse2.Text != string.Empty)
                {
                    CourseNum2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
                }

                if (txtNumCourse3.Text != string.Empty)
                {
                    CourseNum3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
                }
                if (txtNmberHours.Text != string.Empty)
                {
                    NumHoursResginter = Convert.ToInt32(txtNmberHours.Text.ToString());
                }
                if (txtNumHourAfter.Text != string.Empty)
                {
                    NumpullHours = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                }
                if (txtReason.Text != string.Empty)
                {
                    Reson = txtReason.Text.ToString();
                }

                string Course1time   = txtTimeCourse1.Text.ToString();
                string Course2time   = txtTimeCourse2.Text.ToString();
                string Course3time   = txtTimeCourse3.Text.ToString();
                int    NumHourREG    = Convert.ToInt32(txtNmberHours.Text.ToString());
                int    NumHourAFpull = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                string DateNow       = DateTime.Today.ToString();

                PullCourseClass obj = new PullCourseClass();
                if (obj.AddPullCourse(ID, CourseNum1, CourseNum2, CourseNum3, DateNow, Reson, Course1time, Course2time, Course3time, NumHourREG, NumHourAFpull, "", "", 0, "", "", 0, 0, 5) == 1)
                {
                    txtReason.Text               = "";
                    txtNumCourse1.Text           = "";
                    txtNumCourse2.Text           = "";
                    txtNumCourse3.Text           = "";
                    ddlNameCourse1.SelectedIndex = -1;
                    ddlNameCourse2.SelectedIndex = -1;
                    ddlNameCourse3.SelectedIndex = -1;
                    labTeacher1.Text             = "";
                    labTeacher2.Text             = "";
                    labTeacher3.Text             = "";
                    txtNmberHours.Text           = "";
                    txtNumHourAfter.Text         = "";
                    txtTimeCourse1.Text          = "";
                    txtTimeCourse2.Text          = "";
                    txtTimeCourse3.Text          = "";
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = "التوقيع المدخل خاطئ";
                errorLabel.Visible = true;
            }
        }
Ejemplo n.º 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool   Result = false;
            int    ID     = Convert.ToInt32(Session["ID"]);
            string Path   = "";

            string Data = txtNumCourse1.Text.ToString() + txtNumCourse2.Text.ToString() + txtNumCourse3.Text.ToString() +
                          txtNmberHours.Text.ToString() + txtNumHourAfter.Text.ToString() + DateTime.Today.ToString();

            if (fuSignatureStudent.HasFile)
            {
                string Private = fuSignatureStudent.FileName.ToString();
                Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private;
                string Pasword = txtPassSign.Text.ToString();
                fuSignatureStudent.SaveAs(Server.MapPath("Test") + "/" + fuSignatureStudent.FileName);
                SignatureStudents newSig     = new SignatureStudents();
                string            strencrypt = newSig.encrypet(Data, Path, Pasword);
                Result = newSig.Decreypt(strencrypt, ID);
            }
            if (Result == true)
            {
                string Reson = "";
                int    NumHoursResginter;
                int    NumpullHours;
                int    CourseNum1 = 0;
                int    CourseNum2 = 0;
                int    CourseNum3 = 0;


                if (txtNumCourse1.Text != string.Empty)
                {
                    CourseNum1 = Convert.ToInt32(txtNumCourse1.Text.ToString());
                }

                if (txtNumCourse2.Text != string.Empty)
                {
                    CourseNum2 = Convert.ToInt32(txtNumCourse2.Text.ToString());
                }

                if (txtNumCourse3.Text != string.Empty)
                {
                    CourseNum3 = Convert.ToInt32(txtNumCourse3.Text.ToString());
                }
                if (txtNmberHours.Text != string.Empty)
                {
                    NumHoursResginter = Convert.ToInt32(txtNmberHours.Text.ToString());
                }
                if (txtNumHourAfter.Text != string.Empty)
                {
                    NumpullHours = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                }
                if (txtReason.Text != string.Empty)
                {
                    Reson = txtReason.Text.ToString();
                }

                string            Course1time   = txtTimeCourse1.Text.ToString();
                string            Course2time   = txtTimeCourse2.Text.ToString();
                string            Course3time   = txtTimeCourse3.Text.ToString();
                int               NumHourREG    = Convert.ToInt32(txtNmberHours.Text.ToString());
                int               NumHourAFpull = Convert.ToInt32(txtNumHourAfter.Text.ToString());
                string            DateNow       = labDate.Text.ToString();
                NowTimeUniversity timee         = new NowTimeUniversity();
                DataRow           T             = timee.drSearchYearANdSemester();
                string            semester      = T["NowSemester"].ToString();
                string            Year          = T["NowYear"].ToString();
                PullCourseClass   obj           = new PullCourseClass();
                if (NumHourAFpull >= 9)
                {
                    if (obj.AddPullCourse(ID, Year, semester, CourseNum1, CourseNum2, CourseNum3, DateNow, Reson, Course1time, Course2time, Course3time, NumHourREG, NumHourAFpull, "", "", 0, "", "", 0, 0, 5) == 1)
                    {
                        txtReason.Text               = "";
                        txtNumCourse1.Text           = "";
                        txtNumCourse2.Text           = "";
                        txtNumCourse3.Text           = "";
                        ddlNameCourse1.SelectedIndex = -1;
                        ddlNameCourse2.SelectedIndex = -1;
                        ddlNameCourse3.SelectedIndex = -1;
                        labTeacher1.Text             = "";
                        labTeacher2.Text             = "";
                        labTeacher3.Text             = "";
                        txtNmberHours.Text           = "";
                        txtNumHourAfter.Text         = "";
                        txtTimeCourse1.Text          = "";
                        txtTimeCourse2.Text          = "";
                        txtTimeCourse3.Text          = "";
                        labError.Visible             = false;
                        error.Style.Add("display", "none");
                        SentMail s = new SentMail();
                        s.sendemailHead(ID);
                        Response.Redirect("HomeStudent.aspx");
                    }
                }
                else
                {
                    labError.Visible = true;
                    error.Style.Add("display", "block");
                }
                errorLabel.Visible = false;
            }
            else
            {
                errorLabel.Text    = " التوقيع المدخل خاطئ أو كلمة المرور";
                errorLabel.Visible = true;
            }
        }