Ejemplo n.º 1
0
        private void LoadYourApprovals()
        {
            if (Session["FACinstdiv"].ToString().Length < 2)
            {
                ParentPortlet.ShowFeedback("Cannot process a blank INST_DIV");
                return;
            }


            //if (Session["userLevel"].ToString() == "Approver1")
            //{
            //    gv_Your_Approvals.DataSource = facultyApprovalsView.getYourApprover1RecordsFaculty(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString(), Session["FACidnum"].ToString(),Session["FACinstdiv"].ToString());
            //    //gv_Your_Approvals.DataSource = approvalsView.getYourApprover1FacultyDiscipline(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString());
            //    gv_Your_Approvals.DataBind();
            //}
            //else if (Session["userLevel"].ToString() == "Approver2")
            //{
            //    gv_Your_Approvals.DataSource = facultyApprovalsView.getYourApprover2RecordsFaculty(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString(), Session["FACidnum"].ToString());
            //    //gv_Your_Approvals.DataSource = approvalsView.getYourApprover2FacultyDiscipline(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString());
            //    gv_Your_Approvals.DataBind();
            //}
            //else if (Session["userLevel"].ToString() == "Approver3")
            //{
            //    gv_Your_Approvals.DataSource = facultyApprovalsView.getYourApprover3RecordsFaculty(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString(), Session["FACidnum"].ToString());
            //    //gv_Your_Approvals.DataSource = approvalsView.getYourApprover3FacultyDiscipline(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString());
            //    gv_Your_Approvals.DataBind();
            //}
            //else if (Session["userLevel"].ToString() == "FacCredUser")
            //{
            //    gv_Your_Approvals.DataSource = facultyApprovalsView.getYourFacCredUserRecordsFaculty(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString(), Session["FACidnum"].ToString());
            //    //gv_Your_Approvals.DataSource = approvalsView.getYourFacCredUserFacultyDiscipline(Session["userLevel"].ToString(), Session["yearcode"].ToString(), Session["termcode"].ToString());
            //    gv_Your_Approvals.DataBind();
            //}
        }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                TabDropDownSettingMapperService tabSettingsService = new TabDropDownSettingMapperService();
                TabDropDownSettings             tabSettings        = tabSettingsService.GetSettings();

                if (tabSettings == null)
                {
                    tabSettings = new TabDropDownSettings();
                }

                tabSettings.EnableDropDown          = cbxEnable.Checked;
                tabSettings.DisplayPages            = cbxPages.Checked;
                tabSettings.DisplaySubSections      = cbxSubSections.Checked;
                tabSettings.DisplaySubPagesPortlets = cbxSubPagesPortlets.Checked;
                tabSettings.DisplayAlphaOrder       = cbxAlphaOrder.Checked;
                tabSettingsService.Save(tabSettings);
                ParentPortlet.ShowFeedback(FeedbackType.Message, "The settings were successfully saved.");
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedback(FeedbackType.Error, "The system encountered an error saving the setting, please contact your ITS administrator.");
            }
        }
Ejemplo n.º 3
0
        protected void gv_Faculty_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string ctrlName = ((Control)sender).ID;
            string cmdName  = e.CommandName.ToString();

            int         rowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow row      = gv_Faculty.Rows[rowIndex];

            Session["FACappid"] = (string)this.gv_Faculty.DataKeys[rowIndex]["FACappid"];
            Session["FACidnum"] = (string)this.gv_Faculty.DataKeys[rowIndex]["FACidnum"];

            // FACULTY VALUES:
            Session["FAClastname"]       = row.Cells[0].Text;
            Session["FACfirstname"]      = row.Cells[1].Text;
            Session["FACinstructorType"] = row.Cells[2].Text;
            Session["FACdivcode"]        = row.Cells[3].Text;
            Session["FACinstdiv"]        = row.Cells[4].Text;
            Session["FACschoolcode"]     = row.Cells[5].Text;



            //CLEAR OUT the Course Fields
            Session["CRSDesc"]       = "";
            Session["CRSappid"]      = "";
            Session["FACload"]       = "";
            Session["FAClead"]       = "";
            Session["CRSinstdiv"]    = "";
            Session["CRSschoolcode"] = "";



            switch (cmdName)
            {
            case "gv_Faculty_Note":
            {
                Session["NOTEnote"] = "";
                ParentPortlet.NextScreen("FacultyNoteScreen");
            }
            break;

            case "gv_Faculty_Discipline":
            {
                if (Session["userLevel"].ToString() != "FacCredUser")
                {
                    ParentPortlet.NextScreen("DisciplineUpdateScreen");
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Only for Approvers");
                }
            }
            break;

            case "gv_Faculty_Degree":
            {
                ParentPortlet.NextScreen("EDUEarnHistScreen");
            }
            break;
            }
        }
        //-------- DIVISION UPDATE  -----------------------------------------------

        protected void btn_Division_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please select an Approval Status before saving");
                    return;
                }
                else if (txt_Division.Text.Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Cannot process a Blank DIVISION");
                    return;
                }

                if (Session["userLevel"].ToString() == "Approver1")
                {
                    InsertCourseDivisionRecs();
                }

                UpdateCourseDivisionRecs();
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }
            finally
            {
            }
        }
        internal bool LogAction(String reason, Guid userId)
        {
            try
            {
                var logger = new BCLoggerMapperService();

                if (_logIpAddress)
                {
                    reason = reason + " (" + Request.UserHostAddress + ")";
                }

                return(logger.AddLog(ParentPortlet.Portlet.PortletTemplate.ID.AsGuid, PortalUser.Current.ID.AsGuid, userId, reason, DateTime.Now));
            }
            catch (Exception ex)
            {
                if (PortalUser.Current.IsSiteAdmin)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, Globalizer.GetGlobalizedString("CUS_BC_PL_ERROR_ADMIN") + ex);
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, Globalizer.GetGlobalizedString("CUS_BC_PL_ERROR_USER"));
                }

                return(false);
            }
        }
        protected bool InsertCourseDivisionRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please select an Approval Status before saving");
                }
                else if (txt_Division.Text.Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Cannot process a Blank DIVISION_CDE");
                }
                else
                {
                    rtn = courseApprovalsView.InsertCourseDivisionRecords(
                        ddl_Approval_Status.SelectedValue.ToString(),
                        Session["FACappid"].ToString(),
                        Session["FACidnum"].ToString(),
                        Session["userlevel"].ToString(),
                        Session["yearcode"].ToString(),
                        Session["termcode"].ToString(),
                        Session["FACfirstname"].ToString(),
                        Session["FAClastname"].ToString(),
                        rightNow,
                        txt_Division.Text
                        );


                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "Success");
                    }
                    else
                    {
                        //failure - do not change screens
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "Failure");
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }
            finally
            {
            }

            return(rtn);
        }
