protected void ddlRequest_SelectedIndexChanged(object sender, EventArgs e) { int ID = Convert.ToInt32(Session["ID"].ToString()); if (ddlRequest.SelectedIndex != 0 && ddlRequest.SelectedIndex != -1) { if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 4) { AlternativeSub obj = new AlternativeSub(); DataTable dt = obj.dtNotAcceptAliSubAcademicAdvisorApplication(ID); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 5) { DropSemester obj = new DropSemester(); DataTable dt = obj.dtNotAcceptDropSemesterAcademicAdvisorApplication(ID); gvRequest.DataSource = dt; gvRequest.DataBind(); } } }
protected void btnSaveDean_Click(object sender, EventArgs e) { bool Result = false; int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() + labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString() + labDateDean.Text.ToString() + rbtDeanAccept.SelectedValue.ToString(); if (fuSignatureDean.HasFile) { string Private = fuSignatureDean.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignatureDean.SaveAs(Server.MapPath("Test") + "/" + fuSignatureDean.FileName); SignatureEmployee newSig = new SignatureEmployee(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { AlternativeSub obj = new AlternativeSub(); int id = Convert.ToInt32(Request.QueryString["id"]); int AcceptDean = Convert.ToInt32(rbtDeanAccept.SelectedValue.ToString()); if (obj.AcceptDeanAltiSubj(id, AcceptDean) == 1) { SentMail s = new SentMail(); s.sendemailReg(); Response.Redirect("ProcessRequest.aspx"); } errorDean.Visible = false; } else { errorDean.Text = "التوقيع المدخل خاطئ او كلمة المرور"; errorDean.Visible = true; } }
protected void btnSave_Click(object sender, EventArgs e) { bool Result = false; //Define Avariable int CourseNum1 = 0; int AlternativeCourseNum1 = 0; string TypeCouseNum1 = ""; string Reason = ""; int row = Convert.ToInt32(Request.QueryString["id"]); int ID = Convert.ToInt32(Session["ID"].ToString()); string Path = ""; string Data = txtNumberCourse1.Text.ToString() + txtAlternativeNum1C1.Text.ToString() + labHoursCourse1.Text.ToString() + labHoursAlternative.Text.ToString(); if (fuSignature.HasFile) { string Private = fuSignature.FileName.ToString(); Path = System.Web.HttpContext.Current.Server.MapPath("Test") + "/" + Private; string Pasword = txtPassSign.Text.ToString(); fuSignature.SaveAs(Server.MapPath("Test") + "/" + fuSignature.FileName); // Path = "/Test/" + fuSignatureStudent.FileName; SignatureStudents newSig = new SignatureStudents(); string strencrypt = newSig.encrypet(Data, Path, Pasword); Result = newSig.Decreypt(strencrypt, ID); } if (Result == true) { //Check input Data if (txtNumberCourse1.Text != String.Empty) { CourseNum1 = Convert.ToInt32(txtNumberCourse1.Text.ToString()); } if (txtAlternativeNum1C1.Text != String.Empty) { AlternativeCourseNum1 = Convert.ToInt32(txtAlternativeNum1C1.Text.ToString()); } if (labTypeCourse1.Text != String.Empty) { TypeCouseNum1 = labTypeCourse1.Text.ToString(); } if (txtReason.Text != String.Empty) { Reason = txtReason.Text.ToString(); } AlternativeSub obj = new AlternativeSub(); NowTimeUniversity timee = new NowTimeUniversity(); DataRow T = timee.drSearchYearANdSemester(); string semester = T["NowSemester"].ToString(); string Year = T["NowYear"].ToString(); string Date1 = labDate.Text.ToString(); if (obj.UpdateAlternativeSubject(row, ID, Year, semester, Date1, CourseNum1, TypeCouseNum1, AlternativeCourseNum1, Reason) == 1) { ddlCourse1.SelectedIndex = -1; ddlAlternativeCourse1.SelectedIndex = -1; txtReason.Text = ""; ddlAlternativeCourse1.SelectedIndex = -1; txtAlternativeNum1C1.Text = ""; txtNumberCourse1.Text = ""; labTypeCourse1.Text = ""; labHoursCourse1.Text = ""; labHoursAlternative.Text = ""; SentMail s = new SentMail(); s.sendemailAcadimic(ID); } errorLabel.Visible = false; } else { errorLabel.Text = "التوقيع المدخل خاطئ أو كلمة المرور"; errorLabel.Visible = true; } }
protected void ddlRequest_SelectedIndexChanged(object sender, EventArgs e) { int ID = Convert.ToInt32(Session["ID"].ToString()); Position emp = new Position(); DataRow dr = emp.drSearchEmployeePosition(ID); int position = Convert.ToInt32(dr["Position"].ToString()); if (position == 2) { Employee info = new Employee(); DataRow section = info.drSearchEmployeeSection(ID); int sec = Convert.ToInt32(section["SectionID"].ToString()); College col = new College(); DataRow college = col.drSearchColloge(sec); int Collegeid = Convert.ToInt32(college["CollegeID"].ToString()); if (ddlRequest.SelectedIndex != 0 && ddlRequest.SelectedIndex != -1) { if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 1) { ShowStatusClass obj = new ShowStatusClass(); DataTable dt = obj.dtNotAcceptDeanShowStatusApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 2) { PullCourseClass obj = new PullCourseClass(); DataTable dt = obj.dtNotAcceptDeanPullCourseApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 3) { AbsenceExam obj = new AbsenceExam(); DataTable dt = obj.dtNotAcceptDeanAbsenceExamApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 4) { AlternativeSub obj = new AlternativeSub(); DataTable dt = obj.dtNotAcceptDeanAltSubApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 5) { DropSemester obj = new DropSemester(); DataTable dt = obj.dtNotAcceptDeanDropSemesterApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 6) { DelaySemesterClass obj = new DelaySemesterClass(); DataTable dt = obj.dtNotAcceptDeanDelaySemesterApplication(Collegeid); gvRequest.DataSource = dt; gvRequest.DataBind(); } } } else if (position == 3) { Employee info = new Employee(); DataRow section = info.drSearchEmployeeSection(ID); int sec = Convert.ToInt32(section["SectionID"].ToString()); if (ddlRequest.SelectedIndex != 0 && ddlRequest.SelectedIndex != -1) { if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 1) { ShowStatusClass obj = new ShowStatusClass(); DataTable dt = obj.dtNotAcceptHeadShowStatusApplication(sec); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 2) { PullCourseClass obj = new PullCourseClass(); DataTable dt = obj.dtNotAcceptHeadPullCourseApplication(sec); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 4) { AlternativeSub obj = new AlternativeSub(); DataTable dt = obj.dtNotAcceptHeadAltSubApplication(sec); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 5) { DropSemester obj = new DropSemester(); DataTable dt = obj.dtNotAcceptHeadDropSemesterApplication(sec); gvRequest.DataSource = dt; gvRequest.DataBind(); } } } else if (position == 5) { if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 6) { DelaySemesterClass obj = new DelaySemesterClass(); DataTable dt = obj.dtNotAcceptRegestDelaySemesterApplication(); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 2) { PullCourseClass obj = new PullCourseClass(); DataTable dt = obj.dtNotAcceptRegPullCourseApplication(); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 4) { AlternativeSub obj = new AlternativeSub(); DataTable dt = obj.dtNotAcceptHeadAltSubApplication(); gvRequest.DataSource = dt; gvRequest.DataBind(); } else if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 5) { DropSemester obj = new DropSemester(); DataTable dt = obj.dtNotAcceptRegDropSemesterApplication(); gvRequest.DataSource = dt; gvRequest.DataBind(); } } else if (position == 1) { if (Convert.ToInt32(ddlRequest.SelectedValue.ToString()) == 5) { DropSemester obj = new DropSemester(); DataTable dt = obj.dtNotAcceptDeputyAcademicAcceptDropSemesterApplication(); gvRequest.DataSource = dt; gvRequest.DataBind(); } } }
private void fillData() { AlternativeSub obj = new AlternativeSub(); 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) { labCollage.Text = Stu["CollageName"].ToString(); labNameStudent.Text = Stu["StudentName"].ToString(); labNumStudent.Text = Stu["UniversityID"].ToString(); labSection.Text = Stu["SectionName"].ToString(); labMager.Text = Stu["Mager"].ToString(); } labDateS.Text = dr["Date"].ToString(); labDateDean.Text = DateTime.UtcNow.ToString("yyyy-MM-dd"); txtNumberCourse1.Text = dr["Subject1ID"].ToString(); labTypeCourse1.Text = dr["Subject2Type"].ToString(); txtReason.Text = dr["Description"].ToString(); txtAlternativeNum1C1.Text = dr["NewSubject"].ToString(); string Year = dr["Year"].ToString(); string Semester = dr["Semester"].ToString(); Subjects sub = new Subjects(); if (Convert.ToInt32(txtNumberCourse1.Text.ToString()) != 0) { int Course1 = Convert.ToInt32(txtNumberCourse1.Text.ToString()); DataRow Sub = sub.drSearchSubject(Course1); labHoursCourse1.Text = Sub["Hours"].ToString(); ddlCourse1.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0")); } if (Convert.ToInt32(txtAlternativeNum1C1.Text.ToString()) != 0) { int Course1 = Convert.ToInt32(txtAlternativeNum1C1.Text.ToString()); DataRow Sub = sub.drSearchSubject(Course1); labHoursAlternative.Text = Sub["Hours"].ToString(); ddlAlternativeCourse1.Items.Insert(0, new ListItem(Sub["SubjectName"].ToString(), "0")); } string AcademicAccept = dr["AcademicAdvisorAccept"].ToString(); if (AcademicAccept == "1") { rbtAcademic.SelectedValue = "1"; } else if (AcademicAccept == "2") { rbtAcademic.SelectedValue = "2"; } string HeadAccept = dr["HeadAccept"].ToString(); if (HeadAccept == "1") { rbtAceptHead.SelectedValue = "1"; } else if (HeadAccept == "2") { rbtAceptHead.SelectedValue = "2"; } } }