public void getdetails()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            lbl_AcademicYear.Text = iYear.ToString();
            lbl_Semester.Text     = sSemester.ToString();

            string    studentid         = Session["CurrentStudent"].ToString();
            var       services          = new DAL.DAL();
            DataTable dtStudentServices = services.GetStudentDetailsID(studentid, connstr.Conn_string);

            if (dtStudentServices.Rows.Count > 0)
            {
                lbl_StudentName.Text    = dtStudentServices.Rows[0]["strLastDescEn"].ToString();
                lbl_StudentID.Text      = dtStudentServices.Rows[0]["lngStudentNumber"].ToString();
                lbl_StudentContact.Text = dtStudentServices.Rows[0]["Phone"].ToString();
                lbl_StudentEmail.Text   = dtStudentServices.Rows[0]["sECTemail"].ToString();
                hdf_StudentEmail.Value  = dtStudentServices.Rows[0]["sECTemail"].ToString();
                lbl_CurrentMajor.Text   = dtStudentServices.Rows[0]["strCaption"].ToString();

                SqlConnection  sc  = new SqlConnection(connstr.Conn_string);
                SqlCommand     cmd = new SqlCommand("SELECT  Course_Balance_View_BothSides.iYear, Course_Balance_View_BothSides.Sem, Course_Balance_View_BothSides.Shift, Course_Balance_View_BothSides.Course, Course_Balance_View_BothSides.Class, Course_Balance_View_BothSides.Student, Course_Balance_View_BothSides.FactorBalance, Course_Balance_View_BothSides.IsIncluded_AtRisk, Reg_Courses.IsInternshipCourse FROM Course_Balance_View_BothSides INNER JOIN Reg_Courses ON Course_Balance_View_BothSides.Course = Reg_Courses.strCourse WHERE (Reg_Courses.IsInternshipCourse = 1) AND (Course_Balance_View_BothSides.iYear = " + iYear + ") AND (Course_Balance_View_BothSides.Sem = " + iSem + ") AND (Course_Balance_View_BothSides.Student = N'" + studentid + "')", sc);
                DataTable      dt  = new DataTable();
                SqlDataAdapter da  = new SqlDataAdapter(cmd);
                try
                {
                    sc.Open();
                    da.Fill(dt);
                    sc.Close();

                    if (dt.Rows.Count > 0)
                    {
                        //Continue
                    }
                    else
                    {
                        div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                        lbl_Msg.Text         = "You are not allowed to generate this request (Only for students registered internship courses).";
                        lbl_Msg.Visible      = true;
                        div_msg.Visible      = true;
                        lnk_Generate.Enabled = false;
                    }
                }
                catch (Exception ex)
                {
                    sc.Close();
                    Console.WriteLine(ex.Message);
                }
                finally
                {
                    sc.Close();
                }
            }
        }
        protected void drp_Course_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (drp_Course.SelectedItem.Value != "---Select a Course---")
            {
                var services = new DAL.DAL();
                Connection_StringCLS connstr = new Connection_StringCLS(Campus);
                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int       iYear     = Year;
                int       iSem      = sem;
                string    studentid = Session["CurrentStudent"].ToString();
                DataTable dt        = services.GetCoursesbyCourseId(studentid, connstr.Conn_string, iYear, iSem, drp_Course.SelectedItem.Value);
                if (dt.Rows.Count > 0)
                {
                    lbl_CourseCode.Text      = drp_Course.SelectedItem.Value;
                    lbl_Instructor.Text      = dt.Rows[0]["strLecturerDescEn"].ToString();
                    lbl_InstructorEmail.Text = LibraryMOD.GetAdvisorEmail(lbl_Instructor.Text);
                }
            }
            else
            {
                lbl_CourseCode.Text      = "";
                lbl_Instructor.Text      = "";
                lbl_InstructorEmail.Text = "";
            }
        }
        public void bindmyattendancewrnigns()
        {
            int iCSem  = 0;
            int iCYear = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out iCSem);
            Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
            SqlConnection        sc = new SqlConnection(myConnection_String.Conn_string);
            //SqlCommand cmd = new SqlCommand("SELECT [strCourse],max([byteWarningType]) as max FROM [ECTData].[dbo].[Reg_Students_Warning] where intStudyYear=@intStudyYear and byteSemester=@byteSemester and lngStudentNumber=@lngStudentNumber GROUP BY [strCourse] order by strCourse", sc);
            SqlCommand cmd = new SqlCommand("SELECT iYear, Sem, Student, Course, Warning FROM  Warning_Both_Side WHERE (iYear = @intStudyYear) AND (Sem = @byteSemester) AND (Student=@lngStudentNumber) order by course asc", sc);

            cmd.Parameters.AddWithValue("@intStudyYear", iCYear);
            cmd.Parameters.AddWithValue("@byteSemester", iCSem);
            cmd.Parameters.AddWithValue("@lngStudentNumber", Session["CurrentStudent"].ToString());//BAM1906016 Session["CurrentStudent"].ToString()
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            try
            {
                sc.Open();
                da.Fill(dt);
                sc.Close();

                Repeater1.DataSource = dt;
                Repeater1.DataBind();
            }
            catch (Exception ex)
            {
                sc.Close();
                Console.WriteLine(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
Exemplo n.º 4
0
        public void getdetails()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);

            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            lbl_AcademicYear.Text = iYear.ToString();
            lbl_Semester.Text     = sSemester.ToString();

            string    studentid         = Session["CurrentStudent"].ToString();
            var       services          = new DAL.DAL();
            DataTable dtStudentServices = services.GetStudentDetailsID(studentid, connstr.Conn_string);

            if (dtStudentServices.Rows.Count > 0)
            {
                lbl_StudentName.Text    = dtStudentServices.Rows[0]["strLastDescEn"].ToString();
                lbl_StudentID.Text      = dtStudentServices.Rows[0]["lngStudentNumber"].ToString();
                lbl_StudentContact.Text = dtStudentServices.Rows[0]["Phone"].ToString();
                lbl_StudentEmail.Text   = dtStudentServices.Rows[0]["sECTemail"].ToString();
                hdf_StudentEmail.Value  = dtStudentServices.Rows[0]["sECTemail"].ToString();
            }
        }
        public void getsemesters()
        {
            var services = new DAL.DAL();
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int       iYear     = Year;
            int       iSem      = sem;
            string    studentid = Session["CurrentStudent"].ToString();
            DataTable dt        = services.GetSemestersbyTerm(iYear, iSem);

            if (dt.Rows.Count > 0)
            {
                drp_Semester.DataSource     = dt;
                drp_Semester.DataTextField  = "LongDesc";
                drp_Semester.DataValueField = "Term";
                drp_Semester.DataBind();

                drp_Semester.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Semester---", "---Select a Semester---"));
                drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---"));
            }
            else
            {
                drp_Semester.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Semester---", "---Select a Semester---"));
                drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---"));
            }
        }