Ejemplo n.º 7
0
        protected bool InsertDisciplineRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback("Please select an Approval Status before saving");
                }
                else
                {
                    //rtn = approvalsView.InsertDisciplineRecords(
                    //        //Session["approvalCode"].ToString(),
                    //        ddl_Approval_Status.SelectedValue.ToString(),
                    //        Session["FACappid"].ToString(),
                    //        Session["FACidnum"].ToString(),
                    //        Session["yearcode"].ToString(),
                    //        Session["termcode"].ToString(),
                    //        Session["SM_appid"].ToString(),
                    //        Session["userLevel"].ToString(),
                    //        Session["CRSdesc"].ToString(),
                    //        Session["FACfirstname"].ToString(),
                    //        Session["FAClastname"].ToString(),
                    //        Session["FACinstructorType"].ToString(),
                    //        rightNow,
                    //        Session["FACinstdiv"].ToString()
                    //     );


                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback("Success");
                    }
                    else
                    {
                        //failure - do not change screens
                        ParentPortlet.ShowFeedback("Failure");
                    }
                }
            }
            catch (Exception e)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = e.Message;
                ExceptionManager.Publish(e);
            }
            finally
            {
            }

            return(rtn);
        }
        protected bool UpdateFacultyDivisionRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback("Please select an Approval Status before saving");
                }
                else if (txt_Division.Text.Length < 2)
                {
                    ParentPortlet.ShowFeedback("Cannot process a blank Division");
                }
                else
                {
                    rtn = facultyApprovalsView.UpdateFacultyDivisionRecords(
                        ddl_Approval_Status.SelectedValue.ToString(),
                        Session["FACappid"].ToString(),
                        Session["FACidnum"].ToString(),
                        Session["userLevel"].ToString(),
                        Session["FACfirstname"].ToString(),
                        Session["FAClastname"].ToString(),
                        Session["FACinstructorType"].ToString(),
                        dp_Approval_Date.SelectedDate.ToString(DateFormat),
                        dp_Expiration_Date.SelectedDate.ToString(DateFormat),
                        rightNow,
                        txt_Division.Text
                        );


                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback("Success");
                    }
                    else
                    {
                        //failure
                        ParentPortlet.ShowFeedback("it failed");
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized("Update Failed");
            }

            return(rtn);
        }
Ejemplo n.º 9
0
 public void LoadFacultyApprovalScreen(object sender, EventArgs e)
 {
     if (Session["userLevel"].ToString() == "FacCredUser")
     {
         ParentPortlet.ShowFeedback(FeedbackType.Error, "Not Authorized");
     }
     else
     {
         ParentPortlet.NextScreen("FacultyApprovalScreen");
     }
 }
Ejemplo n.º 10
0
 public void LoadStatusScreen(object sender, EventArgs e)
 {
     if (Session["yearcode"].ToString() == "YR" || Session["termcode"].ToString() == "TRM")
     {
         ParentPortlet.ShowFeedback("Please select a Year and Term first :)");
     }
     else
     {
         ParentPortlet.NextScreen("StatusScreen");
     }
 }
Ejemplo n.º 11
0
 protected void btn_Faculty_Refresh_Click(object sender, EventArgs e)
 {
     if (Session["userLevel"].ToString() == "FacCredAdmin")
     {
         facultyview.ExecuteFacultyReset();
         ParentPortlet.ShowFeedback(FeedbackType.Success, "Faculty Successfully Refreshed");
     }
     else
     {
         ParentPortlet.ShowFeedback(FeedbackType.Error, "FacCredAdmin must run this process");
     }
 }
Ejemplo n.º 12
0
        protected void btn_ADD_Click(object sender, EventArgs e)
        {
            UserAccessMapperService userAccessService = new UserAccessMapperService();
            UserAccessNHibernate    userAccess        = new UserAccessNHibernate();

            Guid newId = Guid.NewGuid();

            //ADD A NEW DISCIPLINE
            userAccess = new UserAccessNHibernate
            {
                ID         = newId,
                USER_ID    = Session["SelectedUserID"].ToString(),
                FIRST_NAME = Session["SelectedUserFirstName"].ToString(),
                LAST_NAME  = Session["SelectedUserLastName"].ToString(),
                SCHOOL_CDE = ddl_SchoolCodes.SelectedValue,
            };

            if (ddl_SchoolCodes.SelectedValue.Length < 2)
            {
                ParentPortlet.ShowFeedback("Please Select a School Code before Saving.");
                return;
            }

            var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            try
            {
                using (var transaction = nHibernateSession.BeginTransaction())
                {
                    nHibernateSession.Save(userAccess);
                    transaction.Commit();

                    ParentPortlet.ShowFeedback(FeedbackType.Success, "Access Successfully Added!");
                }
            }
            catch (Exception exception)
            {
                var msg = PortalUser.Current.IsSiteAdmin
                    ? "Selected Access was not added! Error: " + exception.Message
                    : "Selected Access was not added! ";

                this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);
                ExceptionManager.Publish(exception);
                return;
            }
            finally
            {
                nHibernateSession.Close();
            }

            InitScreen();
        }
