示例#1
0
        private void PaintOrgImage()
        {
            //1. Get the image name from the UserContext.
            string strImageName = UserContext.UserData.OrgLogo;


            // GetOrganisation(SqlString LangCode, SqlInt32 orgID)
            // UserContext.UserData.OrgID
            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            DataTable dtOrganisation = objOrganisation.GetOrganisation(Request.Cookies["currentCulture"].Value, UserContext.UserData.OrgID);

            if (dtOrganisation.Rows.Count > 0)
            {
                strImageName = dtOrganisation.Rows[0]["Logo"].ToString();
                if (strImageName.Length > 4)
                {
                    phdOrgImage.Visible = true;
                    //2. Set the src for the image.
                    this.imgHeader.Src      = "/General/Images/Header/" + strImageName;
                    this.imgHeaderAdmin.Src = "/General/Images/Header/" + strImageName;
                    return;
                }
            }

            this.phdOrgImage.Visible = false;
        }
        /// <summary>
        ///  Get Organisation Default Compliance Rules
        /// </summary>
        /// <param name="organisationID"></param>
        private void GetDefaultRules(int organisationID)
        {
            // Organisation object used to get the organisation details
            BusinessServices.Organisation objOrganisation;
            // Datatable containing the organisation details
            DataTable dtbOrganisation;
            int       intDefaultLessonFrequency, intDefaultQuizFrequency, intDefaultQuizPassMark;
            string    strLangCode = Request.Cookies["currentCulture"].Value;

            objOrganisation = new BusinessServices.Organisation();

            dtbOrganisation = objOrganisation.GetOrganisation(strLangCode, organisationID);

            // Gather details from the organisation details table
            intDefaultLessonFrequency = (int)dtbOrganisation.Rows[0]["DefaultLessonFrequency"];
            intDefaultQuizFrequency   = (int)dtbOrganisation.Rows[0]["DefaultQuizFrequency"];
            intDefaultQuizPassMark    = (int)dtbOrganisation.Rows[0]["DefaultQuizPassMark"];

            this.cboLessonFrequency.SelectedIndex = intDefaultLessonFrequency;
            this.cboQuizFrequency.SelectedIndex   = intDefaultQuizFrequency;
            this.txtQuizPassMark.Text             = intDefaultQuizPassMark.ToString();

            //Show warning message
            this.btnPopulateAll.Attributes.Add("onclick", "javascript:return PopulateAllConfirm();");
        }