Exemplo n.º 6
0
        public void getcourses()
        {
            var services = new DAL.DAL();
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int       iYear     = Year;
            int       iSem      = sem;
            string    studentid = Session["CurrentStudent"].ToString();
            DataTable dt        = services.GetCoursesbyStudentId(studentid, connstr.Conn_string, iYear, iSem);

            if (dt.Rows.Count > 0)
            {
                RepterDetails.DataSource = dt;
                RepterDetails.DataBind();

                //drp_Course.DataSource = dt;
                //drp_Course.DataTextField = "Course";
                //drp_Course.DataValueField = "Code";
                //drp_Course.DataBind();

                //drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---"));
            }
            //else
            //{
            //    drp_Course.Items.Insert(0, new System.Web.UI.WebControls.ListItem("---Select a Course---", "---Select a Course---"));
            //}
        }
        private void ExportStudentTimeTable()
        {
            ReportDocument myReport = new ReportDocument();

            try
            {
                DataSet rptDS = new DataSet();

                rptDS = (DataSet)Session["ReportDS"];

                string reportPath = Server.MapPath("Reports/StudentTimeTable_eBooksRPT.rpt");
                myReport.Load(reportPath);
                myReport.SetDataSource(rptDS);

                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int    iYear     = Year;
                int    iSem      = sem;
                string sSemester = LibraryMOD.GetSemesterString(iSem);

                int    iSemester = Convert.ToInt32("0" + iSem.ToString());
                int    iRegYear  = Convert.ToInt32("0" + iYear.ToString());
                string sNo       = Session["CurrentStudent"].ToString();

                TextObject txt;
                txt       = (TextObject)myReport.ReportDefinition.ReportObjects["txtTitle"];
                txt.Text  = GetCaption();
                txt.Text += "     -   Total Credit Hours: [ " + LibraryMOD.GetStudentRegisteredCredit(iRegYear, iSemester, sNo, Convert.ToInt32((InitializeModule.EnumCampus) this.Campus)).ToString() + " ]";

                txt      = (TextObject)myReport.ReportDefinition.ReportObjects["txtMajor"];
                txt.Text = LibraryMOD.GetStudentMajor(this.Campus, sNo);

                //string sSemester = LibraryMOD.GetSemesterString(iSemester);

                txt       = (TextObject)myReport.ReportDefinition.ReportObjects["txtAcademicYear"];
                txt.Text += " - " + iRegYear.ToString() + " / " + (iRegYear + 1).ToString() + " " + sSemester;



                txt = (TextObject)myReport.ReportDefinition.ReportObjects["UserTXT"];
                string sUserName = Session["CurrentUserName"].ToString();
                txt.Text = "/ " + sUserName;


                myReport.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Page.Response, true, "ECTReport");
            }
            catch (Exception exp)
            {
                Console.WriteLine("{0} Exception caught.", exp);
            }
            finally
            {
                myReport.Close();
                myReport.Dispose();
            }
        }
        public void getcourses()
        {
            var services = new DAL.DAL();
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int       iYear     = Year;
            int       iSem      = sem;
            string    studentid = Session["CurrentStudent"].ToString();
            DataTable dt        = services.GetCoursesbyStudentId(studentid, connstr.Conn_string, iYear, iSem);

            if (dt.Rows.Count > 0)
            {
                chk_Courses.DataSource     = dt;
                chk_Courses.DataTextField  = "Course";
                chk_Courses.DataValueField = "strLecturerDescEn";
                chk_Courses.DataBind();
            }
        }
Exemplo n.º 9
0
        public void getdetails()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);

            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            lbl_AcademicYear.Text = iYear.ToString();
            lbl_Semester.Text     = sSemester.ToString();

            string    studentid         = Session["CurrentStudent"].ToString();
            var       services          = new DAL.DAL();
            DataTable dtStudentServices = services.GetStudentDetailsIDbyNationality(studentid, connstr.Conn_string);

            if (dtStudentServices.Rows.Count > 0)
            {
                lbl_StudentName.Text        = dtStudentServices.Rows[0]["strLastDescEn"].ToString();
                lbl_StudentID.Text          = dtStudentServices.Rows[0]["lngStudentNumber"].ToString();
                txt_StudentContact1.Text    = dtStudentServices.Rows[0]["Phone"].ToString();
                lbl_StudentEmail.Text       = dtStudentServices.Rows[0]["sECTemail"].ToString();
                hdf_StudentEmail.Value      = dtStudentServices.Rows[0]["sECTemail"].ToString();
                lbl_Major.Text              = dtStudentServices.Rows[0]["strCaption"].ToString();
                lbl_GraduationSemester.Text = dtStudentServices.Rows[0]["byteGraduationSemester"].ToString();
                lbl_GraduationYear.Text     = dtStudentServices.Rows[0]["intGraduationYear"].ToString();
                lbl_DOB.Text = Convert.ToDateTime(dtStudentServices.Rows[0]["dateBirth"]).ToString("dd/MM/yyyy");
                string cancelreason = dtStudentServices.Rows[0]["byteCancelReason"].ToString();
                if (cancelreason != "3")
                {
                    div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                    lbl_Msg.Text         = "You are not allowed to generate this request at this time (Only for Graduated Students)";
                    lbl_Msg.Visible      = true;
                    div_msg.Visible      = true;
                    lnk_Generate.Enabled = false;
                }
            }
        }
        //protected void btnReset_Click(object sender, EventArgs e)
        //{

        //}
        public void loadstudentprofile()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            string    studentid          = Session["CurrentStudent"].ToString();
            var       services           = new DAL.DAL();
            DataTable dtStudentProfile   = services.GetStudentDetailsForProfile(studentid, connstr.Conn_string);
            string    sCampus            = Session["CurrentCampus"].ToString();

            if (dtStudentProfile.Rows.Count > 0)
            {
                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int    iYear     = Year;
                int    iSem      = sem;
                string sSemester = LibraryMOD.GetSemesterString(iSem);

                txt_AcademicYear.Text    = iYear.ToString();
                txt_CurrentSemester.Text = sSemester.ToString();

                txtFisrtName.Text    = dtStudentProfile.Rows[0]["strLastDescEn"].ToString();
                txtDateofBirth.Text  = Convert.ToDateTime(dtStudentProfile.Rows[0]["dateBirth"]).ToString("dd/MM/yyyy");
                txtEmail.Text        = dtStudentProfile.Rows[0]["sECTemail"].ToString();
                txtPhoneNumber.Text  = dtStudentProfile.Rows[0]["Phone"].ToString();
                txt_StudentID.Text   = dtStudentProfile.Rows[0]["lngStudentNumber"].ToString();
                txt_Major.Text       = dtStudentProfile.Rows[0]["strCaption"].ToString();
                txt_Nationality.Text = dtStudentProfile.Rows[0]["strNationalityDescEn"].ToString();
                string sPic = dtStudentProfile.Rows[0]["strStudentPic"].ToString();
                hdfiUnifiedID.Value = dtStudentProfile.Rows[0]["iUnifiedID"].ToString();
                string sDir = "Students";
                if (sCampus == "Males")
                {
                    txt_Gender.Text = "Male";
                }
                else
                {
                    txt_Gender.Text = "Female";
                }
            }
        }
        private void Retrieve()
        {
            List <TimeTable> myTimeTables   = new List <TimeTable>();
            TimeTableDAL     myTimeTableDAL = new TimeTableDAL();
            DataSet          Ds             = new DataSet();

            try
            {
                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int    iYear     = Year;
                int    iSem      = sem;
                string sSemester = LibraryMOD.GetSemesterString(iSem);

                string sStudentNumber = this.sNo;

                int iSemester = Convert.ToInt32("0" + iSem.ToString());
                int iRegYear  = Convert.ToInt32("0" + iYear.ToString());

                lbl_TitleYearSem.Text  = " - " + iRegYear.ToString() + " / " + (iRegYear + 1).ToString() + " " + sSemester;
                lbl_TitleStudent.Text  = GetCaption();
                lbl_TitleStudent.Text += "     -   Total Credit Hours: [ " + LibraryMOD.GetStudentRegisteredCredit(iRegYear, iSemester, sNo, Convert.ToInt32((InitializeModule.EnumCampus) this.Campus)).ToString() + " ]";
                lbl_TitleMajor.Text    = LibraryMOD.GetStudentMajor(this.Campus, sNo);

                myTimeTables = myTimeTableDAL.GetStudentTimeTable(sStudentNumber, iYear, iSem, this.Campus);
                Ds           = Prepare_TimeTable_Report(myTimeTables);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0} Exception caught.", ex.Message);
            }
            finally
            {
                Session["ReportDS"] = Ds;
            }
        }