Ejemplo n.º 13
0
        protected bool UpdateDisciplineRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback("Please select an Approval Status before saving");
                }
                else
                {
                    //rtn = approvalsView.UpdateDisciplineRecords(
                    //    ddl_Approval_Status.SelectedValue.ToString(),
                    //    Session["FACappid"].ToString(),
                    //    Session["FACidnum"].ToString(),
                    //    Session["yearcode"].ToString(),
                    //    Session["termcode"].ToString(),
                    //    Session["SM_appid"].ToString(),
                    //    Session["userLevel"].ToString(),
                    //    Session["CRSdesc"].ToString(),
                    //    Session["FACfirstname"].ToString(),
                    //    Session["FAClastname"].ToString(),
                    //    Session["FACinstructorType"].ToString(),
                    //    rightNow,
                    //    Session["FACinstdiv"].ToString()

                    //    );


                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback("Success");
                    }
                    else
                    {
                        //failure
                        ParentPortlet.ShowFeedback("it failed");
                    }
                }
            }
            catch
            {
                ParentPortlet.ShowFeedback("Trouble!");
            }

            return(rtn);
        }
Ejemplo n.º 14
0
        protected void gv_Approvals_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string ctrlName = ((Control)sender).ID;
            string cmdName  = e.CommandName.ToString();

            int         rowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow row      = gv_Approvals.Rows[rowIndex];

            Session["FACappid"] = (string)gv_Approvals.DataKeys[rowIndex]["FACappid"];
            Session["FACidnum"] = (string)gv_Approvals.DataKeys[rowIndex]["FACidnum"];

            // setting these here to properly load the next screen on select
            Session["FAClastname"]       = row.Cells[1].Text;
            Session["FACfirstname"]      = row.Cells[2].Text;
            Session["FACinstructorType"] = row.Cells[3].Text;
            Session["FACinstdiv"]        = row.Cells[4].Text;
            //Session["FACappid"] = row.Cells[7].Text;
            //Session["FACidnum"] = row.Cells[8].Text;
            //Session["CRSappid"] = row.Cells[9].Text;
            //Session["CRSdesc"] = row.Cells[1].Text;

            if (Session["FACinstdiv"].ToString() == "&nbsp;")
            {
                ParentPortlet.ShowFeedback("Cannot process a blank INST_DIV");
                return;
            }
            else
            {
                switch (cmdName)
                {
                case "gv_Approvals_Approve":
                {
                    if (Session["userLevel"].ToString() == "Approver1" ||
                        Session["userLevel"].ToString() == "Approver2" ||
                        Session["userLevel"].ToString() == "Approver3")
                    {
                        ParentPortlet.NextScreen("ApprovalUpdateScreen");
                    }
                }
                break;

                case "gv_Approvals_Note":
                {
                    //Session["noteText"] = "";
                    //ParentPortlet.NextScreen("ApprovalUpdateScreen");
                }
                break;
                }
            }
        }
Ejemplo n.º 15
0
        protected void RemoveSelectedSchoolCodeAccess()
        {
            bool rtn = view.DeleteOneUserDirectAccess(Session["SCA_ID"].ToString());

            if (rtn)
            {
                // deleted
                ParentPortlet.ShowFeedback(FeedbackType.Message, "The selected record was successfully removed");
            }
            else
            {
                // failed
                ParentPortlet.ShowFeedback(FeedbackType.Error, "Record was not deleted, please try again");
            }
        }
Ejemplo n.º 16
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback("Please select an Approval Status before saving");
                }
                else
                {
                    //rtn = approvalsView.InsertUpdateApproval(
                    //        ddl_Approval_Status.SelectedValue.ToString(),
                    //        Session["FACappid"].ToString(),
                    //        Session["FACidnum"].ToString(),
                    //        Session["SM_appid"].ToString(),
                    //        Session["approvalYear"].ToString(),
                    //        Session["approvalTerm"].ToString(),
                    //        Session["userLevel"].ToString(),
                    //        Session["approvalCourse"].ToString(),
                    //        Session["FACfirstname"].ToString(),
                    //        Session["FAClastname"].ToString(),
                    //        Session["FACinstructorType"].ToString(),
                    //        rightNow,
                    //        Session["FACinstdiv"].ToString()
                    //        );

                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback("Success");
                    }
                    else
                    {
                        //failure
                        ParentPortlet.ShowFeedback("Failed");
                    }
                }
            }
            catch
            {
                ParentPortlet.ShowFeedback("Trouble!");
            }
        }
Ejemplo n.º 17
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            bool isUpdate = false;

            //Create an instance of the EmailAddressService
            using (IContainer factory = ObjectFactory.Container.GetNestedContainer("ADV"))
            {
                IEmailAddressService emailService = factory.GetInstance <IEmailAddressService>();

                EmailAddressDTO emailAddress = new EmailAddressDTO();

                if (Session["EmailEditId"] != null)
                {
                    emailAddress = emailService.Get(Convert.ToInt32(Session["EmailEditId"].ToString()));
                    isUpdate     = true;
                }

                emailAddress.Priority      = chknPriority.Checked;
                emailAddress.EmailAddress  = txtEmailAddr.Text;
                emailAddress.AddressTypeId = Convert.ToInt32(ddlAddressType.SelectedValue);
                emailAddress.BeginsOn      = Convert.ToDateTime(txtBeginsOn.Text);
                if (txtEndsOn.Text.HasValue())
                {
                    emailAddress.EndsOn = Convert.ToDateTime(txtEndsOn.Text);
                }

                try
                {
                    EmailAddressDTO ret = isUpdate
                        ? emailService.Update(Convert.ToInt32(txtUserId.Text), emailAddress)
                        : emailService.Create(Convert.ToInt32(txtUserId.Text), emailAddress);

                    if (ret == null)
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "Error occured while creating email address.");
                    }
                }
                catch (MissingDataException ex)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, ex.Message);
                }
            }

            ClearData();
            GetJxAddresses();
        }