示例#3
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     try
     {
         //Response.AddHeader("Refresh", Convert.ToString((Session.Timeout*60)-10));
         pagTitle.Text = ResourceManager.GetString("pagTitle");
         if (!Page.IsPostBack)
         {
             BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
             if (objOrganisation.GetOrganisationCPDEventAccess(UserContext.UserData.OrgID))
             {
                 CPDBindGrid();
             }
             else// dosnt have access to CPD
             {
                 panCPD.Visible = false;
                 this.btnCreateEvent.Visible = false;
                 lblMessage.Text             = ResourceManager.GetString("NoAccess");
                 lblMessage.CssClass         = "WarningMessage";
             }
         }
     }
     catch (Exception Ex)
     {
         ErrorHandler.ErrorLog Error = new ErrorHandler.ErrorLog(Ex, ErrorLevel.Medium, "cpdevent.aspx.cs", "Page_Load", "GetFilename");
         throw (Ex);
     }
 }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            if (objOrganisation.GetOrganisationPolicyAccess(UserContext.UserData.OrgID))
            {
                Response.AddHeader("Refresh", Convert.ToString((Session.Timeout * 60) - 10));

                pagTitle.InnerText = ResourceManager.GetString("pagTitle");

                int OrganisationID = UserContext.UserData.OrgID;
                BusinessServices.Organisation org = new BusinessServices.Organisation();
                DataTable dtPolicies = org.GetOrganisationPolicies(OrganisationID);
                rptPolicy.DataSource = dtPolicies;
                rptPolicy.DataBind();

                panPolicy.Visible = (dtPolicies.Rows.Count > 0);

                if (dtPolicies.Rows.Count == 0)
                {
                    lblMessage.Text     = ResourceManager.GetString("NoPolicies");
                    lblMessage.CssClass = "WarningMessage";
                }
            }
            else
            {
                panPolicy.Visible         = false;
                this.btnAddPolicy.Visible = false;
                lblMessage.Text           = ResourceManager.GetString("NoAccess");
                lblMessage.CssClass       = "WarningMessage";
            }
        }
        }         // GetCourseList

        /// <summary>
        /// Saves the Organisation course access settings.
        /// </summary>
        private void SaveData()
        {
            try
            {
                string strGrantedCourseIDs;
                strGrantedCourseIDs = Request.Form["chkGrantedCourse"];


                if (strGrantedCourseIDs != null)
                {
                    foreach (string courseID in strGrantedCourseIDs.Split(','))
                    {
                        if (courseID != string.Empty)
                        {
                            BusinessServices.Unit.DenyAllForOrgCourse(UserContext.UserData.OrgID, Int32.Parse(courseID));
                        }
                    }
                }

                BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
                objOrganisation.SaveCourseAccess(UserContext.UserData.OrgID, strGrantedCourseIDs);
                UpdateProfilePoints();
                this.GetCourseList();
                this.lblMessage.Text     = ResourceManager.GetString("lblMessage.Success");            //"Course Access has been saved successfully.";
                this.lblMessage.CssClass = "SuccessMessage";
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }         // SaveData
示例#6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                panelReport.Visible       = false;
                panelReportParams.Visible = true;
                pagTitle.InnerText        = ResourceManager.GetString("pagTitle");

                BusinessServices.Organisation objOrg = new BusinessServices.Organisation();
                DataTable dtCoursesExist             = objOrg.GetCourseAccessList(UserContext.UserData.OrgID);
                int       rowCount       = 0;
                DataRow[] drCoursesExist = dtCoursesExist.Select("Granted = 1");
                foreach (DataRow dr in drCoursesExist)
                {
                    rowCount++;
                }
                if (rowCount == 0)
                {
                    lblError.Text     = ResourceManager.GetString("lblError.NoCourse");
                    panCourse.Visible = false;
                }
                else
                {
                    DataTable dtCourses = BusinessServices.CourseLicensing.GetCoursesWithPeriod(UserContext.UserData.OrgID);
                    rptList.DataSource = dtCourses;
                    rptList.DataBind();

                    if (dtCourses.Rows.Count == 0)
                    {
                        lblError.Text     = ResourceManager.GetString("lblError.NoCoursePeriod");                    //"No courses exist with periods in this organisation."; //ResourceManager.GetString("msgNoCoursesExistInThisOrganisation");
                        panCourse.Visible = false;
                    }
                }
            }
        }
示例#7
0
        /// <summary>
        /// Get Organisation Feature Access list
        /// </summary>
        private void BindGrid()
        {
            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            DataTable dtbOrganisations = objOrganisation.GetAllOrganisationFeatureAccess();

            this.rptOrganisationList.DataSource = dtbOrganisations;
            this.rptOrganisationList.DataBind();
        }
        private DataTable GetProfiles()
        {
            int OrganisationID = UserContext.UserData.OrgID;

            BusinessServices.Organisation org = new BusinessServices.Organisation();
            DataTable dtPolicies = org.GetOrganisationProfiles(OrganisationID);

            return(dtPolicies);
        }
        /// <summary>
        /// Get Organisation List
        /// </summary>
        private void BindGrid()
        {
            DataTable dt;

            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            dt = objOrganisation.GetOrganisationList();

            this.grdDataList.DataKeyField = "OrganisationID";
            this.grdDataList.DataSource   = dt;
            this.grdDataList.DataBind();
        }