Exemplo n.º 12
0
        public void getdetails()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            lbl_AcademicYear.Text = iYear.ToString();
            lbl_Semester.Text     = sSemester.ToString();

            string    studentid         = Session["CurrentStudent"].ToString();
            var       services          = new DAL.DAL();
            DataTable dtStudentServices = services.GetStudentDetailsID(studentid, connstr.Conn_string);

            if (dtStudentServices.Rows.Count > 0)
            {
                lbl_StudentName.Text    = dtStudentServices.Rows[0]["strLastDescEn"].ToString();
                lbl_StudentID.Text      = dtStudentServices.Rows[0]["lngStudentNumber"].ToString();
                lbl_StudentContact.Text = dtStudentServices.Rows[0]["Phone"].ToString();
                lbl_StudentEmail.Text   = dtStudentServices.Rows[0]["sECTemail"].ToString();
                hdf_StudentEmail.Value  = dtStudentServices.Rows[0]["sECTemail"].ToString();
                lbl_CurrentMajor.Text   = dtStudentServices.Rows[0]["strCaption"].ToString();
                if (dtStudentServices.Rows[0]["strDegree"].ToString() == "2")
                {
                    //Not allowed for remedial students
                    div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                    lbl_Msg.Text         = "You are not allowed to generate this request at this time (Not allowed for remedial students).";
                    lbl_Msg.Visible      = true;
                    div_msg.Visible      = true;
                    lnk_Generate.Enabled = false;
                    return;
                }
            }
        }
Exemplo n.º 13
0
        public void sentdatatoSPLIst()
        {
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            string login          = "******"; //give your username here
            string password       = "******";                 //give your password
            var    securePassword = new SecureString();

            foreach (char c in password)
            {
                securePassword.AppendChar(c);
            }
            string        siteUrl       = "https://ectacae.sharepoint.com/sites/ECTPortal/eservices/studentservices";
            ClientContext clientContext = new ClientContext(siteUrl);

            Microsoft.SharePoint.Client.List myList   = clientContext.Web.Lists.GetByTitle("Students_Requests");
            ListItemCreationInformation      itemInfo = new ListItemCreationInformation();

            Microsoft.SharePoint.Client.ListItem myItem = myList.AddItem(itemInfo);
            string refno = Create16DigitString();

            myItem["Title"] = refno;
            //myItem["RequestID"] = refno;
            myItem["Year"]        = iYear;
            myItem["Semester"]    = iSem;
            myItem["Request"]     = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " )";
            myItem["RequestNote"] = txt_Remarks.Text.Trim();
            myItem["ServiceID"]   = lbl_ServiceID.Text;
            myItem["Fees"]        = hdf_Price.Value;
            //myItem["Requester"] = clientContext.Web.EnsureUser(hdf_StudentEmail.Value);
            myItem["Requester"]     = clientContext.Web.EnsureUser("*****@*****.**");
            myItem["StudentID"]     = lbl_StudentID.Text;
            myItem["StudentName"]   = lbl_StudentName.Text;
            myItem["Contact"]       = lbl_StudentContact.Text;
            myItem["Finance"]       = clientContext.Web.EnsureUser("*****@*****.**");
            myItem["FinanceAction"] = "Initiate";
            myItem["FinanceNote"]   = "";
            myItem["Host"]          = clientContext.Web.EnsureUser("*****@*****.**");
            myItem["HostAction"]    = "Initiate";
            myItem["HostNote"]      = "";
            //myItem["Provider"] = "";
            myItem["ProviderAction"] = "Initiate";
            myItem["ProviderNote"]   = "";
            myItem["Status"]         = "Finance Approval Needed";
            //myItem["Modified"] = DateTime.Now;
            //myItem["Created"] = DateTime.Now;
            //myItem["Created By"] = hdf_StudentEmail.Value;
            //myItem["Modified By"] = hdf_StudentEmail.Value;
            try
            {
                myItem.Update();

                //if (flp_Upload.HasFile)
                //{
                //    var attachment = new AttachmentCreationInformation();

                //    flp_Upload.SaveAs(Server.MapPath("~/Upload/" + flp_Upload.FileName));
                //    string FileUrl = Server.MapPath("~/Upload/" + flp_Upload.FileName);

                //    string filePath = FileUrl;
                //    attachment.FileName = Path.GetFileName(filePath);
                //    attachment.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(filePath));
                //    Attachment att = myItem.AttachmentFiles.Add(attachment);
                //}

                var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
                clientContext.Credentials = onlineCredentials;
                clientContext.ExecuteQuery();

                //string FileUrls = Server.MapPath("~/Upload/" + flp_Upload.FileName);
                //System.IO.File.Delete(FileUrls);

                lbl_Msg.Text         = "Request (ID# " + refno + ") Generated Successfully";
                lbl_Msg.Visible      = true;
                div_msg.Visible      = true;
                lnk_Generate.Enabled = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            //Console.ReadLine();
        }
Exemplo n.º 14
0
        protected void lnk_Generate_Click(object sender, EventArgs e)
        {
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);
            string refno     = Create16DigitString();
            string sACC      = "0200000";

            if (Session["CurrentCampus"].ToString() == "Males")
            {
                sACC = "0100000";
            }
            else
            {
                sACC = "0200000";
            }

            string languageoption = "";

            if (Session["LanguageOption"].ToString() == "True")
            {
                languageoption = "<b>Language:</b> " + ddlLanguage.SelectedItem.Text + "";
            }

            // Create a DataTable
            DataTable dtSPList = new DataTable();

            dtSPList.Clear();
            dtSPList.Columns.Add("Title");
            dtSPList.Columns.Add("Year");
            dtSPList.Columns.Add("Semester");
            dtSPList.Columns.Add("Request");
            dtSPList.Columns.Add("RequestNote");
            dtSPList.Columns.Add("ServiceID");
            dtSPList.Columns.Add("Fees");
            dtSPList.Columns.Add("Requester");
            dtSPList.Columns.Add("StudentID");
            dtSPList.Columns.Add("StudentName");
            dtSPList.Columns.Add("Contact");
            dtSPList.Columns.Add("Finance");
            dtSPList.Columns.Add("FinanceAction");
            dtSPList.Columns.Add("FinanceNote");
            dtSPList.Columns.Add("Host");
            dtSPList.Columns.Add("HostAction");
            dtSPList.Columns.Add("HostNote");
            dtSPList.Columns.Add("ProviderAction");
            dtSPList.Columns.Add("ProviderNote");
            dtSPList.Columns.Add("Status");

            // Add items using Add method
            DataRow dr = dtSPList.NewRow();

            dr["Title"]          = refno;
            dr["Year"]           = iYear;
            dr["Semester"]       = iSem;
            dr["Request"]        = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " ) <br/>" + languageoption + "<br/>";
            dr["RequestNote"]    = txt_Remarks.Text.Trim();
            dr["ServiceID"]      = lbl_ServiceID.Text;
            dr["Fees"]           = hdf_Price.Value;
            dr["Requester"]      = hdf_StudentEmail.Value;
            dr["StudentID"]      = lbl_StudentID.Text;
            dr["StudentName"]    = lbl_StudentName.Text;
            dr["Contact"]        = lbl_StudentContact.Text;
            dr["Finance"]        = Session["FinanceEmail"].ToString();
            dr["FinanceAction"]  = "Initiate";
            dr["FinanceNote"]    = "";
            dr["Host"]           = Session["HostEmail"].ToString();
            dr["HostAction"]     = "Initiate";
            dr["HostNote"]       = "";
            dr["ProviderAction"] = "Initiate";
            dr["ProviderNote"]   = "";
            dr["Status"]         = "Finance Approval Needed";
            dtSPList.Rows.Add(dr);

            //sentdatatoSPLIst();

            Session["CurrentService"]       = "Student Services: " + lbl_ServiceID.Text + "";
            Session["CurrentServiceName"]   = lbl_ServiceNameEn.Text;
            Session["CurrentServiceAmount"] = string.Format("{0:f}", hdf_Price.Value);
            Session["CurrentdtSPList"]      = dtSPList;
            Session["CurrentAccount"]       = sACC;
            Session["cancelpage"]           = "ECT_SAR_SREG_FRM_021.aspx?ServiceID=" + lbl_ServiceID.Text + "";
            Response.Redirect("Student_Services_HostedPayment.aspx");
        }