Ejemplo n.º 18
0
 public void LoadCourseApprovalScreen(object sender, EventArgs e)
 {
     if (DropDownList_term.SelectedValue == "TRM" || DropDownList_year.SelectedValue == "YR")
     {
         ParentPortlet.ShowFeedback(FeedbackType.Error, "Please select a Year and Term first :)");
     }
     else
     {
         if (Session["userLevel"].ToString() == "FacCredUser")
         {
             ParentPortlet.ShowFeedback(FeedbackType.Error, "Not Authorized");
         }
         else
         {
             ParentPortlet.NextScreen("CourseApprovalScreen");
         }
     }
 }
        protected bool UpdateCourseSchoolCodeRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                rtn = courseApprovalsView.UpdateCourseSchoolCodeRecords(
                    ddl_Approval_Status.SelectedValue.ToString(),
                    Session["FACappid"].ToString(),
                    Session["FACidnum"].ToString(),
                    Session["userlevel"].ToString(),
                    Session["yearcode"].ToString(),
                    Session["termcode"].ToString(),
                    Session["FACfirstname"].ToString(),
                    Session["FAClastname"].ToString(),
                    rightNow,
                    txt_SchoolCode.Text
                    );

                if (rtn)
                {
                    //success
                    ParentPortlet.ShowFeedback(FeedbackType.Success, "Success");
                }
                else
                {
                    //failure
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "failed");
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }

            return(rtn);
        }
        protected bool InsertCourseInstDivRecs()
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please select an Approval Status before saving");
                }
                else
                {
                    rtn = courseApprovalsView.InsertCourseInstDivRecords(
                        ddl_Approval_Status.SelectedValue.ToString(),
                        Session["FACappid"].ToString(),
                        Session["FACidnum"].ToString(),
                        Session["userlevel"].ToString(),
                        Session["yearcode"].ToString(),
                        Session["termcode"].ToString(),
                        Session["FACfirstname"].ToString(),
                        Session["FAClastname"].ToString(),
                        rightNow,
                        txt_InstDiv.Text);
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Insert Failed");
            }
            finally
            {
            }

            return(rtn);
        }
        //-------- SCHOOL CODE UPDATE  -----------------------------------------------

        protected void btn_SchoolCode_Save_Click(object sender, EventArgs e)
        {
            bool insertRtn = false;
            bool updateRtn = false;

            try
            {
                if (txt_SchoolCode.Text.Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Cannot process a Blank SCHOOL_CDE");
                }
                else if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please select an Approval Status before saving");
                }
                else
                {
                    if (Session["userLevel"].ToString() == "Approver1")
                    {
                        insertRtn = InsertCourseSchoolCodeRecs();
                    }

                    updateRtn = UpdateCourseSchoolCodeRecs();
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }
            finally
            {
            }
        }
        private void PerformLogin()
        {
            var username = tbUserName.Text;

            var user = getPortalUserByUserName(username);

            if (user != null)
            {
                var roleCheck = new RoleChecker().RoleCheck(user, ParentPortlet.Portlet.PortletTemplate);
                if (roleCheck.Success)
                {
                    if (LogAction(tbReason.Text, user.ID))
                    {
                        var currentUser = PortalUser.Current.Username;
                        HttpContext.Current.Session.Clear();
                        HttpContext.Current.Session["file_access"] = new StringDictionary();// UploadFile doesn't check to see if there is a valid StringDictionary here, and does a cast.  This causes a unhandled exception that bubbles up to a YSOD

                        PortalGlobal.Login(user.Username, String.Empty);
                        HttpContext.Current.Session["ProxyLoginOriginalUser"] = currentUser;
                        BCProxyLogin.RedirectUrl(Response);
                    }
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, roleCheck.Reason);
                    if (_logFailures)
                    {
                        LogAction(roleCheck.Reason, user.ID);
                    }
                }
            }
            else
            {
                ParentPortlet.ShowFeedback(FeedbackType.Message, Globalizer.GetGlobalizedString("CUS_BC_PL_USER_NOT_FOUND"));
            }
        }
