public void updateonlinepayment(string sOrder, string sVoucherNo)
        {
            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS connstr = new Connection_StringCLS(CurrentCampus);
            SqlConnection        sc      = new SqlConnection(connstr.Conn_string);
            SqlCommand           cmd     = new SqlCommand("update [ECTData].[dbo].[Acc_Payment_Order] set sVoucherNo=@sVoucherNo where sOrder=@sOrder", sc);

            //cmd.Parameters.AddWithValue("@isCaptured", true);
            //cmd.Parameters.AddWithValue("@dCaptured", DateTime.Now);
            cmd.Parameters.AddWithValue("@sVoucherNo", sVoucherNo);
            //cmd.Parameters.AddWithValue("@isCanceled", false);
            cmd.Parameters.AddWithValue("@sOrder", sOrder);
            try
            {
                sc.Open();
                cmd.ExecuteNonQuery();
                sc.Close();
            }
            catch (Exception ex)
            {
                sc.Close();
                Console.WriteLine(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["CurrentRole"] != null)
                {
                    CurrentRole = (int)Session["CurrentRole"];

                    iRegYear = (int)Session["RegYear"];
                    iRegSem  = (int)Session["RegSemester"];
                }
                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 (Session["CurrentStudent"] != null)
                {
                    sNo   = Session["CurrentStudent"].ToString();
                    sName = Session["CurrentStudentName"].ToString();
                    if (!IsPostBack)
                    {
                        getservicedetails();
                        getdetails();
                        if (Session["PmtOrder"] != null)
                        {
                            cancelonlinepayment(Session["PmtOrder"].ToString());
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine("{0} Exception caught.", exp);
            }
            finally
            {
            }
        }
Exemplo n.º 3
0
    public int DeleteCourseLeader(InitializeModule.EnumCampus Campus, string AcademicYear, string SemesterID, string CourseID)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            string sSQL = GetDeleteCommand();
//sSQL += sCondition;
            SqlCommand Cmd = new SqlCommand(sSQL, Conn);
            Cmd.Parameters.Add(new SqlParameter("@AcademicYear", AcademicYear));
            Cmd.Parameters.Add(new SqlParameter("@SemesterID", SemesterID));
            Cmd.Parameters.Add(new SqlParameter("@CourseID", CourseID));
            Conn.Open();
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
        public static bool SetOpportunity(string sSID)
        {
            bool isSet = false;

            //U cannot use var from out of the scope. (Campus)
            InitializeModule.EnumCampus campus = InitializeModule.EnumCampus.Males;
            if (sSID.Contains("AF") || sSID.Contains("ESF"))
            {
                campus = InitializeModule.EnumCampus.Females;
            }
            Connection_StringCLS myConnection_String = new Connection_StringCLS(campus);
            SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

            Conn.Open();
            try
            {
                string sSQL = "UPDATE Reg_Applications SET isOpportunitySet=1";
                sSQL += " WHERE (lngStudentNumber = '" + sSID + "')";

                SqlCommand Cmd = new SqlCommand(sSQL, Conn);
                isSet = (Cmd.ExecuteNonQuery() > 0);
            }
            catch (Exception ex)
            {
                LibraryMOD.ShowErrorMessage(ex);
                //divMsg.InnerText = ex.Message;
            }
            finally
            {
                Conn.Close();
                Conn.Dispose();
            }
            return(isSet);
        }
Exemplo n.º 5
0
    public List <CourseLeader> GetList(InitializeModule.EnumCampus Campus, string sCondition, bool isDeafaultIncluded)
    {
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        string        sSQL = GetListSQL(sCondition);
        SqlConnection Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());
        SqlCommand    Cmd  = new SqlCommand(sSQL, Conn);

        Conn.Open();
        SqlDataReader       reader  = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
        List <CourseLeader> results = new List <CourseLeader>();

        try
        {
//Default Value
            CourseLeader myCourseLeader = new CourseLeader();
            if (isDeafaultIncluded)
            {
//Change the code here
                myCourseLeader.AcademicYear = -1;
                myCourseLeader.SemesterID   = -1;
                myCourseLeader.CourseID     = "Select Course";

                results.Add(myCourseLeader);
            }
            while (reader.Read())
            {
                myCourseLeader = new CourseLeader();
                if (reader[LibraryMOD.GetFieldName(AcademicYearFN)].Equals(DBNull.Value))
                {
                    myCourseLeader.AcademicYear = 0;
                }
                else
                {
                    myCourseLeader.AcademicYear = int.Parse(reader[LibraryMOD.GetFieldName(AcademicYearFN)].ToString());
                }
                if (reader[LibraryMOD.GetFieldName(SemesterIDFN)].Equals(DBNull.Value))
                {
                    myCourseLeader.SemesterID = 0;
                }
                else
                {
                    myCourseLeader.SemesterID = int.Parse(reader[LibraryMOD.GetFieldName(SemesterIDFN)].ToString());
                }
                myCourseLeader.CourseID = reader[LibraryMOD.GetFieldName(CourseIDFN)].ToString();
                results.Add(myCourseLeader);
            }
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            reader.Close();
            reader.Dispose();
            Conn.Close();
            Conn.Dispose();
        }
        return(results);
    }
    public static bool IsFndCourseRequired(InitializeModule.EnumCampus Campus, string StudentID, string sFndCourse, string sRequirment, int iScoreofFndCourse, decimal dFoundationCourseMinScore)
    {
        bool isRequired = false;

        try
        {
            switch (sRequirment)
            {
            case "HS":
                if (iScoreofFndCourse < dFoundationCourseMinScore)
                {
                    isRequired = true;
                }
                break;

            case "Remedial":
                if (!isFndCoursePassed(Campus, StudentID, sFndCourse))
                {
                    isRequired = true;
                }
                break;

            case "HS and Remedial":

                if (iScoreofFndCourse < dFoundationCourseMinScore || !isFndCoursePassed(Campus, StudentID, sFndCourse))
                {
                    isRequired = true;
                }

                break;

            case "HS or Remedial":
                if (iScoreofFndCourse < dFoundationCourseMinScore && !isFndCoursePassed(Campus, StudentID, sFndCourse))
                {
                    isRequired = true;
                }
                break;

            case "Graduation":
                //allow to change major from ESL to academic program, can register remedial + major courses
                isRequired = false;
                break;

            case "None":
                isRequired = false;
                break;
            }
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
            isRequired = true;
        }
        finally
        {
        }
        return(isRequired);
    }
Exemplo n.º 7
0
        public void insert_online_payment(string sOrder, string sACC, string sSID, string sService, string amount)
        {
            double dGrossAmount = Convert.ToDouble(amount);
            double dPmtAmount   = Math.Round((dGrossAmount / 1.05), 2);
            double dVAT         = Math.Round((dGrossAmount - dPmtAmount), 2);

            DataTable CurrentdtSPList = Session["CurrentdtSPList"] as DataTable;

            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS connstr = new Connection_StringCLS(CurrentCampus);
            SqlConnection        sc      = new SqlConnection(connstr.Conn_string);
            SqlCommand           cmd     = new SqlCommand("INSERT INTO [ECTData].[dbo].[Acc_Payment_Order] values (@sOrder,@sACC,@sSID,@sService,@dDate,@isCaptured,@dCaptured,@sVoucherNo,@isCanceled,@cAmount,@cVAT,@tOrder)", sc);

            cmd.Parameters.AddWithValue("@sOrder", sOrder);
            cmd.Parameters.AddWithValue("@sACC", sACC);
            cmd.Parameters.AddWithValue("@sSID", sSID);
            cmd.Parameters.AddWithValue("@sService", sService);
            cmd.Parameters.AddWithValue("@dDate", DateTime.Now);
            cmd.Parameters.AddWithValue("@isCaptured", false);
            cmd.Parameters.AddWithValue("@dCaptured", DBNull.Value);
            cmd.Parameters.AddWithValue("@sVoucherNo", DBNull.Value);
            cmd.Parameters.AddWithValue("@isCanceled", false);
            cmd.Parameters.AddWithValue("@cAmount", dPmtAmount);
            cmd.Parameters.AddWithValue("@cVAT", dVAT);
            if (CurrentdtSPList.Rows.Count > 0)
            {
                //Convert Datatable to XML String to DB Save
                System.IO.StringWriter writer = new System.IO.StringWriter();
                CurrentdtSPList.TableName = "CurrentdtSPList";
                CurrentdtSPList.WriteXml(writer, XmlWriteMode.WriteSchema, true);
                cmd.Parameters.AddWithValue("@tOrder", writer.ToString());

                //StringReader theReader = new StringReader(writer.ToString());
                //DataSet theDataSet = new DataSet();
                //theDataSet.ReadXml(theReader);
            }
            else
            {
                cmd.Parameters.AddWithValue("@tOrder", DBNull.Value);
            }
            try
            {
                sc.Open();
                cmd.ExecuteNonQuery();
                sc.Close();
            }
            catch (Exception ex)
            {
                sc.Close();
                Console.WriteLine(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
Exemplo n.º 8
0
    public List <Privilege> GetObjectPrivileges(string sCondition)
    {
        InitializeModule.EnumCampus iCampus = InitializeModule.EnumCampus.ECTNew;
        //iCampus = InitializeModule.EnumCampus.ECTNew;
        Connection_StringCLS sConn = new Connection_StringCLS(iCampus);


        //, OP.ObjectID
        string sSQL = "SELECT P.PrivilegeID, P.PriviligeNameEn, P.DefaultEffect";

        sSQL += " FROM dbo.Cmn_Privilege AS P INNER JOIN dbo.Cmn_Permissions AS OP ON P.PrivilegeID = OP.PrivilegeID";

        sSQL += sCondition;

        sSQL = sSQL + " Order By P.PrivilegeID";

        SqlConnection Conn = new SqlConnection(sConn.Conn_string.ToString());

        SqlCommand Cmd = new SqlCommand(sSQL, Conn);

        Conn.Open();
        SqlDataReader    Rd      = Cmd.ExecuteReader(CommandBehavior.CloseConnection);
        List <Privilege> results = new List <Privilege>();

        //int i = 0;
        try
        {
            while (Rd.Read())
            {
                Privilege MyPrivilege = new Privilege();
                MyPrivilege.PrivilegeID     = int.Parse(Rd["PrivilegeID"].ToString());
                MyPrivilege.PriviligeNameEn = Rd["PriviligeNameEn"].ToString();
                MyPrivilege.DefaultEffect   = int.Parse(Rd["DefaultEffect"].ToString());
                //MyPrivilege.isDataChanged = false;
                //MyPrivilege.iDataStatus = 1;//Old 2:New Recored

                results.Add(MyPrivilege);
                //i += 1;
            }
        }
        catch (Exception ex)
        {
        }
        finally
        {
            //'Response.Write(ex.Message)

            Rd.Close();
            Rd.Dispose();
            Conn.Close();
            Conn.Dispose();
        }
        //myStatus.Clear()

        return(results);
    }
Exemplo n.º 9
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();
                    Response.Redirect("Login.aspx");
                }


                if (!Page.IsPostBack)
                {
                    if (LibraryMOD.isRoleAuthorized(InitializeModule.enumPrivilegeObjects.ECT_MarkSheet,
                                                    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"];
                string sSID     = Session["CurrentStudent"].ToString();
                bool   isEnable = Enable_Disable(sSID, CurrentCampus);
                if (isEnable)
                {
                    switch (CurrentCampus)
                    {
                    case InitializeModule.EnumCampus.Females:
                        Grades_mtv.ActiveViewIndex = 0;
                        Females_Emptylbl.Visible   = (Females_dlt.Items.Count == 0);
                        break;

                    case InitializeModule.EnumCampus.Males:
                        Grades_mtv.ActiveViewIndex = 1;
                        Males_Emptylbl.Visible     = (Males_dlt.Items.Count == 0);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                LibraryMOD.ShowErrorMessage(ex);
                //divMsg.InnerText = ex.Message;
            }
        }
Exemplo n.º 10
0
        private List <TimeTable> Retrieve(int iSession)
        {
            List <TimeTable> myTimeTable    = new List <TimeTable>();
            TimeTableDAL     myTimeTableDAL = new TimeTableDAL();
            DataSet          Ds             = new DataSet();

            try
            {
                InitializeModule.EnumCampus Campus = InitializeModule.EnumCampus.Females;
                int iCampus = 0;
                switch (iSession)
                {
                case 1:
                case 2:
                case 9:
                    Campus  = InitializeModule.EnumCampus.Females;
                    iCampus = 2;
                    break;

                case 4:
                case 8:
                    Campus  = InitializeModule.EnumCampus.Males;
                    iCampus = 1;
                    break;
                }

                int iTerm = 0;
                int iSem  = 0;
                int iYear = 0;

                iTerm = LibraryMOD.GetRegTerm();
                iYear = LibraryMOD.SeperateTerm(iTerm, out iSem);


                //if(Session["CurrentMajorCampus"]!=null)
                //{
                //    iCampus=Convert.ToInt32(Session["CurrentMajorCampus"]);
                //}
                myTimeTable = myTimeTableDAL.GetTimeTable(iYear, iSem, iSession, "", 0, 0, "", "", false, false, iCampus, Campus);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0} Exception caught.", ex.Message);
            }
            finally
            {
            }
            return(myTimeTable);
        }
        public void updateuserole(string sAcc)
        {
            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS myConnection_String = new Connection_StringCLS(CurrentCampus);
            SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

            try
            {
                string     sSQL = "";
                SqlCommand Cmd  = new SqlCommand();
                Cmd.Connection = Conn;
                int iStatus = 2;

                Cmd.CommandText = "Create_Online_User";
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.Parameters.Add("@sNo", SqlDbType.VarChar).Value      = Session["CurrentStudent"].ToString();
                Cmd.Parameters.Add("@sAccount", SqlDbType.VarChar).Value = sAcc;
                Cmd.Parameters.Add("@iRole", SqlDbType.Int).Value        = 105;
                Conn.Open();
                Cmd.ExecuteNonQuery();
                Conn.Close();


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

                sSQL            = "UPDATE Reg_Student_Accounts";
                sSQL           += " SET intOnlineStatus =" + iStatus;
                sSQL           += ",strUserSave='" + Session["CurrentUserName"].ToString() + "',dateLastSave=getDate(),intRegYear=" + iRYear + ",byteRegSem=" + iRSem + " ";
                sSQL           += " Where strAccountNo='" + sAcc + "'";
                Cmd.CommandType = CommandType.Text;
                Cmd.CommandText = sSQL;
                Conn.Open();
                Cmd.ExecuteNonQuery();
                Conn.Close();
            }
            catch (Exception exp)
            {
                //Console.WriteLine("{0} Exception caught.", exp);
                //lbl_Msg.Text = "Online Status not updated";
                //div_msg.Visible = true;
            }
            finally
            {
                Conn.Close();
                Conn.Dispose();
            }
        }
Exemplo n.º 12
0
    public int UpdateCourseLeader(InitializeModule.EnumCampus Campus, int iMode, int AcademicYear, int SemesterID, string CourseID, int CourseLeaderID, int CreationUserID, DateTime CreationDate, int LastUpdateUserID, DateTime LastUpdateDate, string PCName, string NetUserName, string TemplateCourse, int MoodleCourseNo)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            Conn.Open();
            string       sql             = "";
            CourseLeader theCourseLeader = new CourseLeader();
//'Updates the  table
            switch (iMode)
            {
            case  (int)ECTGlobalDll.InitializeModule.enumModes.EditMode:
                sql = GetUpdateCommand();
                break;

            case (int)ECTGlobalDll.InitializeModule.enumModes.NewMode:
                sql = GetInsertCommand();
                break;
            }
            SqlCommand Cmd = new SqlCommand(sql, Conn);
            Cmd.Parameters.Add(new SqlParameter("@AcademicYear", AcademicYear));
            Cmd.Parameters.Add(new SqlParameter("@SemesterID", SemesterID));
            Cmd.Parameters.Add(new SqlParameter("@CourseID", CourseID));
            Cmd.Parameters.Add(new SqlParameter("@CourseLeaderID", CourseLeaderID));
            Cmd.Parameters.Add(new SqlParameter("@CreationUserID", CreationUserID));
            Cmd.Parameters.Add(new SqlParameter("@CreationDate", CreationDate));
            Cmd.Parameters.Add(new SqlParameter("@LastUpdateUserID", LastUpdateUserID));
            Cmd.Parameters.Add(new SqlParameter("@LastUpdateDate", LastUpdateDate));
            Cmd.Parameters.Add(new SqlParameter("@PCName", PCName));
            Cmd.Parameters.Add(new SqlParameter("@NetUserName", NetUserName));
            Cmd.Parameters.Add(new SqlParameter("@TemplateCourse", TemplateCourse));
            Cmd.Parameters.Add(new SqlParameter("@MoodleCourseNo", MoodleCourseNo));
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
Exemplo n.º 13
0
    public Connection_StringCLS(InitializeModule.EnumCampus Campus)
    {
        switch (Campus)
        {
        case InitializeModule.EnumCampus.Males:
            Conn_string = "Data Source=localect;Initial Catalog=ECTData;Persist Security Info=True;MultipleActiveResultSets=True;User ID=ECTDeveloper;Password=D!v@328";
            break;

        case InitializeModule.EnumCampus.Females:
            Conn_string = "Data Source=SQL_SERVER;Initial Catalog=ECTData;Persist Security Info=True;MultipleActiveResultSets=True;User ID=ECTDeveloper;Password=D!v@328";
            break;

        case InitializeModule.EnumCampus.ECTNew:
            Conn_string = "Data Source=localect;Initial Catalog=ECTDataNew;Persist Security Info=True;MultipleActiveResultSets=True;User ID=ECTDeveloper;Password=D!v@328";
            break;
        }
    }
Exemplo n.º 14
0
    public int UpdatePrivilegeObjects(InitializeModule.EnumCampus Campus, int iMode, int ObjectID, string ObjectNameAr, string ObjectNameEn, string DisplayObjectName, int ShowOrder, int SystemID, int ParentID, string sURL, int iLevel)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            Conn.Open();
            string           sql = "";
            PrivilegeObjects thePrivilegeObjects = new PrivilegeObjects();
//'Updates the  table
            switch (iMode)
            {
            case  (int)InitializeModule.enumModes.EditMode:
                sql = GetUpdateCommand();
                break;

            case (int)InitializeModule.enumModes.NewMode:
                sql = GetInsertCommand();
                break;
            }
            SqlCommand Cmd = new SqlCommand(sql, Conn);
            Cmd.Parameters.Add(new SqlParameter("@ObjectID", ObjectID));
            Cmd.Parameters.Add(new SqlParameter("@ObjectNameAr", ObjectNameAr));
            Cmd.Parameters.Add(new SqlParameter("@ObjectNameEn", ObjectNameEn));
            Cmd.Parameters.Add(new SqlParameter("@DisplayObjectName", DisplayObjectName));
            Cmd.Parameters.Add(new SqlParameter("@ShowOrder", ShowOrder));
            Cmd.Parameters.Add(new SqlParameter("@SystemID", SystemID));
            Cmd.Parameters.Add(new SqlParameter("@ParentID", ParentID));
            Cmd.Parameters.Add(new SqlParameter("@sURL", sURL));
            Cmd.Parameters.Add(new SqlParameter("@iLevel", iLevel));
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
        private string NewVoucher(int iCYear, int iCSem)
        {
            string sVoucher = "";

            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS myConnection_String = new Connection_StringCLS(CurrentCampus);
            SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

            Conn.Open();
            try
            {
                int    iCampus = (int)CurrentCampus;
                string sCampus = string.Format("{0:00}", iCampus);

                string     sSQL = "SELECT dateStartSemester FROM Reg_Semesters AS S WHERE intStudyYear =" + iCYear + " AND byteSemester =" + iCSem;
                SqlCommand Cmd  = new SqlCommand();
                Cmd.Connection  = Conn;
                Cmd.CommandText = sSQL;
                SqlDataReader Rd    = Cmd.ExecuteReader();
                DateTime      dDate = DateTime.Today.Date;
                while (Rd.Read())
                {
                    dDate = Convert.ToDateTime(Rd["dateStartSemester"]);
                }
                Rd.Close();
                string sDate = string.Format("{0:yy}", dDate) + string.Format("{0:MM}", dDate);
                sSQL            = "SELECT MAX(CONVERT(INT, RIGHT(strVoucherNo, 5))) AS Voucher";
                sSQL           += " FROM Acc_Voucher_Header";
                sSQL           += " WHERE intFy = " + iCYear + " AND byteFSemester = " + iCSem;
                Cmd.CommandText = sSQL;
                int iMax = Convert.ToInt32("0" + Cmd.ExecuteScalar().ToString()) + 1;

                sVoucher = sCampus + sDate + string.Format("{0:00000}", iMax);
            }
            catch (Exception exp)
            {
                divMsg.InnerText = exp.Message;
            }
            finally
            {
                Conn.Close();
                Conn.Dispose();
            }
            return(sVoucher);
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CurrentCampus"] != null)
            {
                CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            }
            else
            {
                //showErr("Session is expired, Login again...");
                ClearSession();
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                //Initiate Payment
                Session["PmtSession"]         = null;
                Session["PmtOrder"]           = null;
                Session["PmtResultIndicator"] = null;
                Session["PmtResult"]          = null;
                Session["PmtDesc"]            = null;
                Session["PmtAmount"]          = null;
                //Security
                if (Session["CurrentRole"] != null)
                {
                    CurrentRole = (int)Session["CurrentRole"];
                }
                else
                {
                    //showErr("Session is expired, Login again...");
                    ClearSession();
                    Response.Redirect("Login.aspx");
                }

                hdnSID.Value  = Session["CurrentStudent"].ToString();
                hdnName.Value = Session["CurrentStudentName"].ToString();
                hdnACC.Value  = Session["CurrentAccount"].ToString();
                decimal dAmount = Convert.ToDecimal(Session["CurrentServiceAmount"].ToString());
                hdnAmount.Value  = string.Format("{0:f}", dAmount);
                lblPayment.Text  = hdnAmount.Value + " AED";
                lbl_Service.Text = Session["CurrentService"].ToString() + "-" + Session["CurrentServiceName"].ToString();
                hdnFees.Value    = Session["CurrentService"].ToString();
            }
        }
    public int UpdateRecommendation(InitializeModule.EnumCampus Campus, int iMode, int intStudyYear, int byteSemester, int byteShift, string strCourse, string lngStudentNumber, int bytOrder)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            Conn.Open();
            string         sql = "";
            Recommendation theRecommendation = new Recommendation();
//'Updates the  table
            switch (iMode)
            {
            case  (int)InitializeModule.enumModes.EditMode:
                sql = GetUpdateCommand();
                break;

            case (int)InitializeModule.enumModes.NewMode:
                sql = GetInsertCommand();
                break;
            }
            SqlCommand Cmd = new SqlCommand(sql, Conn);
            Cmd.Parameters.Add(new SqlParameter("@intStudyYear", intStudyYear));
            Cmd.Parameters.Add(new SqlParameter("@byteSemester", byteSemester));
            Cmd.Parameters.Add(new SqlParameter("@byteShift", byteShift));
            Cmd.Parameters.Add(new SqlParameter("@strCourse", strCourse));
            Cmd.Parameters.Add(new SqlParameter("@lngStudentNumber", lngStudentNumber));
            Cmd.Parameters.Add(new SqlParameter("@bytOrder", bytOrder));
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
        private void Get_Student_Advising()
        {
            List <MirrorCLS> myMirror   = new List <MirrorCLS>();
            Advising         myAdvising = new Advising();
            Plans            Plan       = new Plans();

            try
            {
                //Campus = (InitializeModule.EnumCampus)int.Parse(Campus_ddl.SelectedValue);
                if (Request.QueryString["selectedCampus"] != null)
                {
                    Campus = (InitializeModule.EnumCampus) int.Parse(Request.QueryString["selectedCampus"].ToString());
                }
                else if (Session["CurrentCampus"] != null)
                {
                    Campus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                }

                int iYear = iRegYear;
                int iSem  = iRegSem;
                //Is Grades Hidden
                bool isHidden = LibraryMOD.isGradesHidden(Campus);
                myMirror = myAdvising.GetAdvising(sNo, true, iYear, iSem, true, isHidden, out Plan, Campus, Session["sCSemester"].ToString());
                System.Web.UI.WebControls.Table myTable = Create_Table(myMirror[0]);
                divDetail.Controls.Clear();
                divDetail.Controls.Add(myTable);
                int i    = myMirror.Count;
                int iRec = myMirror[0].Recommended.Count;
            }
            catch (Exception exp)
            {
                Console.WriteLine("{0} Exception caught.", exp);
            }
            finally
            {
                myMirror          = myList;
                Session["myList"] = myMirror;
                Session["myPlan"] = Plan;
                Enable_Disable(myMirror[0].Recommended.Count > 0);
            }
        }
    public int UpdatePrograms_Advisors(InitializeModule.EnumCampus Campus, int iMode, int iEntry, string strProgram, int iAdvisor, int byteCategory, string isWeekend)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            Conn.Open();
            string            sql = "";
            Programs_Advisors thePrograms_Advisors = new Programs_Advisors();
//'Updates the  table
            switch (iMode)
            {
            case  (int)InitializeModule.enumModes.EditMode:
                sql = GetUpdateCommand();
                break;

            case (int)InitializeModule.enumModes.NewMode:
                sql = GetInsertCommand();
                break;
            }
            SqlCommand Cmd = new SqlCommand(sql, Conn);
            Cmd.Parameters.Add(new SqlParameter("@iEntry", iEntry));
            Cmd.Parameters.Add(new SqlParameter("@strProgram", strProgram));
            Cmd.Parameters.Add(new SqlParameter("@iAdvisor", iAdvisor));
            Cmd.Parameters.Add(new SqlParameter("@byteCategory", byteCategory));
            Cmd.Parameters.Add(new SqlParameter("@isWeekend", isWeekend));
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
        private string AddVoucher(string sAcc, string sSID, string sPmtSession, string sPmtOrder)
        {
            string sVoucher = "";

            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS myConnection_String = new Connection_StringCLS(CurrentCampus);
            SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

            Conn.Open();
            try
            {
                int iCYear = Convert.ToInt32(Session["CurrentYear"]);
                int iCSem  = Convert.ToInt32(Session["CurrentSemester"]);
                sVoucher = NewVoucher(iCYear, iCSem);
                //,[strRemark],[strMachine],[strNUser]
                string sSQL = "INSERT INTO Acc_Voucher_Header";
                sSQL += " (intFy,byteFSemester,strVoucherNo,dateVoucher,strAccountNo,lngStudentNumber,isPrinted,strUserCreate,dateCreate,strMachine,strNUser,strRemark)";
                sSQL += " VALUES(" + iCYear + "," + iCSem + ",'" + sVoucher + "',GetDate(),'" + sAcc;
                sSQL += "','" + sSID + "',0,'" + sSID + "',GetDate(),'ECTSIS','" + sPmtSession + "','" + sPmtOrder + "')";
                SqlCommand Cmd = new SqlCommand();
                Cmd.Connection  = Conn;
                Cmd.CommandText = sSQL;
                int iEffected = Cmd.ExecuteNonQuery();
                if (iEffected == 0)
                {
                    sVoucher = "";
                }
            }
            catch (Exception exp)
            {
                divMsg.InnerText = exp.Message;
                sVoucher         = "";
            }
            finally
            {
                Conn.Close();
                Conn.Dispose();
            }
            return(sVoucher);
        }
        private int AddPayment(string sVoucher, string sPmtSession, string sPmtOrder, int iPaidFor, double dAmount, double dVat)
        {
            int iEffected = 0;

            CurrentCampus = (InitializeModule.EnumCampus)Session["CurrentCampus"];
            Connection_StringCLS myConnection_String = new Connection_StringCLS(CurrentCampus);
            SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

            Conn.Open();
            try
            {
                string sSQL = "INSERT INTO Acc_Voucher_Detail";
                sSQL += " (intFy, byteFSemester, strVoucherNo, lngEntryNo, strAccountNo, datePayment, curDebit, curCredit, byteStatus, bytePaymentWay";
                sSQL += " , strUserCreate,dateCreate, strMachine, strNUser, intCampus, bytePaymentFor, curVat,LastAudit)";
                sSQL += " SELECT intFy, byteFSemester, strVoucherNo, 1 AS lngEntryNo, strAccountNo, GETDATE() AS datePayment, 0 AS curDebit, " + dAmount + " AS curCredit, 0 AS byteStatus, 6 AS bytePaymentWay,";
                sSQL += " strUserCreate, GETDATE() AS dateCreate, 'ECTSIS' AS strMachine, '" + sPmtOrder + "' AS strNUser, " + (int)CurrentCampus + " AS intCampus, " + iPaidFor + " AS bytePaymentFor, " + dVat + " AS curVat,0 as LastAudit";
                sSQL += " FROM  Acc_Voucher_Header";
                sSQL += " WHERE(strVoucherNo = '" + sVoucher + "')";


                SqlCommand Cmd = new SqlCommand();
                Cmd.Connection  = Conn;
                Cmd.CommandText = sSQL;
                iEffected       = Cmd.ExecuteNonQuery();
                //if (iEffected == 0)
                //{
                //    showErr("Payment Error");
                //}
            }
            catch (Exception exp)
            {
                //showErr("Payment Error");
            }
            finally
            {
                Conn.Close();
                Conn.Dispose();
            }
            return(iEffected);
        }
Exemplo n.º 22
0
    public int UpdatePrivilege(InitializeModule.EnumCampus Campus, int iMode, int PrivilegeID, string PrivilegeNameAr, string PriviligeNameEn, int DefaultEffect)
    {
        int iEffected = 0;
        Connection_StringCLS MyConnection_string = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(MyConnection_string.Conn_string.ToString());

        try
        {
            Conn.Open();
            string    sql          = "";
            Privilege thePrivilege = new Privilege();
//'Updates the  table
            switch (iMode)
            {
            case  (int)InitializeModule.enumModes.EditMode:
                sql = GetUpdateCommand();
                break;

            case (int)InitializeModule.enumModes.NewMode:
                sql = GetInsertCommand();
                break;
            }
            SqlCommand Cmd = new SqlCommand(sql, Conn);
            Cmd.Parameters.Add(new SqlParameter("@PrivilegeID", PrivilegeID));
            Cmd.Parameters.Add(new SqlParameter("@PrivilegeNameAr", PrivilegeNameAr));
            Cmd.Parameters.Add(new SqlParameter("@PriviligeNameEn", PriviligeNameEn));
            Cmd.Parameters.Add(new SqlParameter("@DefaultEffect", DefaultEffect));
            iEffected = Cmd.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(iEffected);
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["CurrentRole"] != null)
                {
                    CurrentRole = (int)Session["CurrentRole"];
                    iRegYear    = (int)Session["RegYear"];
                    iRegSem     = (int)Session["RegSemester"];
                    Campus      = (InitializeModule.EnumCampus)Session["CurrentCampus"];
                }
                else
                {
                    //showErr("Session is expired, Login again please...");
                    ClearSession();
                    Response.Redirect("Login.aspx");
                }
                if (Session["CurrentStudent"] != null)
                {
                    sNo   = Session["CurrentStudent"].ToString();
                    sName = Session["CurrentStudentName"].ToString();

                    if (!IsPostBack)
                    {
                        bindmyattendancewrnigns();
                        //lbl_Msg.Text = "\u0022Dear Student... If you miss 10 % of your lectures in any of your classes, you will receive a yellow warning in the \u0022Status\u0022 column.When your absence reaches 20 %, you will receive a second \u0022orange color\u0022 warning, and when your absence reaches 30 %, you will receive your final \u0022red\u0022 warning in the \u0022Status\u0022 column.If you miss any class beyond the 30% threshold, your class will be withdrawn, and you will receive an EW grade.The table below shows where you stand this semester in all your registered classes.\u0022";
                    }
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine("{0} Exception caught.", exp);
            }
            finally
            {
            }
        }
    public static bool isFndCoursePassed(InitializeModule.EnumCampus Campus, string StudentID, string sFndCourse)
    {
        bool isPassed = false;
        Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

        Conn.Open();
        try
        {
            string sSQL = "SELECT Reg_Grade_System.bPassIt";
            sSQL += " FROM Reg_Grade_System INNER JOIN";
            sSQL += " Reg_Grade_Header ON Reg_Grade_System.strGrade = Reg_Grade_Header.strGrade";
            sSQL += " WHERE Reg_Grade_Header.lngStudentNumber = '" + StudentID + "'";
            sSQL += " AND dbo.Reg_Grade_Header.strCourse = '" + sFndCourse + "'";
            sSQL += " AND Reg_Grade_System.bPassIt = 1";

            SqlCommand    Cmd = new SqlCommand(sSQL, Conn);
            SqlDataReader Rd  = Cmd.ExecuteReader();

            while (Rd.Read())
            {
                isPassed = true;
            }
            Rd.Close();
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
            isPassed = false;
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(isPassed);
    }
Exemplo n.º 25
0
    public int iMaxLevel(string sCondition)
    {
        InitializeModule.EnumCampus iCampus = InitializeModule.EnumCampus.ECTNew;

        Connection_StringCLS sConn = new Connection_StringCLS(iCampus);

        string sSQL = "SELECT Max(iLevel) as Depth FROM Cmn_PrivilegeObjects";

        sSQL += sCondition;

        SqlConnection Conn = new SqlConnection(sConn.Conn_string.ToString());

        SqlCommand Cmd = new SqlCommand(sSQL, Conn);

        Conn.Open();
        int iDepth = 0;

        try
        {
            iDepth = int.Parse(Cmd.ExecuteScalar().ToString());
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            //'Response.Write(ex.Message)

            Conn.Close();
            Conn.Dispose();
        }
        //myStatus.Clear()

        return(iDepth);
    }
Exemplo n.º 26
0
    public string Sync_Students_No(InitializeModule.EnumCampus Campus, string sNo)
    {
        string sName = "";
        List <Student_Search> myStudent = new List <Student_Search>();

        try
        {
            string sCondition = " Where sNo='" + sNo + "'";
            myStudent = GetList(Campus, sCondition);
            if (myStudent.Count > 0)
            {
                sName = myStudent[0].SName;
            }
        }
        catch (Exception ex)
        {
            LibraryMOD.ShowErrorMessage(ex);
        }
        finally
        {
            myStudent.Clear();
        }
        return(sName);
    }
Exemplo n.º 27
0
    public List <int> GetPrerequisite(string sCollege, string sDegree, string sMajor, string sCourse, InitializeModule.EnumCampus Campus)
    {
        Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

        Conn.Open();
        SqlCommand    Cmd;
        SqlDataReader Rd;

        List <int> Result = new List <int>();

        try
        {
            string sPreSQL = "SELECT PSC.byteOrder, P.strPrerequisite";
            sPreSQL += " FROM  dbo.Reg_Specialization_Courses AS SC INNER JOIN dbo.Reg_Prerequisites AS P ON SC.strCourse = P.strCourse AND SC.strCollege = P.strCollege AND SC.strDegree = P.strDegree AND";
            sPreSQL += " SC.strSpecialization = P.strSpecialization INNER JOIN dbo.Reg_Specialization_Courses AS PSC ON P.strCollege = PSC.strCollege AND P.strDegree = PSC.strDegree AND  P.strSpecialization = PSC.strSpecialization AND P.strPrerequisite = PSC.strCourse";
            sPreSQL += " WHERE (SC.strCollege = '" + sCollege + "') AND (SC.strDegree = '" + sDegree + "') AND (SC.strSpecialization = '" + sMajor + "') AND (SC.strCourse = '" + sCourse + "')";
            sPreSQL += " Order by PSC.byteOrder";
            Cmd      = new SqlCommand(sPreSQL, Conn);
            Rd       = Cmd.ExecuteReader();

            while (Rd.Read())
            {
                Result.Add(int.Parse(Rd["byteOrder"].ToString()));
            }
            Rd.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine("{0} Exception caught.", ex.Message);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(Result);
    }
Exemplo n.º 28
0
    public List <string> GetElective(string sCollege, string sDegree, string sMajor, int iOrder, InitializeModule.EnumCampus Campus)
    {
        Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

        Conn.Open();
        SqlCommand    Cmd;
        SqlDataReader Rd;

        List <string> Result = new List <string>();

        try
        {
            string sElectSQL = "SELECT sEelecive FROM dbo.Reg_Specialization_Elective AS E";
            sElectSQL += " WHERE sMajor ='" + sMajor + "' AND sDegree='" + sDegree + "' AND sCollege ='" + sCollege + "' AND intOrder =" + iOrder;
            Cmd        = new SqlCommand(sElectSQL, Conn);
            Rd         = Cmd.ExecuteReader();
            while (Rd.Read())
            {
                Result.Add(Rd["sEelecive"].ToString());
            }
            Rd.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine("{0} Exception caught.", ex.Message);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(Result);
    }
Exemplo n.º 29
0
    public List <PlanCourses.Crs> GetCourses(string sCollege, string sDegree, string sMajor, bool isPreIncluded, InitializeModule.EnumCampus Campus)
    {
        Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

        Conn.Open();
        SqlCommand    Cmd;
        SqlDataReader Rd;

        List <PlanCourses.Crs> Result = new List <PlanCourses.Crs>();

        PlanCourses.Crs Cr;
        int             iOrder = 0;

        try{
            string sCrsSQL = "Select SC.byteOrder, SC.strCourse, C.byteCreditHours, C.strCourseDescEn AS sDesc, C.strParallel, C.bExtraLab,SC.byteCourseClass";
            sCrsSQL += " FROM dbo.Reg_Specialization_Courses AS SC INNER JOIN dbo.Reg_Courses AS C ON SC.strCourse = C.strCourse";
            sCrsSQL += " Where SC.strCollege='" + sCollege + "' and SC.strDegree='" + sDegree + "' and SC.strSpecialization='" + sMajor + "'";
            sCrsSQL += " ORDER BY SC.byteOrder";

            Cmd = new SqlCommand(sCrsSQL, Conn);
            Rd  = Cmd.ExecuteReader();

            while (Rd.Read())
            {
                iOrder      += 1;
                Cr           = new PlanCourses.Crs();
                Cr.sCourse   = Rd["strCourse"].ToString();
                Cr.sDesc     = Rd["sDesc"].ToString();
                Cr.sParallel = Rd["strParallel"].ToString();
                Cr.iOrder    = int.Parse(Rd["byteOrder"].ToString());
                Cr.iClass    = int.Parse(Rd["byteCourseClass"].ToString());

                if (!Rd["byteCreditHours"].Equals(DBNull.Value))
                {
                    Cr.iCredit = int.Parse(Rd["byteCreditHours"].ToString());
                }
                else
                {
                    Cr.iCredit = 0;
                }
                //Collect Elective Options
                if (Cr.sCourse == "ELECT1" || Cr.sCourse == "ELECT2" || Cr.sCourse == "MELECT1" || Cr.sCourse == "MELECT2" || Cr.sCourse == "MELECT3")
                {
                    Cr.isElectve  = true;
                    Cr.sElectives = new List <string>();
                    Cr.sElectives = GetElective(sCollege, sDegree, sMajor, iOrder, Campus);
                }
                //Collect Courses Prerequisites
                if (isPreIncluded == true)
                {
                    Cr.iPre = new List <int>();
                    Cr.iPre = GetPrerequisite(sCollege, sDegree, sMajor, Cr.sCourse, Campus);
                }
                Result.Add(Cr);
            }
            Rd.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine("{0} Exception caught.", ex.Message);
        }
        finally
        {
            Conn.Close();
            Conn.Dispose();
        }
        return(Result);
    }
Exemplo n.º 30
0
    public List <Plans> GetPlans(string sCollege, string sDegree, string sMajor, bool isPreIncluded, InitializeModule.EnumCampus Campus)
    {
        Connection_StringCLS myConnection_String = new Connection_StringCLS(Campus);
        SqlConnection        Conn = new SqlConnection(myConnection_String.Conn_string);

        Conn.Open();
        SqlCommand    Cmd, CmdCourses, CmdElect, CmdPre;
        SqlDataReader Rd, RdCourses, RdElect, RdPre;
        List <Plans>  Result = new List <Plans>();

        try
        {
            string sSQL = "SELECT S.strCollege,S.strDegree,S.strSpecialization,S.strMajor,S.strDisplay,S.intStudyHours,S.ElectiveCreditHours";
            sSQL += " FROM dbo.Reg_Specializations AS S ";
            sSQL += " WHERE (1 = 1)";

            if (!string.IsNullOrEmpty(sCollege))
            {
                sSQL += " AND strCollege ='" + sCollege + "'";
            }
            if (!string.IsNullOrEmpty(sDegree))
            {
                sSQL += " AND strDegree ='" + sDegree + "'";
            }
            if (!string.IsNullOrEmpty(sMajor))
            {
                sSQL += " AND strSpecialization ='" + sMajor + "'";
            }

            Cmd = new SqlCommand(sSQL, Conn);
            Rd  = Cmd.ExecuteReader();
            int             iPlan = 0;
            Plans           Plan;
            PlanCourses.Crs Cr;
            string          sCCollege = "";
            string          sCDegree  = "";
            string          sCMajor   = "";

            while (Rd.Read())
            {
                iPlan       += 1;
                Plan         = new Plans();
                Plan.College = Rd["strCollege"].ToString();
                Plan.Degree  = Rd["strDegree"].ToString();
                Plan.Major   = Rd["strSpecialization"].ToString();

                sCCollege = Plan.College;
                sCDegree  = Plan.Degree;
                sCMajor   = Plan.Major;

                Plan.PlanDesc   = Rd["strMajor"].ToString();
                Plan.SDisplay   = Rd["strDisplay"].ToString();
                Plan.Plan       = iPlan;
                Plan.StudyHours = int.Parse(Rd["intStudyHours"].ToString());
                Plan.Elective   = int.Parse(Rd["ElectiveCreditHours"].ToString());
                //Collect Plan Courses
                Plan.Courses = new List <PlanCourses.Crs>();
                Plan.Courses = GetCourses(sCCollege, sCDegree, sCMajor, isPreIncluded, Campus);

                Result.Add(Plan);
            }
            Rd.Close();
        }

        catch (Exception ex)
        {
            Console.WriteLine("{0} Exception caught.", ex.Message);
        }
        finally
        {
            Conn.Close();
        }
        return(Result);
    }