Exemplo n.º 15
0
        public void getdetails()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            lbl_AcademicYear.Text = iYear.ToString();
            lbl_Semester.Text     = sSemester.ToString();

            InitializeModule.EnumCampus CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            string  sSID    = Session["CurrentStudent"].ToString();
            decimal dAmount = LibraryMOD.GetStudentUptodateBalanceBTS(sSID, CurrentCampus);

            lbl_Balance.Text = string.Format("{0:f}", dAmount);

            string    studentid         = Session["CurrentStudent"].ToString();
            var       services          = new DAL.DAL();
            DataTable dtStudentServices = services.GetStudentDetailsID(studentid, connstr.Conn_string);

            if (dtStudentServices.Rows.Count > 0)
            {
                lbl_StudentName.Text    = dtStudentServices.Rows[0]["strLastDescEn"].ToString();
                lbl_StudentID.Text      = dtStudentServices.Rows[0]["lngStudentNumber"].ToString();
                lbl_StudentContact.Text = dtStudentServices.Rows[0]["Phone"].ToString();
                lbl_StudentEmail.Text   = dtStudentServices.Rows[0]["sECTemail"].ToString();
                hdf_StudentEmail.Value  = dtStudentServices.Rows[0]["sECTemail"].ToString();

                string cancelreason = dtStudentServices.Rows[0]["byteCancelReason"].ToString();

                if (lbl_ServiceID.Text == "1004")//Service # 1004 this must be for graduated and expected to Graduate only
                {
                    //lbl_En.Text = "Graduation Letter";
                    //lbl_Ar.Text = "طلب افادة تخرج";
                    //Non-Graduated Students Check
                    if (cancelreason != "3" && cancelreason != "25")
                    {
                        div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                        lbl_Msg.Text         = "You are not allowed to generate this request at this time (Only for Graduated and Expected to Graduate Students).";
                        lbl_Msg.Visible      = true;
                        div_msg.Visible      = true;
                        hyp_Paynow.Visible   = false;
                        lnk_Generate.Enabled = false;
                    }
                    else
                    {
                        //If Graduated Checking the Uptodate Balance. If balance <=0 then allow to proceed else proceed for payment.
                        InitializeModule.EnumCampus CurrentCampus1 = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                        string  sSID1    = Session["CurrentStudent"].ToString();
                        decimal dAmount1 = LibraryMOD.GetStudentUptodateBalanceBTS(sSID1, CurrentCampus1);
                        lbl_Balance.Text = string.Format("{0:f}", dAmount1);
                        if (dAmount1 <= 0)
                        {
                            //Proceed for Request Generation
                        }
                        else
                        {
                            div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                            lbl_Msg.Text           = "You are not allowed to generate this request at this time (UpToDate Balance: AED " + string.Format("{0:f}", dAmount1) + " is pending.)";
                            lbl_Msg.Visible        = true;
                            div_msg.Visible        = true;
                            hyp_Paynow.Visible     = true;
                            hyp_Paynow.NavigateUrl = "Balance?amt=" + string.Format("{0:f}", dAmount1) + "";
                            lnk_Generate.Enabled   = false;
                        }
                    }
                }
                else
                {
                    //Non-Graduated Students Check
                    //if (cancelreason != "3")
                    //{
                    //    div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                    //    lbl_Msg.Text = "You are not allowed to generate this request at this time (Only for Graduated Students)";
                    //    lbl_Msg.Visible = true;
                    //    div_msg.Visible = true;
                    //    hyp_Paynow.Visible = false;
                    //    lnk_Generate.Enabled = false;
                    //}
                    //else
                    //{
                    //If Graduated Checking the Uptodate Balance. If balance <=0 then allow to proceed else proceed for payment.
                    InitializeModule.EnumCampus CurrentCampus1 = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                    string  sSID1    = Session["CurrentStudent"].ToString();
                    decimal dAmount1 = LibraryMOD.GetStudentUptodateBalanceBTS(sSID1, CurrentCampus1);
                    lbl_Balance.Text = string.Format("{0:f}", dAmount1);
                    if (dAmount1 <= 0)
                    {
                        //Proceed for Request Generation
                    }
                    else
                    {
                        div_Alert.Attributes["class"] = "alert alert-danger alert-dismissible ";
                        lbl_Msg.Text           = "You are not allowed to generate this request at this time (UpToDate Balance: AED " + string.Format("{0:f}", dAmount1) + " is pending.)";
                        lbl_Msg.Visible        = true;
                        div_msg.Visible        = true;
                        hyp_Paynow.Visible     = true;
                        hyp_Paynow.NavigateUrl = "Balance?amt=" + string.Format("{0:f}", dAmount1) + "";
                        lnk_Generate.Enabled   = false;
                    }
                    //}
                }
                //if (lbl_ServiceID.Text == "1005")
                //{
                //    lbl_En.Text = "Transcript";
                //    lbl_Ar.Text = "طلب كشف علامات";
                //}
            }
        }