Ejemplo n.º 23
0
        private void ggDisciplines_DeleteCommand(object sender, DataGridCommandEventArgs e)
        {
            //var disciplinesService = new DisciplinesMapperService();

            Guid disciplineId = new Guid(ggDisciplines.DataKeys[e.Item.ItemIndex].ToString());
            bool rtn          = false;

            try
            {
                // disciplinesService.DeleteDiscipline(disciplineId);
                rtn = facultyView.deleteOneFacultyXREF(disciplineId);

                if (rtn)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Success, "XREF Successfully Removed!");
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "XREF was not Removed!");
                }
            }
            catch (Exception exception)
            {
                var msg = PortalUser.Current.IsSiteAdmin
                    ? "This Discipline was not Deleted. " + exception.Message
                    : "This Discipline was not Deleted.";

                this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);

                ExceptionManager.Publish(exception);
                return;
            }

            ParentPortlet.Session["EditId"] = null;
            InitScreen();
        }
 protected void BtnLoginClick(object sender, EventArgs e)
 {
     if (String.Empty == tbReason.Text.Trim())
     {
         ParentPortlet.ShowFeedback(FeedbackType.Message, Globalizer.GetGlobalizedString("CUS_BC_PL_REQUIRED_REASON"));
     }
     else if (_requirePassword && !ValidPassword())
     {
         ParentPortlet.ShowFeedback(FeedbackType.Message, Globalizer.GetGlobalizedString("CUS_BC_PL_INVALID_PW"));
         if (_logFailures)
         {
             var user = getPortalUserByUserName(tbUserName.Text);
             LogAction(Globalizer.GetGlobalizedString("CUS_BC_PL_INVALID_PW"), user.ID);
         }
     }
     else if (HttpContext.Current.Session["ProxyLoginOriginalUser"] != null)
     {
         ParentPortlet.ShowFeedback(FeedbackType.Message, Globalizer.GetGlobalizedString("CUS_BC_PL_ALREADY_PROXIED"));
     }
     else
     {
         PerformLogin();
     }
 }
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);
            //DateTime rightNow = DateTime.Now;

            string et;

            if (dp_Expiration_Date.DateIsEmpty)
            {
                et = DateTime.MaxValue.ToString(DateFormat);
            }
            else
            {
                et = dp_Expiration_Date.SelectedDate.ToString(DateFormat);
                Session["approvalExpirationDate"] = et;
            }

            if (Session["FACinstdiv"].ToString().Length < 2 || Session["FACinstdiv"].ToString().Length > 2)
            {
                ParentPortlet.ShowFeedback(FeedbackType.Error, "Cannot Approve a blank InstDiv");
                return;
            }

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0" || dp_Approval_Date.DateIsEmpty || txt_InstDiv.Text.Length < 1)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please Edit a record, then select a value in each of the three fields before saving");
                }
                else
                {
                    rtn = facultyApprovalsView.InsertUpdateFacultyApproval(ddl_Approval_Status.SelectedValue.ToString(),
                                                                           Session["FACappid"].ToString(),
                                                                           Session["FACidnum"].ToString(),
                                                                           Session["FACdivcode"].ToString(),
                                                                           Session["FACinstdiv"].ToString(),
                                                                           Session["FACschoolcode"].ToString(),
                                                                           Session["FAClastname"].ToString(),
                                                                           Session["FACfirstname"].ToString(),
                                                                           Session["FACinstructorType"].ToString(),
                                                                           dp_Approval_Date.SelectedDate.ToString(DateFormat),
                                                                           et,
                                                                           rightNow,
                                                                           Session["userLevel"].ToString());

                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "Faculty Approval Status Saved");
                    }
                    else
                    {
                        //failure
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "No Love :(");
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }
        }
Ejemplo n.º 26
0
        protected void gv_Faculty_Approvals_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string ctrlName = ((Control)sender).ID;
            string cmdName  = e.CommandName.ToString();

            int         rowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow row      = gv_Faculty_Approvals.Rows[rowIndex];

            if (row.Cells[0].Text == "&nbsp;")
            {
                ParentPortlet.ShowFeedback("nothing to approve, silly person :)");
                return;
            }

            Session["FACappid"] = (string)gv_Faculty_Approvals.DataKeys[rowIndex]["FACappid"];
            Session["FACidnum"] = (string)gv_Faculty_Approvals.DataKeys[rowIndex]["FACidnum"];

            // setting these here to properly load the next screen on select
            Session["FAClastname"]  = row.Cells[1].Text;
            Session["FACfirstname"] = row.Cells[2].Text;
            if (row.Cells[3].Text == "&nbsp;")
            {
                Session["FACinstructorType"] = " ";
            }
            else
            {
                Session["FACinstructorType"] = row.Cells[3].Text;
            }

            switch (cmdName)
            {
            case "gv_FacultyApprovals_Approve":
            {
                if (Session["userLevel"].ToString() == "Approver1" ||
                    Session["userLevel"].ToString() == "Approver2" ||
                    Session["userLevel"].ToString() == "Approver3")
                {
                    if (Session["FACidnum"].ToString().Length > 1)
                    {
                        ParentPortlet.NextScreen("FacultyApprovalUpdateScreen");
                    }
                    else
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "Are you trying to break the system?  shame shame shame :)");
                    }
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Only for Approvers");
                }
            }
            break;

            case "gv_FacultyApprovals_Note":
            {
                //Session["noteText"] = "";
                //ParentPortlet.NextScreen("ApprovalUpdateScreen");
            }
            break;
            }
        }
Ejemplo n.º 27
0
        protected void btn_ADD_Click(object sender, EventArgs e)
        {
            //UserAccessMapperService userAccessService = new UserAccessMapperService();
            //UserAccessNHibernate userAccess = new UserAccessNHibernate();

            Guid newId = Guid.NewGuid();

            ////ADD A NEW DISCIPLINE
            //userAccess = new UserAccessNHibernate
            //{
            Guid   ID         = newId;
            string USER_ID    = Session["SelectedUserID"].ToString();
            string FIRST_NAME = Session["SelectedUserFirstName"].ToString();
            string LAST_NAME  = Session["SelectedUserLastName"].ToString();
            string SCHOOL_CDE = ddl_SchoolCodes.SelectedValue;

            //};

            if (ddl_SchoolCodes.SelectedValue.Length < 2)
            {
                ParentPortlet.ShowFeedback("Please Select a School Code before Saving.");
                return;
            }

            try
            {
                bool rtn = view.InsertOneRecordDirectAccess(ID, USER_ID, FIRST_NAME, LAST_NAME, SCHOOL_CDE);

                if (rtn)
                {
                    // inserted
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "The selected record was successfully added");
                }
                else
                {
                    // failed
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "Record was not added, please try again");
                }
            }
            catch (Exception exception)
            {
                this.ParentPortlet.ShowFeedback(FeedbackType.Error, "Trouble adding a new record");
                ExceptionManager.Publish(exception);
                return;
            }

            //var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            //try
            //{
            //    using (var transaction = nHibernateSession.BeginTransaction())
            //    {
            //        nHibernateSession.Save(userAccess);
            //        transaction.Commit();

            //        ParentPortlet.ShowFeedback(FeedbackType.Success, "Access Successfully Added!");
            //    }
            //}
            //catch (Exception exception)
            //{
            //    var msg = PortalUser.Current.IsSiteAdmin
            //        ? "Selected Access was not added! Error: " + exception.Message
            //        : "Selected Access was not added! ";

            //    this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);
            //    ExceptionManager.Publish(exception);
            //    return;
            //}
            //finally
            //{
            //    nHibernateSession.Close();
            //}

            InitScreen();
        }