示例#10
0
 protected void btnMailFlag_Click(object sender, EventArgs e)
 {
     BusinessServices.Organisation objOrg = new BusinessServices.Organisation();
     if (objOrg.orgMailFlagConfig(UserContext.UserData.OrgID, 1, UserContext.UserID))
     {
         btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Start");
     }
     else
     {
         btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Stop");
     }
 }
示例#11
0
        private void loadData()
        {
            string    strLangCode = Request.Cookies["currentCulture"].Value;
            DataTable dt          = objOrganisation.getCoursesConfiguredForMail(UserContext.UserData.OrgID, strLangCode);

            rptReminderEsc.DataSource = dt;
            rptReminderEsc.DataBind();

            BusinessServices.Organisation objOrg = new BusinessServices.Organisation();
            if (objOrg.orgMailFlagConfig(UserContext.UserData.OrgID, 0, UserContext.UserID))
            {
                btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Start");
            }
            else
            {
                btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Stop");
            }
        }
示例#12
0
        protected void butSaveAll_Click(object sender, System.EventArgs e)
        {
            foreach (RepeaterItem item in this.rptOrganisationList.Items)
            {
                // get the CPD checkbox
                CheckBox chkCPDProfile    = item.FindControl("chkCPDProfile") as CheckBox;
                int      accessCPDProfile = chkCPDProfile.Checked == true ? 1 : 0;

                // get the Policy checkbox
                CheckBox chkPolicy    = item.FindControl("chkPolicy") as CheckBox;
                int      accessPolicy = chkPolicy.Checked == true ? 1 : 0;

                //Madhuri CPD Event Start
                CheckBox chkCPDEvent    = item.FindControl("chkCPDEvent") as CheckBox;
                int      accessCPDEvent = chkCPDEvent.Checked == true ? 1 : 0;
                //Madhuri CPD Event End
                // get the eBook checkbox
                CheckBox chkEbook    = item.FindControl("chkEbook") as CheckBox;
                int      accessEbook = chkEbook.Checked == true ? 1 : 0;

                // get the organisaitonid
                HiddenField fldOrganisationID = item.FindControl("organisationID") as HiddenField;
                int         organisationID    = 0;
                bool        result            = Int32.TryParse(fldOrganisationID.Value, out organisationID);
                if (!result)
                {
                    organisationID = 0;
                }

                BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
                objOrganisation.SaveOrganisationFeatureAccess(organisationID, "cpd profile", accessCPDProfile);
                objOrganisation.SaveOrganisationFeatureAccess(organisationID, "policy", accessPolicy);
                objOrganisation.SaveOrganisationFeatureAccess(organisationID, "ebook", accessEbook);
                //Madhuri CPD Event Start
                objOrganisation.SaveOrganisationFeatureAccess(organisationID, "cpd event", accessCPDEvent);
                //Madhuri CPD Event End
            }
            this.BindGrid();

            this.lblUpdMessage.Visible  = true;
            this.lblUpdMessage.Text     = ResourceManager.GetString("lblMessage.SaveAccess");
            this.lblUpdMessage.CssClass = "SuccessMessage";
        }
示例#13
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     //Response.AddHeader("Refresh", Convert.ToString((Session.Timeout*60)-10));
     pagTitle.InnerText = ResourceManager.GetString("pagTitle");
     if (!Page.IsPostBack)
     {
         BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
         if (objOrganisation.GetOrganisationCPDAccess(UserContext.UserData.OrgID))
         {
             CPDBindGrid();
         }
         else                // dosnt have access to CPD
         {
             panCPD.Visible = false;
             this.btnCreateProfile.Visible = false;
             lblMessage.Text     = ResourceManager.GetString("NoAccess");
             lblMessage.CssClass = "WarningMessage";
         }
     }
 }
        }         // LoadData

        /// <summary>
        /// Loads the course list that is assigned to this organisation.
        /// </summary>
        private void GetCourseList()
        {
            // Get the organisation
            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            DataTable dtbCourses = objOrganisation.GetCourseAccessList(UserContext.UserData.OrgID);

            if (dtbCourses.Rows.Count > 0)
            {
                this.dtgCourse.DataKeyField = "CourseID";
                this.dtgCourse.DataSource   = dtbCourses;
                this.dtgCourse.DataBind();
                this.btnSave.Visible = true;
            }
            else
            {
                this.btnSave.Visible     = false;
                this.lblMessage.Text     = ResourceManager.GetString("lblMessage.NoCourse");//"No courses were found";
                this.lblMessage.CssClass = "FeedbackMessage";
            }
        }         // GetCourseList