Exemplo n.º 16
0
        protected void lnk_Generate_Click(object sender, EventArgs e)
        {
            if (drp_Course.SelectedItem.Value != "---Select a Course---")
            {
                //sentdatatoSPLIst();
                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int    iYear     = Year;
                int    iSem      = sem;
                string sSemester = LibraryMOD.GetSemesterString(iSem);
                string refno     = Create16DigitString();
                string sACC      = "0200000";
                if (Session["CurrentCampus"].ToString() == "Males")
                {
                    sACC = "0100000";
                }
                else
                {
                    sACC = "0200000";
                }

                string languageoption = "";
                if (Session["LanguageOption"].ToString() == "True")
                {
                    languageoption = "<b>Language:</b> " + ddlLanguage.SelectedItem.Text + "";
                }

                // Create a DataTable
                DataTable dtSPList = new DataTable();
                dtSPList.Clear();
                dtSPList.Columns.Add("Title");
                dtSPList.Columns.Add("Year");
                dtSPList.Columns.Add("Semester");
                dtSPList.Columns.Add("Request");
                dtSPList.Columns.Add("RequestNote");
                dtSPList.Columns.Add("ServiceID");
                dtSPList.Columns.Add("Fees");
                dtSPList.Columns.Add("Requester");
                dtSPList.Columns.Add("StudentID");
                dtSPList.Columns.Add("StudentName");
                dtSPList.Columns.Add("Contact");
                dtSPList.Columns.Add("Finance");
                dtSPList.Columns.Add("FinanceAction");
                dtSPList.Columns.Add("FinanceNote");
                dtSPList.Columns.Add("Host");
                dtSPList.Columns.Add("HostAction");
                dtSPList.Columns.Add("HostNote");
                dtSPList.Columns.Add("ProviderAction");
                dtSPList.Columns.Add("ProviderNote");
                dtSPList.Columns.Add("Status");

                // Add items using Add method
                DataRow dr = dtSPList.NewRow();
                dr["Title"]          = refno;
                dr["Year"]           = iYear;
                dr["Semester"]       = iSem;
                dr["Request"]        = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " )<br/><b>Major:</b> " + lbl_CurrentMajor.Text + "<br/><b>Course Semester:</b> " + drp_Semester.SelectedItem.Text + "<br/><b>Course Title:</b> " + drp_Course.SelectedItem.Text + "<br/><b>Course Code:</b> " + lbl_CourseCode.Text + "<br/><b>Instructor’s Name:</b> " + lbl_Instructor.Text + "<br/><b>Request Details:</b> " + txt_Remarks.Text.Trim() + "<br/>" + languageoption + "<br/>";
                dr["RequestNote"]    = txt_Remarks.Text.Trim();
                dr["ServiceID"]      = lbl_ServiceID.Text;
                dr["Fees"]           = hdf_Price.Value;
                dr["Requester"]      = hdf_StudentEmail.Value;
                dr["StudentID"]      = lbl_StudentID.Text;
                dr["StudentName"]    = lbl_StudentName.Text;
                dr["Contact"]        = lbl_StudentContact.Text;
                dr["Finance"]        = Session["FinanceEmail"].ToString();
                dr["FinanceAction"]  = "Initiate";
                dr["FinanceNote"]    = "";
                dr["Host"]           = Session["HostEmail"].ToString();
                dr["HostAction"]     = "Initiate";
                dr["HostNote"]       = "";
                dr["ProviderAction"] = "Initiate";
                dr["ProviderNote"]   = "";
                dr["Status"]         = "Finance Approval Needed";
                dtSPList.Rows.Add(dr);

                //sentdatatoSPLIst();

                if (flp_Upload.HasFile)
                {
                    //var attachment = new AttachmentCreationInformation();

                    flp_Upload.SaveAs(Server.MapPath("~/Upload/" + flp_Upload.FileName));
                    string FileUrl = Server.MapPath("~/Upload/" + flp_Upload.FileName);
                    Session["filePath"] = FileUrl;

                    //string filePath = FileUrl;
                    //attachment.FileName = Path.GetFileName(filePath);
                    //attachment.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(filePath));
                    //Attachment att = myItem.AttachmentFiles.Add(attachment);
                }

                Session["CurrentService"]       = "Student Services: " + lbl_ServiceID.Text + "";
                Session["CurrentServiceName"]   = lbl_ServiceNameEn.Text;
                Session["CurrentServiceAmount"] = string.Format("{0:f}", hdf_Price.Value);
                Session["CurrentdtSPList"]      = dtSPList;
                Session["CurrentAccount"]       = sACC;
                Session["cancelpage"]           = "ECT_SAR_SARO_FRM_018.aspx?ServiceID=" + lbl_ServiceID.Text + "";
                Response.Redirect("Student_Services_HostedPayment.aspx");
            }
        }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["CurrentURL"] = HttpContext.Current.Request.Url.AbsoluteUri;
            if (Session["isRunning"] != null)
            {
                if (Convert.ToInt32(Session["isRunning"]) == 0)
                {
                    //setlogin();
                    //return;
                    //showErr("Session is expired, Login again please...");
                    ClearSession();
                    Response.Redirect("Login.aspx");
                }
            }
            else
            {
                // showErr("Session is expired, Login again please...");
                ClearSession();
                Response.Redirect("Login.aspx");
            }
            if (Session["CurrentCampus"] != null)
            {
                string sCampus = Session["CurrentCampus"].ToString();
                Campus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                //Campus_ddl.SelectedValue = ((int)Campus).ToString();
                string sConn = "";
                Connection_StringCLS ConnectionString;
                switch (Campus)
                {
                case InitializeModule.EnumCampus.Males:
                    ConnectionString = new Connection_StringCLS(InitializeModule.EnumCampus.Males);
                    sConn            = ConnectionString.Conn_string;
                    break;

                case InitializeModule.EnumCampus.Females:
                    ConnectionString = new Connection_StringCLS(InitializeModule.EnumCampus.Females);
                    sConn            = ConnectionString.Conn_string;
                    break;
                }
            }

            if (!IsPostBack)
            {
                //Session.RemoveAll();

                int iRSem  = 0;
                int iRYear = LibraryMOD.SeperateTerm(LibraryMOD.GetRegTerm(), out iRSem);

                Session["RegYear"]     = iRYear;
                Session["RegSemester"] = iRSem;

                int iCSem  = 0;
                int iCYear = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out iCSem);
                Session["CurrentYear"]     = iCYear;
                Session["CurrentSemester"] = iCSem;

                Generate_Menu();
                if (Session["CurrentStudentName"] == null)
                {
                    Session["CurrentStudentName"] = "Student";
                }
                lblUser.Text  = Session["CurrentStudentName"].ToString();
                lblUser1.Text = Session["CurrentStudentName"].ToString();
                //if (Session["CurrentStudent"] == null)
                //{

                //}
                //else
                //{
                getprofilepic();
                //}
            }



            if (Session["MainRoot"] != null)
            {
                // myRoot = (TreeNode)Session["MainRoot"];
            }
            if (Session["CurrentUserName"] != null)
            {
                //lnkLogin.Text = "Logout";
            }
            else
            {
                //lnkLogin.Text = "Login";
            }
        }