Ejemplo n.º 28
0
        //protected void btn_New_Click(object sender, EventArgs e)
        //{
        //    string DateFormat = "MM-dd-yyyy";
        //    string rightNow = DateTime.Now.ToString(DateFormat);

        //    DateTime theDate = DateTime.Now;
        //    DateTime yearLater = theDate.AddYears(1);

        //    ParentPortlet.Session["EditId"] = null;

        //    ddl_Note_Types.SelectedValue = "0";
        //    ddl_Note_levels.SelectedValue = "0";
        //    txt_Subject.Text = "";
        //    txtNote.InnerText = "";
        //    ddl_Status_codes.SelectedValue = "A";

        //    dp_Approval_Date.SelectedDate = DateTime.Now;
        //    dp_Expiration_Date.SelectedDate = yearLater;

        //    ParentPortlet.Session.Remove("EditId");
        //}

        protected void btn_Save_Click(object sender, EventArgs e)
        {
            //NotesMapperService notesService = new NotesMapperService();
            //NotesNHibernate note = new NotesNHibernate();
            //var nHibernateSession = new NHibernateFactory().GetSessionFactory().OpenSession();

            string DateFormat     = "yyyy-MM-dd";
            string updateFormat   = "yyyy-MM-dd hh:mm:ss";
            string rightNow       = DateTime.Now.ToString(DateFormat);
            string updateRightNow = DateTime.Now.ToString(updateFormat);
            bool   rtn            = false;



            if (ddl_Note_Types.SelectedValue == "0")
            {
                ParentPortlet.ShowFeedback(FeedbackType.Error, "Please Select a Note Type");
                return;
            }
            if (ddl_Note_levels.SelectedValue == "0")
            {
                ParentPortlet.ShowFeedback(FeedbackType.Error, "Please Select a Note Level");
                return;
            }

            if (ddl_Note_levels.SelectedValue == "YEARTERM")
            {
                if (Session["yearcode"].ToString() == "YR" || Session["termcode"].ToString() == "TRM")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, " Don't forget to select a YEAR and TERM first :) ");
                    return;
                }
            }


            if (ddl_Note_levels.SelectedValue == "FACULTY")
            {
                // faculty notes do not need DISCIPLINE ,INST_DIV , DIVISION OR SCHOOL_CDE
            }
            else
            {
                if (Session["FACdivcode"].ToString().Length > 2 || Session["FACdivcode"].ToString().Length < 2)
                {
                    Session["FACdivcode"] = "UG";
                }

                if (Session["FACinstdiv"].ToString().Length > 2 || Session["FACinstdiv"].ToString().Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "Cannot create a Note for a Blank InstDivision");
                    return;
                }

                if (Session["FACschoolcode"].ToString().Length > 2 || Session["FACschoolcode"].ToString().Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "Cannot create a Note for a Blank SchoolCode");
                    return;
                }
            }



            if (ParentPortlet.Session["EditId"].ToString().Length > 20 && ParentPortlet.Session["EditId"].ToString() != "00000000-0000-0000-0000-000000000000")
            {
                //EDIT A SELECTED NOTE
                Guid noteId = new Guid(ParentPortlet.Session["EditId"].ToString());
                rtn = false;

                rtn = noteView.updateOneFacultyNote(noteId, txt_Subject.Text, ddl_Status_codes.SelectedValue, txtNote.InnerText,
                                                    ddl_Note_Types.SelectedValue, ddl_Note_levels.SelectedValue,
                                                    dp_Approval_Date.SelectedDate, dp_Expiration_Date.SelectedDate, PortalUser.Current.Username, updateRightNow);

                if (rtn)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Success, "Note Successfully Updated!");
                }
                else
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Error, "Note was not Updated!");
                }
            }
            else
            {
                if (ParentPortlet.Session["noteLevel"].ToString() == "FACULTY")
                {
                    //CREATE A FACULTY SPECIFIC NOTE WITH NO YEAR AND TERM DATA
                    Guid noteId = Guid.NewGuid();
                    rtn = false;
                    //note = new NotesNHibernate

                    rtn = noteView.insertOneFacultyNote(noteId,
                                                        Session["FACappid"].ToString(),
                                                        Session["FACidnum"].ToString(),
                                                        "",
                                                        "",
                                                        "",
                                                        "",
                                                        "",
                                                        "",
                                                        "",
                                                        "",
                                                        txt_Subject.Text,
                                                        ddl_Status_codes.SelectedValue.ToString(),
                                                        txtNote.InnerText,
                                                        ddl_Note_Types.SelectedValue.ToString(),
                                                        ddl_Note_levels.SelectedValue.ToString(),
                                                        Session["FACinstructorType"].ToString(),
                                                        dp_Approval_Date.SelectedDate,
                                                        dp_Expiration_Date.SelectedDate,
                                                        PortalUser.Current.Username,
                                                        DateTime.Now,
                                                        PortalUser.Current.Username,
                                                        updateRightNow);

                    if (rtn)
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "Faculty Note Successfully Created!");
                    }
                    else
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "Faculty Note was not Created!");
                    }

                    // NHIBERNATE SETTINGS
                    //{
                    //    NOTE_ID = noteId,
                    //    FAC_APPID = Session["FACappid"].ToString(),
                    //    FAC_ID_NUM = Session["FACidnum"].ToString(),
                    //    SM_APPID = "",
                    //    CRS_CDE = "",
                    //    CRS_TITLE = "",
                    //    DIV_CDE = "",
                    //    INSTIT_DIV_CDE = "",
                    //    SCHOOL_CDE = "",
                    //    YEARCODE = "",
                    //    TERMCODE = "",
                    //    SUBJECT = txt_Subject.Text,
                    //    STATUS = ddl_Status_codes.SelectedValue.ToString(),
                    //    NOTE = txtNote.InnerText,
                    //    NOTE_TYPE = ddl_Note_Types.SelectedValue.ToString(),
                    //    NOTE_LEVEL = ddl_Note_levels.SelectedValue.ToString(),
                    //    FAC_TYPE = Session["FACinstructorType"].ToString(),
                    //    APPROVAL_DATE = dp_Approval_Date.SelectedDate,
                    //    EXPIRATION_DATE = dp_Expiration_Date.SelectedDate,
                    //    CREATE_BY = PortalUser.Current.Username,
                    //    CREATE_DATE = DateTime.Now,
                    //    UPDATE_BY = PortalUser.Current.Username,
                    //    UPDATE_DATE = updateRightNow
                    //};
                }
                else
                {
                    //CREATE A NEW NOTE
                    Guid noteId = Guid.NewGuid();
                    rtn = false;
                    //note = new NotesNHibernate

                    rtn = noteView.insertOneFacultyNote(noteId,
                                                        Session["FACappid"].ToString(),
                                                        Session["FACidnum"].ToString(),
                                                        "",
                                                        "",
                                                        "",
                                                        Session["FACdivcode"].ToString(),
                                                        Session["FACinstdiv"].ToString(),
                                                        Session["FACschoolcode"].ToString(),
                                                        Session["yearcode"].ToString(),
                                                        Session["termcode"].ToString(),
                                                        txt_Subject.Text,
                                                        ddl_Status_codes.SelectedValue.ToString(),
                                                        txtNote.InnerText,
                                                        ddl_Note_Types.SelectedValue.ToString(),
                                                        ddl_Note_levels.SelectedValue.ToString(),
                                                        Session["FACinstructorType"].ToString(),
                                                        dp_Approval_Date.SelectedDate,
                                                        dp_Expiration_Date.SelectedDate,
                                                        PortalUser.Current.Username,
                                                        DateTime.Now,
                                                        PortalUser.Current.Username,
                                                        updateRightNow);

                    if (rtn)
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "YEARTERM Note Successfully Created!");
                    }
                    else
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "YEARTERM Note was not Created!");
                    }


                    // NHIBERNATE SETTINGS
                    //{
                    //    NOTE_ID = noteId,
                    //    FAC_APPID = Session["FACappid"].ToString(),
                    //    FAC_ID_NUM = Session["FACidnum"].ToString(),
                    //    SM_APPID = "",
                    //    CRS_CDE = "",
                    //    CRS_TITLE = "",
                    //    DIV_CDE = Session["FACdivcode"].ToString(),
                    //    INSTIT_DIV_CDE = Session["FACinstdiv"].ToString(),
                    //    SCHOOL_CDE = Session["FACschoolcode"].ToString(),
                    //    YEARCODE = Session["yearcode"].ToString(),
                    //    TERMCODE = Session["termcode"].ToString(),
                    //    SUBJECT = txt_Subject.Text,
                    //    STATUS = ddl_Status_codes.SelectedValue.ToString(),
                    //    NOTE = txtNote.InnerText,
                    //    NOTE_TYPE = ddl_Note_Types.SelectedValue.ToString(),
                    //    NOTE_LEVEL = ddl_Note_levels.SelectedValue.ToString(),
                    //    FAC_TYPE = Session["FACinstructorType"].ToString(),
                    //    APPROVAL_DATE = dp_Approval_Date.SelectedDate,
                    //    EXPIRATION_DATE = dp_Expiration_Date.SelectedDate,
                    //    CREATE_BY = PortalUser.Current.Username,
                    //    CREATE_DATE = DateTime.Now,
                    //    UPDATE_BY = PortalUser.Current.Username,
                    //    UPDATE_DATE = updateRightNow
                    //};
                }
            }


            try
            {
                // clear out the edit screen for the next record
                DateTime theDate   = DateTime.Now;
                DateTime yearLater = theDate.AddYears(1);

                ParentPortlet.Session["EditId"] = null;

                ddl_Note_Types.SelectedValue  = "0";
                ddl_Note_levels.SelectedValue = "0";
                txt_Subject.Text  = "";
                txtNote.InnerText = "";
                ddl_Status_codes.SelectedValue = "A";

                dp_Approval_Date.SelectedDate   = DateTime.Now;
                dp_Expiration_Date.SelectedDate = yearLater;

                ParentPortlet.Session.Remove("EditId");

                LoadNotes();
            }
            catch (Exception exception)
            {
                var msg = PortalUser.Current.IsSiteAdmin
                    ? "This note was not created! Error: " + exception.Message
                    : "This note was not created! Sorry!";

                this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);
                ExceptionManager.Publish(exception);
                return;
            }
            finally
            {
                // nHibernateSession.Close();
            }
        }