示例#15
0
        /// <summary>
        /// Paint Organisation Notes
        /// </summary>
        /// <remarks>
        /// Assumptions: None
        /// Notes:
        /// Author: Stephen K-Clark, 9/02/04
        /// Changes:
        /// </remarks>
        /// <param name="organisationID">Organisation ID</param>
        private void PaintOrgNotes(int organisationID)
        {
            // Paint the Org notes
            string strOrganisationNotes;
            string strLangCode = Request.Cookies["currentCulture"].Value;

            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            strOrganisationNotes = Server.HtmlDecode(objOrganisation.GetOrganisationNotes(strLangCode, organisationID));
            if (strOrganisationNotes.Length != 0)
            {
                lblOrgNotesTitle.Visible = false;
                lblOrgNotes.Text         = strOrganisationNotes.Trim();
                lblOrgNotes.Visible      = true;
                lblOrgNotesTitle.Visible = true;
            }
            else
            {
                lblOrgNotesTitle.Visible = false;
                lblOrgNotes.Visible      = false;
            }
        }
        }         // SaveData

        #endregion

        private void UpdateProfilePoints()
        {
            // Initialise parameters to be passed
            string ProfilePointsType;

            ProfilePointsType = "M";
            double Points = 0.0;
            int    Active = 1;

            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            DataTable dtCourses = objOrganisation.GetCourseAccessList(UserContext.UserData.OrgID);

            foreach (DataRow drCourse in dtCourses.Rows)
            {
                int intCourseID = int.Parse(drCourse["CourseID"].ToString());
                BusinessServices.Module objModule = new BusinessServices.Module();
                DataTable dtModules = objModule.GetModuleListByCourse(intCourseID, UserContext.UserData.OrgID);
                foreach (DataRow drModule in dtModules.Rows)
                {
                    int intModuleID = int.Parse(drModule["ModuleID"].ToString());
                    BusinessServices.Profile objProfile = new BusinessServices.Profile();
                    DataTable dtProfiles = objProfile.GetProfilesForCurrentOrg(UserContext.UserData.OrgID);
                    foreach (DataRow drProfile in dtProfiles.Rows)
                    {
                        int intProfileID       = int.Parse(drProfile["ProfileID"].ToString());
                        int intProfilePeriodID = objProfile.GetProfilePeriodID(intProfileID);

                        // Check if record already exists in tblProfilePoints - if not then add record
                        if (!objProfile.CheckProfilePointsExist(intProfilePeriodID, intModuleID) && intProfilePeriodID != -1)
                        {
                            objProfile.AddProfilePoints(ProfilePointsType, intModuleID, intProfilePeriodID, Points, Active, UserContext.UserData.OrgID);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Update command has been issued
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        private void grdDataList_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            int    intOrganisationID;
            string strDomainName;

            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();

            intOrganisationID = (int)this.grdDataList.DataKeys[e.Item.ItemIndex];
            strDomainName     = ((TextBox)e.Item.FindControl("txtDomainName")).Text;

            try
            {
                //Update value
                objOrganisation.UpdateDomainName(intOrganisationID, strDomainName);

                this.grdDataList.EditItemIndex = -1;
                this.BindGrid();
            }
            catch (BusinessServiceException ex)
            {
                this.lblMessage.Text     = ex.Message;
                this.lblMessage.CssClass = "WarningMessage";
            }
        }
示例#18
0
        /// <summary>
        /// Add the new organisation details to the database.
        /// </summary>
        private void AddOrganisation()
        {
            try
            {
                //2. Add the new organisation.
                string strLogoName = this.GetOrganisationLogo();

                BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();

                string strOrganisationNotes;
                strOrganisationNotes = BusinessServices.HTMLSanitizer.Sanitize(this.txtOrganisationNotes.Text);
                strOrganisationNotes = Server.HtmlEncode(strOrganisationNotes);

                DateTime defaultLessonCompletionDate = DateTime.Parse("1/1/1900");
                DateTime defaultQuizCompletionDate   = DateTime.Parse("1/1/1900");

                // if  txtCPDReportName and/or txtDiskSpace visible then parse values otherwise parse Null
                string strCPDReportName;
                if (this.txtCPDReportName.Visible)
                {
                    strCPDReportName = this.txtCPDReportName.Text;
                }
                else
                {
                    strCPDReportName = "";
                }

                long lngDiskSpace;
                if (this.txtDiskSpace.Text.Trim() != "")
                {
                    lngDiskSpace = long.Parse(this.txtDiskSpace.Text);
                    lngDiskSpace = lngDiskSpace * (1024 ^ 2);                   //Convert to  bytes
                }
                else
                {
                    lngDiskSpace = 0;
                }
                if (!ValidateOrganisation(ref defaultLessonCompletionDate, ref defaultQuizCompletionDate))
                {
                    return;
                }


                int intOrganisationID = objOrganisation.AddOrganisation(this.txtOrganisationName.Text, strOrganisationNotes, strLogoName,
                                                                        Int32.Parse(this.cboDefaultLessonFrequency.SelectedValue),
                                                                        Int32.Parse(this.cboDefaultQuizFrequency.SelectedValue),
                                                                        Int32.Parse(this.txtDefaultQuizPassMark.Text),
                                                                        defaultLessonCompletionDate,
                                                                        defaultQuizCompletionDate,
                                                                        this.chkAdvancedReporting.Checked,
                                                                        UserContext.UserID,
                                                                        strCPDReportName,
                                                                        lngDiskSpace,
                                                                        this.ckbIncludeLogo.Checked,
                                                                        this.chkActivatePassword.Checked,
                                                                        this.listTimeZone.SelectedItem.ToString(),
                                                                        chkBxShowLastPassDate.Checked,
                                                                        chkDisablePasswordField.Checked,
                                                                        chkurlrequest.Checked,
                                                                        chkuserCPDEvent.Checked,
                                                                        chkEbookNotification.Checked);

                //3. Save the Organisation Logo
                this.SaveOrganisationLogo(strLogoName);

                //4. Save the ClassificationName
                if (this.txtClassificationName.Text != "")
                {
                    Classification objClassification = new Classification();
                    objClassification.AddClassificationType(this.txtClassificationName.Text, intOrganisationID);
                }

                // re select the organisation
                WebSecurity.SelectOrganisation(intOrganisationID);

                Response.Redirect("OrganisationDetails.aspx?adsx=true");
            }
            catch (UniqueViolationException ex)
            {
                this.lblMessage.Text     = ex.Message;
                this.lblMessage.CssClass = "WarningMessage";
            }
            catch (ParameterException ex)
            {
                throw ex;
            }
            catch (PermissionDeniedException ex)
            {
                this.lblMessage.Text     = ex.Message;
                this.lblMessage.CssClass = "WarningMessage";
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }         // AddOrganisation
        private void setPageState()
        {
            BusinessServices.Organisation objOrg    = new BusinessServices.Organisation();
            BusinessServices.Course       objCourse = new BusinessServices.Course();
            // set datasource
            DataTable dtCourse = objCourse.GetCourseListAccessableToOrg(UserContext.UserData.OrgID, 1);

            // set datatext field
            dtCourse.Select("active = 1");
            chkCourseList.DataSource     = dtCourse;
            chkCourseList.DataTextField  = "Name";
            chkCourseList.DataValueField = "CourseID";
            chkCourseList.DataBind();
            //set datavalue field

            ListItem itm = null;

            itm = chkCourseList.Items.FindByValue(Session["RemEscID"].ToString());

            if (itm != null)
            {
                // updating existing reminders
                itm.Selected          = true;
                chkCourseList.Enabled = false;

                // get the reminder escalation stuff from the db and display
                DataTable            dtr = objOrganisation.getEscalationConfigForCourse(UserContext.UserData.OrgID, Int32.Parse(itm.Value));
                DataColumnCollection dc  = dtr.Columns;
                DataRow drw = dtr.Rows[0];

                //drw.ItemArray[""];

                // initial enrolment stuff
                chkWarnUsers.Checked       = (bool)drw.ItemArray[dc.IndexOf("remindusers")];
                txtNumberofDaysDelinq.Text = drw.ItemArray[dc.IndexOf("daystocompletecourse")].ToString().Equals("0") ? "" : drw.ItemArray[dc.IndexOf("daystocompletecourse")].ToString();


                // pre expiry stuff
                chkWarnQuizExpiry.Checked       = (bool)drw.ItemArray[dc.IndexOf("quizExpiryWarn")];
                txtDaysBeforeWarn.Text          = drw.ItemArray[dc.IndexOf("daysquizexpiry")].ToString().Equals("0") ? "" : drw.ItemArray[dc.IndexOf("daysquizexpiry")].ToString();
                chkPreExpInitEnrolment.Checked  = (bool)drw.ItemArray[dc.IndexOf("PreExpInitEnrolment")];
                chkPreExpiryResitPeriod.Checked = (bool)drw.ItemArray[dc.IndexOf("PreExpResitPeriod")];

                // post expiry
                chkPostExpiryReminder.Checked = (bool)drw.ItemArray[dc.IndexOf("PostExpReminder")];
                txtNumberOfWarns.Text         = drw.ItemArray[dc.IndexOf("NumOfRemNotfy")].ToString().Equals("0") ? "" : drw.ItemArray[dc.IndexOf("NumOfRemNotfy")].ToString();
                txtNumberofDaysWarns.Text     = drw.ItemArray[dc.IndexOf("RepeatRem")].ToString().Equals("0") ? "" : drw.ItemArray[dc.IndexOf("RepeatRem")].ToString();
                chkPostExpiryInit.Checked     = (bool)drw.ItemArray[dc.IndexOf("PostExpInitEnrolment")];
                chkPostExpiryResit.Checked    = (bool)drw.ItemArray[dc.IndexOf("PostExpResitPeriod")];

                //manager check
                chkWarnMgrs.Checked = (bool)drw.ItemArray[dc.IndexOf("NotifyMgr")];;

                if (chkWarnMgrs.Checked)
                {
                    radEscMgrMailOpts.Enabled = true;

                    if ((bool)dtr.Rows[0]["IndividualNotification"]) // if its individual notification select the first radio option
                    {
                        radEscMgrMailOpts.SelectedIndex = 0;
                        chkCumulative.Checked           = false;
                        chkCumulative.Enabled           = false;

                        txtREegularDays.Text    = "";
                        txtREegularDays.Enabled = false;
                    }
                    else // regular list every X days
                    {
                        radEscMgrMailOpts.SelectedIndex = 1;
                        chkCumulative.Checked           = (bool)dtr.Rows[0]["IsCumulative"];
                        txtREegularDays.Text            = dtr.Rows[0]["NotifyMgrDays"].ToString();
                        txtREegularDays.Enabled         = true;
                        chkCumulative.Enabled           = true;
                    }
                }
                else
                {
                    radEscMgrMailOpts.SelectedIndex = -1;
                    radEscMgrMailOpts.Enabled       = false;

                    chkCumulative.Checked = false;
                    chkCumulative.Enabled = false;

                    txtREegularDays.Text    = "";
                    txtREegularDays.Enabled = false;

                    txtDaysBeforeWarn.Enabled = false;
                }

                enableDisable();
            }
            else
            {
                //creating new one
                chkWarnUsers.Checked       = false;
                chkWarnMgrs.Checked        = false;
                chkWarnQuizExpiry.Checked  = false;
                txtNumberofDaysDelinq.Text = "";
                lblValidationMSG.Text      = "";
                enableDisable();
            }
            //if (objOrg.orgMailFlagConfig(UserContext.UserData.OrgID, 0, UserContext.UserID))
            //{
            //    btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Start");
            //}
            //else
            //{
            //    btnMailFlag.Text = ResourceManager.GetString("btnStopEmail_Stop");
            //}
        }
示例#20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
            if (objOrganisation.GetOrganisationPolicyAccess(UserContext.UserData.OrgID))
            {
                //Response.AddHeader("Refresh", Convert.ToString((Session.Timeout*60)-10));

                //To get treeview to work correctly when not rendered until link clicked on
                Page.RegisterHiddenField("StaticPostBackScrollVerticalPosition", "0");
                Page.RegisterHiddenField("StaticPostBackScrollHorizontalPosition", "0");

                string Success = "";
                ResourceManager.RegisterLocaleResource("ConfirmUpload");
                pagTitle.InnerText      = ResourceManager.GetString("pagTitle");
                ddlStatus.Items[0].Text = ResourceManager.GetString("cmnActive");
                ddlStatus.Items[1].Text = ResourceManager.GetString("cmnInactive");
                int PolicyID;
                try
                {
                    PolicyID = Int32.Parse(Session["PolicyID"].ToString());
                }
                catch
                {
                    PolicyID = -1;
                }
                if (PolicyID > 0)
                {
                    panTabs.Visible = true;
                }
                else
                {
                    panTabs.Visible = false;
                }
                if (!Page.IsPostBack)
                {
                    InitialiseSession    = true;
                    Session["PageIndex"] = 0;
                    LoadPolicy(PolicyID);
                    //Show Parent Units tree
                    BusinessServices.Unit objUnit = new  BusinessServices.Unit();
                    DataSet dstUnits = objUnit.GetUnitsTreeByUserID(UserContext.UserData.OrgID, UserContext.UserID, 'A', false);
                    if (dstUnits.Tables[0].Rows.Count != 0)
                    {
                        string strUnits = UnitTreeConvert.ConvertXml(dstUnits);

                        this.trvUnitsSelector.LoadXml(strUnits);
                        this.trvUserUnitsSelector.LoadXml(strUnits);
                    }
                    // Initially hide all assignment panels until user clicks on them

                    this.panAssignUnits.Visible       = false;
                    this.panUnitSelect.Visible        = false;
                    this.panAssign.Visible            = false;
                    this.panUserUnitSelect.Visible    = false;
                    this.panAssignUsers.Visible       = false;
                    this.panUserDetails.Visible       = false;
                    this.panSearchReset.Visible       = false;
                    this.panUserSearchResults.Visible = false;
                    this.panViewUsers.Visible         = false;
                    this.panUserList.Visible          = false;
                    this.panUnitSaveAll.Visible       = false;
                    this.panUserSaveAll.Visible       = false;
                    this.panUserSearchMessage.Visible = false;

                    SetSortOrder("LastName");
                }
                if (Request.QueryString["Success"] != null)
                {
                    Success = Request.QueryString["Success"].ToString();
                    if (Success == "true")
                    {
                        this.lblPolicyName.Text     = ResourceManager.GetString("PolicySaved");
                        this.lblPolicyName.CssClass = "SuccessMessage";
                    }
                }
            }
            else
            {
                pagTitle.InnerText  = ResourceManager.GetString("pagTitle");
                panPolicy.Visible   = false;
                lblMessage.Text     = ResourceManager.GetString("NoAccess");
                lblMessage.CssClass = "WarningMessage";
            }
        }
示例#21
0
        //override protected void OnInit(EventArgs e)
        //{
        //    //
        //    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
        //    //
        //    InitializeComponent();
        //    base.OnInit(e);

        //}
        //private void InitializeComponent()
        //{
        //    this.txtCurrentPoints.TextChanged +=new EventHandler(txtCurrentPoints_TextChanged);
        //}

        //void txtCurrentPoints_TextChanged(object sender, EventArgs e)
        //{
        //    if (int.Parse(txtCurrentPoints.Text) <= int.Parse(lblavailablepoint.Text))
        //    {

        //    }
        //    else
        //    {
        //        txtCurrentPoints.Text = "0";
        //    }

        //}
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                BusinessServices.Organisation objOrganisation = new BusinessServices.Organisation();
                if (objOrganisation.GetOrganisationCPDAccess(UserContext.UserData.OrgID))
                {
                    pagTitle.InnerText = ResourceManager.GetString("pagTitle");

                    int EventID;
                    int EventPeriodID;
                    //int ProfileID;
                    //string EventName;
                    //int EventType;

                    try
                    {
                        EventID = int.Parse(Session["EventID"].ToString());
                    }
                    catch
                    {
                        EventID = -1;
                    }
                    try
                    {
                        EventPeriodID = int.Parse(Session["EventPeriodID"].ToString());
                    }
                    catch
                    {
                        EventPeriodID = -1;
                    }

                    this.InitialisePage(EventID, EventPeriodID);

                    if (!Page.IsPostBack)
                    {
                        Session["PageIndex"] = 0;
                        PopulateDropdown(this.ddlCurrentDateStartDay, this.ddlCurrentDateStartMonth, this.ddlCurrentDateStartYear);
                        PopulateDropdown(this.ddlCurrentDateEndDay, this.ddlCurrentDateEndMonth, this.ddlCurrentDateEndYear);

                        this.ddlCurrentDateStartDay.SelectedValue   = System.DateTime.Today.Day.ToString();
                        this.ddlCurrentDateStartMonth.SelectedValue = System.DateTime.Today.Month.ToString();
                        this.ddlCurrentDateStartYear.SelectedValue  = System.DateTime.Today.Year.ToString();


                        this.ddlCurrentDateEndDay.SelectedValue   = System.DateTime.Today.Day.ToString();
                        this.ddlCurrentDateEndMonth.SelectedValue = System.DateTime.Today.Month.ToString();
                        this.ddlCurrentDateEndYear.SelectedValue  = System.DateTime.Today.Year.ToString();


                        SetSortOrder("LastName");
                        BindCPDProfile();
                        BindEventType();

                        if (Session["Action"].ToString() == "Add")
                        {
                            EventID       = -1;
                            EventPeriodID = -1;
                        }
                        //By default "No Action" radiobutton checked if a new Event
                        if (EventID > 0) //Existing Event
                        {
                            LoadEvent(EventID, EventPeriodID);
                        }

                        var hours   = Enumerable.Range(0, 24).Select(i => i.ToString());
                        var minutes = Enumerable.Range(0, 60).Select(i => i.ToString());
                        ddlCurrentDateStartHour.DataSource = hours;
                        ddlCurrentDateStartHour.DataBind();
                        ddlCurrentDateStartMinute.DataSource = minutes;
                        ddlCurrentDateStartMinute.DataBind();

                        ddlCurrentDateEndHour.DataSource = hours;
                        ddlCurrentDateEndHour.DataBind();
                        ddlCurrentDateEndMinute.DataSource = minutes;
                        ddlCurrentDateEndMinute.DataBind();
                    }
                }
                else// dosnt have access to CPD
                {
                    pagTitle.InnerText     = ResourceManager.GetString("pagTitle");
                    this.lblPageTitle.Text = ResourceManager.GetString("lblPageTitle");
                    panCPD.Visible         = false;
                    lblMessage.Text        = ResourceManager.GetString("NoAccess");
                    lblMessage.CssClass    = "WarningMessage";
                }
            }
            catch (Exception ex)
            {
                //log exception to event log
                ErrorHandler.ErrorLog el = new ErrorHandler.ErrorLog(ex, ErrorLevel.High, "Usercpdevent.aspx.cs", "Page_Load", ex.Message);
            }
        }