Exemplo n.º 18
0
        public void loadstudentprofile()
        {
            Connection_StringCLS connstr = new Connection_StringCLS(Campus);
            string    studentid          = Session["CurrentStudent"].ToString();
            var       services           = new DAL.DAL();
            DataTable dtStudentProfile   = services.GetStudentDetailsForProfile(studentid, connstr.Conn_string);
            string    sCampus            = Session["CurrentCampus"].ToString();

            if (dtStudentProfile.Rows.Count > 0)
            {
                int sem  = 0;
                int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

                int    iYear     = Year;
                int    iSem      = sem;
                string sSemester = LibraryMOD.GetSemesterString(iSem);

                //txt_AcademicYear.Text = iYear.ToString();
                //txt_CurrentSemester.Text = sSemester.ToString();

                //txtFisrtName.Text = dtStudentProfile.Rows[0]["strLastDescEn"].ToString();
                //txtDateofBirth.Text = Convert.ToDateTime(dtStudentProfile.Rows[0]["dateBirth"]).ToString("dd/MM/yyyy");
                lbl_Email_ID.Text = dtStudentProfile.Rows[0]["sECTemail"].ToString();
                //txtPhoneNumber.Text = dtStudentProfile.Rows[0]["Phone"].ToString();
                lbl_Student_ID.Text    = dtStudentProfile.Rows[0]["lngStudentNumber"].ToString();
                lbl_Current_Major.Text = dtStudentProfile.Rows[0]["strCaption"].ToString();


                string acceptance_type      = "";
                string acceptance_condition = "";

                if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "1")
                {
                    acceptance_type = "Permanently Accepted";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "2")
                {
                    acceptance_type = "One Academic Semester(Conditional)";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "3")
                {
                    acceptance_type = "Two Academic Semesters(Conditional)";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceType"].ToString() == "4")
                {
                    acceptance_type = "One Academic Year(Conditional)";
                }

                if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "1")
                {
                    acceptance_condition = "All conditions have been met";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "2")
                {
                    acceptance_condition = "High school equivalency needed";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "3")
                {
                    acceptance_condition = "EmSAT needed";
                }
                else if (dtStudentProfile.Rows[0]["iAcceptanceCondition"].ToString() == "4")
                {
                    acceptance_condition = "Major requirements are not met";
                }

                lbl_Acceptance_Type.Text      = acceptance_type;
                lbl_Acceptance_Condition.Text = acceptance_condition;

                Session["Student_AT"] = acceptance_type;
                Session["Student_AC"] = acceptance_condition;

                if (dtStudentProfile.Rows[0]["byteCancelReason"].ToString() == "")
                {
                    lbl_Status.Text = "Active";
                }
                else
                {
                    SqlConnection sc  = new SqlConnection(connstr.Conn_string);
                    SqlCommand    cmd = new SqlCommand("select strReasonDesc from Lkp_Reasons where byteReason=@byteReason", sc);
                    cmd.Parameters.AddWithValue("@byteReason", dtStudentProfile.Rows[0]["byteCancelReason"].ToString());
                    DataTable      dt = new DataTable();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    try
                    {
                        sc.Open();
                        da.Fill(dt);
                        sc.Close();

                        if (dt.Rows.Count > 0)
                        {
                            lbl_Status.Text = dt.Rows[0]["strReasonDesc"].ToString();;
                        }
                        else
                        {
                            lbl_Status.Text = "Active";
                        }
                    }
                    catch (Exception ex)
                    {
                        sc.Close();
                        Console.WriteLine(ex.Message);
                    }
                    finally
                    {
                        sc.Close();
                    }
                }


                //txt_Nationality.Text = dtStudentProfile.Rows[0]["strNationalityDescEn"].ToString();
                //string sPic = dtStudentProfile.Rows[0]["strStudentPic"].ToString();
                //hdfiUnifiedID.Value = dtStudentProfile.Rows[0]["iUnifiedID"].ToString();
                //string sDir = "Students";
                //if (sCampus == "Males")
                //{
                //    txt_Gender.Text = "Male";
                //}
                //else
                //{
                //    txt_Gender.Text = "Female";
                //}
            }
        }
        public void sentdatatoSPLIst()
        {
            string careeractivities = "";
            string otheractivities  = "";
            string prefereddays     = "";
            string preferedtime     = "";
            string k = "";

            for (int i = 0; i < chk_CareerActivities.Items.Count; i++)
            {
                if (chk_CareerActivities.Items[i].Selected)
                {
                    k = k + chk_CareerActivities.Items[i].Value + ";";
                }
            }
            careeractivities = k;

            string j = "";

            for (int n = 0; n < chk_OtherActivities.Items.Count; n++)
            {
                if (chk_OtherActivities.Items[n].Selected)
                {
                    j = j + chk_OtherActivities.Items[n].Value + ";";
                }
            }
            otheractivities = j;

            string a = "";

            for (int q = 0; q < chk_PreferedDays.Items.Count; q++)
            {
                if (chk_PreferedDays.Items[q].Selected)
                {
                    a = a + chk_PreferedDays.Items[q].Value + ";";
                }
            }
            prefereddays = a;

            preferedtime = "From: " + Convert.ToDateTime(txt_From.Text).ToString("hh:mm tt") + " To: " + Convert.ToDateTime(txt_To.Text).ToString("hh:mm tt") + "";

            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            string languageoption = "";

            if (Session["LanguageOption"].ToString() == "True")
            {
                languageoption = "<b>Language:</b> " + ddlLanguage.SelectedItem.Text + "";
            }

            string login          = "******"; //give your username here
            string password       = "******";                 //give your password
            var    securePassword = new SecureString();

            foreach (char c in password)
            {
                securePassword.AppendChar(c);
            }
            string        siteUrl       = "https://ectacae.sharepoint.com/sites/ECTPortal/eservices/studentservices";
            ClientContext clientContext = new ClientContext(siteUrl);

            Microsoft.SharePoint.Client.List myList   = clientContext.Web.Lists.GetByTitle("Students_Requests");
            ListItemCreationInformation      itemInfo = new ListItemCreationInformation();

            Microsoft.SharePoint.Client.ListItem myItem = myList.AddItem(itemInfo);
            string refno = Create16DigitString();

            myItem["Title"] = refno;
            //myItem["RequestID"] = refno;
            myItem["Year"]        = iYear;
            myItem["Semester"]    = iSem;
            myItem["Request"]     = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " )<br/><b>Major:</b> " + lbl_Major.Text + "<br/><b>Student Contact #:</b> " + lbl_StudentContact.Text + "<br/><b>Career Development Activities (Workshop/Seminar):</b> " + careeractivities + "<br/><b>Career Service:</b> " + otheractivities + "<br/><b>Comments:</b> " + txt_Comments.Text + "<br/><b>Prefered Timing:</b> " + preferedtime + "<br/><b>Prefered Days:</b> " + prefereddays + "<br/><b>Other Suggestion for Alumni services & Activities:</b> " + txt_Remarks.Text + "<br/>" + languageoption + "<br/>";
            myItem["RequestNote"] = txt_Remarks.Text.Trim();
            myItem["ServiceID"]   = lbl_ServiceID.Text;
            myItem["Fees"]        = hdf_Price.Value;
            myItem["Requester"]   = clientContext.Web.EnsureUser(hdf_StudentEmail.Value);
            //myItem["Requester"] = clientContext.Web.EnsureUser("*****@*****.**");
            myItem["StudentID"]     = lbl_StudentID.Text;
            myItem["StudentName"]   = lbl_StudentName.Text;
            myItem["Contact"]       = lbl_StudentContact.Text;
            myItem["Finance"]       = clientContext.Web.EnsureUser(Session["FinanceEmail"].ToString());
            myItem["FinanceAction"] = "Initiate";
            myItem["FinanceNote"]   = "";
            myItem["Host"]          = clientContext.Web.EnsureUser(Session["HostEmail"].ToString());//Session["HostEmail"].ToString();
            myItem["HostAction"]    = "Initiate";
            myItem["HostNote"]      = "";
            //myItem["Provider"] = "";
            myItem["ProviderAction"] = "Initiate";
            myItem["ProviderNote"]   = "";
            myItem["Status"]         = "Finance Approval Needed";
            //myItem["Modified"] = DateTime.Now;
            //myItem["Created"] = DateTime.Now;
            //myItem["Created By"] = hdf_StudentEmail.Value;
            //myItem["Modified By"] = hdf_StudentEmail.Value;
            try
            {
                myItem.Update();

                //if (flp_Upload.HasFile)
                //{
                //    var attachment = new AttachmentCreationInformation();

                //    flp_Upload.SaveAs(Server.MapPath("~/Upload/" + flp_Upload.FileName));
                //    string FileUrl = Server.MapPath("~/Upload/" + flp_Upload.FileName);

                //    string filePath = FileUrl;
                //    attachment.FileName = Path.GetFileName(filePath);
                //    attachment.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(filePath));
                //    Attachment att = myItem.AttachmentFiles.Add(attachment);
                //}

                var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
                clientContext.Credentials = onlineCredentials;
                clientContext.ExecuteQuery();

                //string FileUrls = Server.MapPath("~/Upload/" + flp_Upload.FileName);
                //System.IO.File.Delete(FileUrls);

                lbl_Msg.Text         = "Request (ID# " + refno + ") Generated Successfully";
                lbl_Msg.Visible      = true;
                div_msg.Visible      = true;
                lnk_Generate.Enabled = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            //Console.ReadLine();
        }
        public void sentdatatoSPLIst()
        {
            string Dates = "<b>From:</b> " + Convert.ToDateTime(txt_From.Text).ToString("dd/MM/yyyy") + "&nbsp;&nbsp;&nbsp;<b>To:</b> " + Convert.ToDateTime(txt_To.Text).ToString("dd/MM/yyyy") + "";
            string letterrequestStatus = "No";

            if (chk_Request.Checked == true)
            {
                letterrequestStatus = "Yes";
            }
            else
            {
                letterrequestStatus = "No";
            }

            String requestedletters = "";
            string k = "";

            for (int i = 0; i < chk_Courses.Items.Count; i++)
            {
                if (chk_Courses.Items[i].Selected)
                {
                    k = k + "<b>Course Code:</b> " + chk_Courses.Items[i].Text + "&nbsp;&nbsp;&nbsp;<b>Instructor:</b> " + chk_Courses.Items[i].Value + "<br/>";
                }
            }
            requestedletters = k;

            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);

            string languageoption = "";

            if (Session["LanguageOption"].ToString() == "True")
            {
                languageoption = "<b>Language:</b> " + ddlLanguage.SelectedItem.Text + "";
            }

            string login          = "******"; //give your username here
            string password       = "******";                 //give your password
            var    securePassword = new SecureString();

            foreach (char c in password)
            {
                securePassword.AppendChar(c);
            }
            string        siteUrl       = "https://ectacae.sharepoint.com/sites/ECTPortal/eservices/studentservices";
            ClientContext clientContext = new ClientContext(siteUrl);

            Microsoft.SharePoint.Client.List myList   = clientContext.Web.Lists.GetByTitle("Students_Requests");
            ListItemCreationInformation      itemInfo = new ListItemCreationInformation();

            Microsoft.SharePoint.Client.ListItem myItem = myList.AddItem(itemInfo);
            string refno = Create16DigitString();

            myItem["Title"] = refno;
            //myItem["RequestID"] = refno;
            myItem["Year"]        = iYear;
            myItem["Semester"]    = iSem;
            myItem["Request"]     = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " )<br/><b>Major:</b> " + lbl_CurrentMajor.Text + "<br/><b>Excuse Dates:</b> " + Dates + "<br/><b>Re-examination letter requested:</b> " + letterrequestStatus + "<br/><b>Requested Letters:</b><br/>" + requestedletters + "<br/>" + languageoption + "<br/>";
            myItem["RequestNote"] = txt_Remarks.Text.Trim();
            myItem["ServiceID"]   = lbl_ServiceID.Text;
            myItem["Fees"]        = hdf_Price.Value;
            myItem["Requester"]   = clientContext.Web.EnsureUser(hdf_StudentEmail.Value);
            //myItem["Requester"] = clientContext.Web.EnsureUser("*****@*****.**");
            myItem["StudentID"]     = lbl_StudentID.Text;
            myItem["StudentName"]   = lbl_StudentName.Text;
            myItem["Contact"]       = lbl_StudentContact.Text;
            myItem["Finance"]       = clientContext.Web.EnsureUser(Session["FinanceEmail"].ToString());
            myItem["FinanceAction"] = "Initiate";
            myItem["FinanceNote"]   = "";
            myItem["Host"]          = clientContext.Web.EnsureUser(Session["HostEmail"].ToString());//Session["HostEmail"].ToString();
            myItem["HostAction"]    = "Initiate";
            myItem["HostNote"]      = "";
            //myItem["Provider"] = "";
            myItem["ProviderAction"] = "Initiate";
            myItem["ProviderNote"]   = "";
            myItem["Status"]         = "Finance Approval Needed";
            //myItem["Modified"] = DateTime.Now;
            //myItem["Created"] = DateTime.Now;
            //myItem["Created By"] = hdf_StudentEmail.Value;
            //myItem["Modified By"] = hdf_StudentEmail.Value;
            try
            {
                myItem.Update();

                if (flp_Upload.HasFile)
                {
                    var attachment = new AttachmentCreationInformation();

                    flp_Upload.SaveAs(Server.MapPath("~/Upload/" + flp_Upload.FileName));
                    string FileUrl = Server.MapPath("~/Upload/" + flp_Upload.FileName);

                    string filePath = FileUrl;
                    attachment.FileName      = Path.GetFileName(filePath);
                    attachment.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(filePath));
                    Attachment att = myItem.AttachmentFiles.Add(attachment);
                }

                var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
                clientContext.Credentials = onlineCredentials;
                clientContext.ExecuteQuery();
                if (flp_Upload.HasFile)
                {
                    string FileUrls = Server.MapPath("~/Upload/" + flp_Upload.FileName);
                    System.IO.File.Delete(FileUrls);
                }
                lbl_Msg.Text         = "Request (ID# " + refno + ") Generated Successfully";
                lbl_Msg.Visible      = true;
                div_msg.Visible      = true;
                lnk_Generate.Enabled = false;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            //Console.ReadLine();
        }