Ejemplo n.º 29
0
        protected void gv_Notes_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string ctrlName = ((Control)sender).ID;
            string cmdName  = e.CommandName.ToString();

            int         rowIndex = Convert.ToInt32(e.CommandArgument);
            GridViewRow row      = gv_Notes.Rows[rowIndex];


            ParentPortlet.Session["EditId"] = gv_Notes.DataKeys[rowIndex].Value.ToString();


            switch (cmdName)
            {
            case "gv_Notes_Edit":
            {
                //var notesService = new NotesMapperService();

                Guid noteId = new Guid(ParentPortlet.Session["EditId"].ToString());

                //var note = notesService.GetNote(noteId);
                DataTable dt = noteView.getOneFacultyNote(noteId);

                foreach (DataRow onerow in dt.Rows)
                {
                    txt_Subject.Text                = onerow["SUBJECT"].ToString().Trim();
                    txtNote.InnerText               = onerow["NOTE"].ToString().Trim();
                    ddl_Note_Types.SelectedValue    = onerow["NOTE_TYPE"].ToString();
                    ddl_Status_codes.SelectedValue  = onerow["STATUS"].ToString();
                    ddl_Note_levels.SelectedValue   = onerow["NOTE_LEVEL"].ToString();
                    dp_Approval_Date.SelectedDate   = Convert.ToDateTime(onerow["APPROVAL_DATE"]);
                    dp_Expiration_Date.SelectedDate = Convert.ToDateTime(onerow["EXPIRATION_DATE"]);
                }

                //gv_OneNote.DataSource = noteView.getOneFacultyNote(noteId);
                //gv_OneNote.DataBind();

                //txt_Subject.Text = oneSUBJECT.ToString();
                //txtNote.InnerText = oneNOTE.ToString();
                //ddl_Note_Types.SelectedValue = oneNOTE_TYPE.ToString();
                //ddl_Status_codes.SelectedValue = oneSTATUS.ToString();
                //ddl_Note_levels.SelectedValue = oneNOTE_LEVEL.ToString();
                //dp_Approval_Date.SelectedDate = Convert.ToDateTime(oneAPPROVAL_DATE);
                //dp_Expiration_Date.SelectedDate = Convert.ToDateTime(oneEXPIRATION_DATE);


                //if (note == null)
                //{
                //    ParentPortlet.ShowFeedback(FeedbackType.Error, "Note could not be loaded");
                //    return;
                //}
                //txt_Subject.Text = note.SUBJECT;
                //txtNote.InnerText = note.NOTE;
                //ddl_Note_Types.SelectedValue = note.NOTE_TYPE;
                //ddl_Status_codes.SelectedValue = note.STATUS;
                //ddl_Note_levels.SelectedValue = note.NOTE_LEVEL;
                //dp_Approval_Date.SelectedDate = Convert.ToDateTime(note.APPROVAL_DATE);
                //dp_Expiration_Date.SelectedDate = Convert.ToDateTime(note.EXPIRATION_DATE);
            }
            break;

            case "gv_Notes_Archive":
            {
                //var notesService = new NotesMapperService();
                ////var notesArchiveService = new NotesArchiveMapperService();
                Guid noteId = new Guid(ParentPortlet.Session["EditId"].ToString());
                bool rtn    = false;

                try
                {
                    rtn = noteView.moveNoteToArchive(noteId);

                    if (rtn)
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "Note Successfully Archived!");
                    }
                    else
                    {
                        ParentPortlet.ShowFeedback(FeedbackType.Error, "Note was not Archived!");
                    }
                }
                catch (Exception exception)
                {
                    var msg = PortalUser.Current.IsSiteAdmin
                                ? "This note was not Archived. " + exception.Message
                                : "This note was not Archived. ";

                    this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);

                    ExceptionManager.Publish(exception);
                }

                // NHIBERNATE CODE . . . LEAVING FOR NOW
                //try
                //{
                //    ArchiveNote(notesService.GetNote(noteId));

                //    notesService.DeleteNote(noteId);
                //}
                //catch (Exception exception)
                //{
                //    var msg = PortalUser.Current.IsSiteAdmin
                //        ? "This note was not Archived. " + exception.Message
                //        : "This note was not Archived. ";

                //    this.ParentPortlet.ShowFeedback(FeedbackType.Error, msg);

                //    ExceptionManager.Publish(exception);

                //}

                ParentPortlet.Session.Remove("EditId");
            }
            break;
            }
        }
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            bool   rtn        = false;
            string DateFormat = "yyyy-MM-dd HH:mm:ss";
            string rightNow   = DateTime.Now.ToString(DateFormat);

            try
            {
                if (ddl_Approval_Status.SelectedValue.ToString() == "0")
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please select an Approval Status before saving");
                }
                else if (txt_Division.Text.Length < 2 && txt_InstDiv.Text.Length < 2 && txt_SchoolCode.Text.Length < 2)
                {
                    ParentPortlet.ShowFeedback(FeedbackType.Message, "Please click on Edit of the row you want to make changes to, before saving");
                }
                else
                {
                    rtn = courseApprovalsView.InsertUpdateCourseApproval(
                        ddl_Approval_Status.SelectedValue.ToString(),
                        Session["FACappid"].ToString(),
                        Session["FACidnum"].ToString(),
                        Session["SM_appid"].ToString(),
                        Session["approvalYear"].ToString(),
                        Session["approvalTerm"].ToString(),
                        Session["approvalDivCode"].ToString(),
                        Session["approvalInstDiv"].ToString(),
                        Session["approvalSchoolCode"].ToString(),
                        Session["approvalCourse"].ToString(),
                        Session["approvalCourseTitle"].ToString(),
                        Session["FAClastname"].ToString(),
                        Session["FACfirstname"].ToString(),
                        Session["FACinstructorType"].ToString(),
                        Session["userLevel"].ToString(),
                        rightNow
                        );

                    if (rtn)
                    {
                        //success
                        ParentPortlet.ShowFeedback(FeedbackType.Success, "Success");
                        //clear out text fields
                        Session["approvalCourse"]      = "";
                        Session["approvalCourseTitle"] = "";
                        Session["approvalYear"]        = "";
                        Session["approvalTerm"]        = "";
                        Session["approvalStatus"]      = "";
                        Session["approvalDivCode"]     = "";
                        Session["approvalInstDiv"]     = "";
                        Session["approvalSchoolCode"]  = "";

                        txt_CRS.Text        = "";
                        txt_TITLE.Text      = "";
                        txt_InstDiv.Text    = "";
                        txt_Division.Text   = "";
                        txt_SchoolCode.Text = "";



                        ddl_Approval_Status.SelectedValue = "0";

                        ParentPortlet.Session.Remove("EditId");
                    }
                    else
                    {
                        ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg.Visible      = true;
                errMsg.ErrorMessage = ex.Message;
                ExceptionManager.Publish(ex);
                ParentPortlet.ShowFeedbackGlobalized(FeedbackType.Error, "Update Failed");
            }
        }