Exemplo n.º 21
0
        protected void lnk_Generate_Click(object sender, EventArgs e)
        {
            string header  = "<table style='width: 100 %; border: 1px solid #000' align='center'  id='tblContacts'><tbody><tr><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Has an Exam in<br>(لديه لديها امتحان في مادة)</b></td><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Course Code<br>(رمز المادة)</b></td><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Instructor’s Name<br>(اســم مدرس المادة)</b></td><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Exam Day<br>(يوم الامتحان)</b></td><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Exam Date <br>(الموافق لتاريخ)</b></td><td align='center' style='background-color: #f2f2f2; color: #000;'><b>Time of Exam <br>(الساعة)</b></td></tr>";
            string request = "";
            string footer  = "</tbody></table>";

            foreach (RepeaterItem item in RepterDetails.Items)
            {
                if (((CheckBox)item.FindControl("chk")).Checked)
                {
                    //Do something
                    var    lbl_exam       = (Label)item.FindControl("lbl_exam") as Label;
                    var    lbl_code       = (Label)item.FindControl("lbl_code") as Label;
                    var    lbl_instructor = (Label)item.FindControl("lbl_instructor") as Label;
                    var    txt_Date       = (TextBox)item.FindControl("txt_Date") as TextBox;
                    string day            = Convert.ToDateTime(txt_Date.Text).ToString("dddd");
                    var    txt_Time       = (TextBox)item.FindControl("txt_Time") as TextBox;
                    request = request + "<tr><td align='center'> " + lbl_exam.Text + "</td><td align='center'> " + lbl_code.Text + "</td><td align='center'> " + lbl_instructor.Text + "</td><td align='center'> " + day + "</td><td align='center'> " + txt_Date.Text + "</td><td align='center'> " + txt_Time.Text + "</td></tr>";
                }
            }
            string htmltext = header + request + footer;

            //if (drp_Course.SelectedItem.Value != "---Select a Course---")
            //{
            //sentdatatoSPLIst();
            int sem  = 0;
            int Year = LibraryMOD.SeperateTerm(LibraryMOD.GetCurrentTerm(), out sem);

            int    iYear     = Year;
            int    iSem      = sem;
            string sSemester = LibraryMOD.GetSemesterString(iSem);
            string refno     = Create16DigitString();
            //string day = Convert.ToDateTime(txt_ExamDate.Text).ToString("dddd");
            string sACC = "0200000";

            if (Session["CurrentCampus"].ToString() == "Males")
            {
                sACC = "0100000";
            }
            else
            {
                sACC = "0200000";
            }

            string languageoption = "";

            if (Session["LanguageOption"].ToString() == "True")
            {
                languageoption = "<b>Language:</b> " + ddlLanguage.SelectedItem.Text + "";
            }


            // Create a DataTable
            DataTable dtSPList = new DataTable();

            dtSPList.Clear();
            dtSPList.Columns.Add("Title");
            dtSPList.Columns.Add("Year");
            dtSPList.Columns.Add("Semester");
            dtSPList.Columns.Add("Request");
            dtSPList.Columns.Add("RequestNote");
            dtSPList.Columns.Add("ServiceID");
            dtSPList.Columns.Add("Fees");
            dtSPList.Columns.Add("Requester");
            dtSPList.Columns.Add("StudentID");
            dtSPList.Columns.Add("StudentName");
            dtSPList.Columns.Add("Contact");
            dtSPList.Columns.Add("Finance");
            dtSPList.Columns.Add("FinanceAction");
            dtSPList.Columns.Add("FinanceNote");
            dtSPList.Columns.Add("Host");
            dtSPList.Columns.Add("HostAction");
            dtSPList.Columns.Add("HostNote");
            dtSPList.Columns.Add("ProviderAction");
            dtSPList.Columns.Add("ProviderNote");
            dtSPList.Columns.Add("Status");

            // Add items using Add method
            DataRow dr = dtSPList.NewRow();

            dr["Title"]       = refno;
            dr["Year"]        = iYear;
            dr["Semester"]    = iSem;
            dr["Request"]     = "<b>Service ID:</b> " + lbl_ServiceID.Text + "<br/> <b>Service Name:</b> " + lbl_ServiceNameEn.Text + " (" + lbl_ServiceNameAr.Text + " )<br/>" + languageoption + "<br/><b><u>Service Request:</u></b><br/><br/>" + htmltext + "";
            dr["RequestNote"] = txt_Remarks.Text.Trim();
            dr["ServiceID"]   = lbl_ServiceID.Text;
            dr["Fees"]        = hdf_Price.Value;
            //dr["Requester"] = "*****@*****.**";
            dr["Requester"]   = hdf_StudentEmail.Value;
            dr["StudentID"]   = lbl_StudentID.Text;
            dr["StudentName"] = lbl_StudentName.Text;
            dr["Contact"]     = lbl_StudentContact.Text;
            //dr["Finance"] = "*****@*****.**";
            dr["Finance"]       = Session["FinanceEmail"].ToString();
            dr["FinanceAction"] = "Initiate";
            dr["FinanceNote"]   = "";
            //dr["Host"] = "*****@*****.**";
            dr["Host"]           = Session["HostEmail"].ToString();
            dr["HostAction"]     = "Initiate";
            dr["HostNote"]       = "";
            dr["ProviderAction"] = "Initiate";
            dr["ProviderNote"]   = "";
            dr["Status"]         = "Finance Approval Needed";
            dtSPList.Rows.Add(dr);

            //sentdatatoSPLIst();

            Session["CurrentService"]       = "Student Services: " + lbl_ServiceID.Text + "";
            Session["CurrentServiceName"]   = lbl_ServiceNameEn.Text;
            Session["CurrentServiceAmount"] = string.Format("{0:f}", hdf_Price.Value);
            Session["CurrentdtSPList"]      = dtSPList;
            Session["CurrentAccount"]       = sACC;
            Session["cancelpage"]           = "ECT_SAR_SREG_FRM_011.aspx?ServiceID=" + lbl_ServiceID.Text + "";
            Response.Redirect("Student_Services_HostedPayment.aspx");
            //}
        }
Exemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //Security
                if (Session["CurrentRole"] != null)
                {
                    CurrentRole = (int)Session["CurrentRole"];
                }
                else
                {
                    //showErr("Session is expired, Login again...");
                    ClearSession();
                    Session["cpage"] = "Balance.aspx";
                    Response.Redirect("Login.aspx");
                }


                if (!Page.IsPostBack)
                {
                    if (LibraryMOD.isRoleAuthorized(InitializeModule.enumPrivilegeObjects.ECT_Payment,
                                                    InitializeModule.enumPrivilege.ShowBrowse, CurrentRole) != true)
                    {
                        //showmsg("Sorry, You don't have the permission to view this page...");
                        //runScr("hidesidebar();");
                        showErr("Sorry, You don't have the permission to view this page...");
                    }

                    CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                    sSID          = Session["CurrentStudent"].ToString();
                    sName         = Session["CurrentStudentName"].ToString();
                    getStdAcc();
                    Session["CurrentAccount"] = sACC;
                    decimal dAmount = 0;
                    if (Request.QueryString["amt"] != null && Request.QueryString["amt"] != "")
                    {
                        dAmount = Convert.ToDecimal(Request.QueryString["amt"]);
                    }
                    else
                    {
                        dAmount = LibraryMOD.GetStudentBalanceBTS(sSID, CurrentCampus);
                    }

                    int iCurrentTerm = LibraryMOD.GetCurrentTerm();
                    if (isHidden(sSID, iCurrentTerm))
                    {
                        lblOBalanceVATBTS.Text = "-----";
                    }
                    else
                    {
                        lblOBalanceVATBTS.Text = string.Format("{0:f}", dAmount);
                    }

                    if (dAmount < 0)
                    {
                        dAmount = 1;
                    }

                    txtPayment.Text = string.Format("{0:f}", dAmount);

                    if (Session["PmtOrder"] != null)
                    {
                        cancelonlinepayment(Session["PmtOrder"].ToString());
                    }
                }



                //switch(CurrentCampus)
                //{
                //    case InitializeModule.EnumCampus.Females:
                //        mtvBalance.ActiveViewIndex = 0;

                //        break;
                //    case InitializeModule.EnumCampus.Males:
                //        mtvBalance.ActiveViewIndex = 1;

                //        break;


                //}
            }
            catch (Exception ex)
            {
                LibraryMOD.ShowErrorMessage(ex);
                //divMsg.InnerText = ex.Message;
            }
        }