Esempio n. 1
0
        private void SaveOrder(bool printMessage)
        {
            // save new order
            JQManager jqm = new JQManager();


            // For Issue 991 - To avoid updating while in view mode
            if (CurrentNavMode != enumNavigationMode.View)
            {
                jqm.UpdateOrder(base.CurrentJQID, this.Factors, this.CurrentUserID);
            }


            // clear all collections
            this.Factors.Clear();

            // re-bind grid
            this.Factors = jqm.GetJQFactorCollectionByJQID(base.CurrentJQID);
            bindData(this.Factors);

            // disable save/order button
            //this.toggleButtons(false);

            // show system message
            if (printMessage)
            {
                base.PrintSystemMessage(GetLocalResourceObject("OrderUpdatedMessage").ToString(), true);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string docName = string.Empty;
            long   JNPID   = -1;

            if (Request.QueryString["JNPID"] != null)
            {
                JNPID = Convert.ToInt64(Request.QueryString["JNPID"]);

                if (Request.QueryString["ReportFormat"] == enumDocumentFormat.PDF.ToString())
                {
                    JNPReports.JobQuestionaire currentJobQuestionairePDFDoc = new JNPReports.JobQuestionaire();
                    docName = string.Format("JobQuestionaire{0}.pdf", JNPID);
                    currentJobQuestionairePDFDoc.ReportParameters["jNPID"].Value = JNPID;
                    currentJobQuestionairePDFDoc.ReportParameters["documentObjectTypeId"].Value = Convert.ToInt32(enumDocumentType.JQ);
                    ControlUtility.ExportToPDF(docName, currentJobQuestionairePDFDoc);
                }
                else
                {
                    JQManager jqManager = new JQManager();
                    docName = string.Format("JobQuestionaire{0}.txt", JNPID);
                    string jobQuestionnaireUTF8Doc = jqManager.CreateUTF8JobQuestionnaireReport(JNPID);
                    ControlUtility.ExportToUTF8(docName, jobQuestionnaireUTF8Doc);
                }
            }
        }
Esempio n. 3
0
        private void detail_ItemDataBinding(object sender, EventArgs e)
        {
            // Get the detail section object from sender
            Telerik.Reporting.Processing.DetailSection section = (Telerik.Reporting.Processing.DetailSection)sender;
            // From the section object get the current DataRow
            Telerik.Reporting.Processing.IDataObject dataObject = (Telerik.Reporting.Processing.IDataObject)section.DataObject;
            long      jqid       = Convert.ToInt64(dataObject["JQID"]);
            JQManager jqMgr      = new JQManager();
            string    reportText = jqMgr.CreateUTF8JobQuestionnaireReportByJQID(jqid);

            txtUTF.Value = reportText;
        }
Esempio n. 4
0
        void gridJQFactorItems_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            try
            {
                GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
                JQManager    jqm      = new JQManager();

                switch (e.DetailTableView.Name)
                {
                case "RatingScale":
                {
                    long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID");

                    // pull rating scale from cached version
                    JQRatingScaleCollection cachedScaleList = LookupWrapper.GetJQRatingScale(false);
                    JQRatingScale           ratingScale     = cachedScaleList.Find(ratingScaleID);
                    JQRatingScaleCollection newScaleList    = new JQRatingScaleCollection();

                    if (ratingScale != null)
                    {
                        // account for blank/null instructions
                        ratingScale.RatingScaleInstruction = string.IsNullOrWhiteSpace(ratingScale.RatingScaleInstruction) ? GetLocalResourceObject("MissingInstructionsText").ToString() : ratingScale.RatingScaleInstruction;
                        newScaleList.Add(ratingScale);
                    }

                    e.DetailTableView.DataSource = newScaleList;
                    break;
                }

                case "RatingScaleResponses":
                {
                    long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID");
                    RatingScaleResponseCollection responseItemList = this.RatingScaleResponses.FindByScale(ratingScaleID);

                    if (responseItemList.Count == 0)
                    {
                        RatingScaleResponseCollection listResponses = jqm.GetJQRatingScaleResponseCollectionByFactorItemID(ratingScaleID);
                        this.RatingScaleResponses.AddRange(listResponses);
                        responseItemList = listResponses;
                    }

                    e.DetailTableView.DataSource = responseItemList;
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
Esempio n. 5
0
        public void BuildPage(long factorID, string factorTitle)
        {
            try
            {
                JQManager jqm = new JQManager();

                this.literalFactorTitle.Text = factorTitle;
                cleanForm();                                                                                // clean form collections and set form controls

                JQFactorItemCollection listFactorItems = jqm.GetJQFactorItemCollectionByFactorID(factorID); // load factor items
                this.FactorItems = listFactorItems;

                bindData(listFactorItems);

                SetControls();
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
Esempio n. 6
0
        public void BuildPage()
        {
            try
            {
                if (base.CurrentJQID == -1)
                {
                    base.PrintErrorMessage(GetGlobalResourceObject("JNPMessages", "JQNotAvailable").ToString(), false);
                }
                else
                {
                    JQManager        jm    = new JQManager();
                    JobQuestionnaire jqDoc = jm.GetJobQuestionnaire(base.CurrentJQID);

                    if (jqDoc == null || jqDoc.JQID == -1)
                    {
                        // Non-existent JQ
                        base.PrintSystemMessage(GetLocalResourceObject("JQIDNotFoundMessage").ToString(), false);
                    }
                    else
                    {
                        // load Factors
                        JQFactorCollection listFactors = jm.GetJQFactorCollectionByJQID(base.CurrentJQID);

                        this.Factors = listFactors;
                        //Added this because factor numbers are not aligned properly.
                        SaveOrder(false);
                        //this method will be called from SaveOrder()
                        //bindData(listFactors);
                        SetControls();
                    }
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
        protected void btnAddToLibraryOk_Click(object sender, EventArgs e)
        {
            long returnCode = -1;

            rwAddToLibrary.VisibleOnPageLoad = false;
            JQManager          jqMgr        = new JQManager();
            JQFactorEntity     jqFactor     = jqMgr.GetJQFactorByJQFactorID(this.JQFactorID);
            JQFactorItemEntity jqFactorItem = jqMgr.GetJQFactorItemByID(this.JQFactorItemID);

            if (jqFactor.KSAID == 0)
            {
                returnCode = JQManager.AddKSATaskStatementToLibrary(jqFactor.Title, jqFactorItem.ItemText, jqFactor, jqFactorItem, CurrentJNP.SeriesID, CurrentJNP.HighestAdvertisedGrade, this.CurrentUserID);
                if (returnCode > 0)
                {
                    lblmsg.Text = "Added KSA and Task Statment To Library Sucessfully.";
                }
                else
                {
                    lblmsg.Text = "Sorry, Could Not Add KSA and Task Statment to Library!";
                }
            }
            else
            {
                returnCode = JQManager.AddTaskStatementToLibrary(jqFactorItem.ItemText, jqFactorItem, CurrentJNP.SeriesID, CurrentJNP.HighestAdvertisedGrade, jqFactor.KSAID, this.CurrentUserID);
                if (returnCode > 0)
                {
                    lblmsg.Text = "Added Task Statment To Library Sucessfully.";
                }
                else
                {
                    lblmsg.Text = "Sorry, Could Not Add Task Statment to Library!";
                }
            }

            InitTaskStatements();
            btnAddToLibrary.Visible = false;
        }
Esempio n. 8
0
        private void buttonSaveOrder_Click(object sender, EventArgs e)
        {
            try
            {
                // save new order
                JQManager jqm = new JQManager();

                // jqm.UpdateOrder(base.CurrentJQID, this.FactorItems, this.RatingScaleResponses, this.CurrentUserID);
                // JA issue id 904/702 Issue 702 is re-occuring. Dashes and periods missing after responses missing in JAX which in turn are missing in UTF-8 (See screenshots)
                //not updating responses -- because it was overwritting the default responses as well
                jqm.UpdateOrder(base.CurrentJQID, this.FactorItems, null, this.CurrentUserID);

                //JA issue id:921:      Clicking Save Order when re-ordering task statements under KSAs on Final screen returns you to Factor list
                bindData(this.FactorItems);
                // show system message
                base.PrintSystemMessage(GetGlobalResourceObject("JNPMessages", "OrderUpdatedMessage").ToString(), true);
                //commenting returning to parent to support the requirement specified in jA issue id 921
                //returnToParent();
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
Esempio n. 9
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            string docFormat = "";

            if (Request.QueryString["documentformat"] != null)
            {
                docFormat = Request.QueryString["documentformat"].ToString();
            }

            if (docFormat == "DOC")
            {
                docFormat = "DOCX";
            }

            if (this.StaffingObjectID > 0 && this.DocumentTypeID > 0)
            {
                string docName = string.Empty;

                switch (DocumentTypeID)
                {
                case enumDocumentType.JNP:
                    JNPReports.JobAnalysis currentJNPWorkflowComments = new JNPReports.JobAnalysis();
                    docName = string.Format("JobAnalysis{0}." + docFormat, StaffingObjectID);
                    currentJNPWorkflowComments.ReportParameters["jNPID"].Value = StaffingObjectID;
                    currentJNPWorkflowComments.ReportParameters["documentObjectTypeId"].Value = Request.QueryString["typeid"];
                    currentJNPWorkflowComments.ReportParameters["jAID"].Value = Request.QueryString["jaid"];

                    if (docFormat == enumDocumentFormat.DOCX.ToString())
                    {
                        ControlUtility.ExportToDoc(docName, currentJNPWorkflowComments);
                    }
                    if (docFormat == enumDocumentFormat.PDF.ToString())
                    {
                        ControlUtility.ExportToPDF(docName, currentJNPWorkflowComments);
                    }

                    break;

                case enumDocumentType.JA:
                    JNPReports.JobAnalysis currentJobAnalysisDoc = new JNPReports.JobAnalysis();
                    docName = string.Format("JobAnalysis{0}." + docFormat, StaffingObjectID);
                    currentJobAnalysisDoc.ReportParameters["jNPID"].Value = StaffingObjectID;
                    currentJobAnalysisDoc.ReportParameters["documentObjectTypeId"].Value = Request.QueryString["typeid"];
                    currentJobAnalysisDoc.ReportParameters["jAID"].Value = Request.QueryString["jaid"];


                    if (docFormat == enumDocumentFormat.DOCX.ToString())
                    {
                        ControlUtility.ExportToDoc(docName, currentJobAnalysisDoc);
                    }
                    if (docFormat == enumDocumentFormat.PDF.ToString())
                    {
                        ControlUtility.ExportToPDF(docName, currentJobAnalysisDoc);
                    }

                    break;

                case enumDocumentType.CR:
                    JNPReports.CategoryRating currentCategoryRatingdoc = new JNPReports.CategoryRating();
                    docName = string.Format("CategoryRating{0}." + docFormat, StaffingObjectID);
                    currentCategoryRatingdoc.ReportParameters["jNPID"].Value = StaffingObjectID;
                    currentCategoryRatingdoc.ReportParameters["documentObjectTypeId"].Value = Request.QueryString["typeid"];
                    currentCategoryRatingdoc.ReportParameters["jAID"].Value = Request.QueryString["jaid"];
                    currentCategoryRatingdoc.ReportParameters["cRID"].Value = Request.QueryString["crid"];

                    if (docFormat == enumDocumentFormat.DOCX.ToString())
                    {
                        ControlUtility.ExportToDoc(docName, currentCategoryRatingdoc);
                    }
                    if (docFormat == enumDocumentFormat.PDF.ToString())
                    {
                        ControlUtility.ExportToPDF(docName, currentCategoryRatingdoc);
                    }

                    break;

                case enumDocumentType.JQ:
                    if ((DocumentFormat == enumDocumentFormat.PDF) || (DocumentFormat == enumDocumentFormat.DOCX))
                    {
                        JNPReports.JobQuestionaire currentJobQuestionairePDFDoc = new JNPReports.JobQuestionaire();
                        docName = string.Format("JobQuestionaire{0}." + docFormat, StaffingObjectID);
                        currentJobQuestionairePDFDoc.ReportParameters["jNPID"].Value = StaffingObjectID;
                        currentJobQuestionairePDFDoc.ReportParameters["documentObjectTypeId"].Value = Request.QueryString["typeid"];

                        if (docFormat == enumDocumentFormat.DOCX.ToString())
                        {
                            ControlUtility.ExportToDoc(docName, currentJobQuestionairePDFDoc);
                        }
                        if (docFormat == enumDocumentFormat.PDF.ToString())
                        {
                            ControlUtility.ExportToPDF(docName, currentJobQuestionairePDFDoc);
                        }
                    }
                    else if (DocumentFormat == enumDocumentFormat.UTF8)
                    {
                        JQManager jqManager = new JQManager();
                        docName = string.Format("JobQuestionaire{0}.txt", StaffingObjectID);
                        string jobQuestionnaireUTF8Doc = jqManager.CreateUTF8JobQuestionnaireReport(StaffingObjectID);
                        ControlUtility.ExportToUTF8(docName, jobQuestionnaireUTF8Doc);
                    }
                    break;

                case enumDocumentType.Comments:
                    JNPReports.JNPComments jnpWorkflowComments = new JNPReports.JNPComments();
                    docName = string.Format("JAXComments{0}." + docFormat, StaffingObjectID);
                    jnpWorkflowComments.ReportParameters["jNPID"].Value = StaffingObjectID;
                    jnpWorkflowComments.ReportParameters["documentObjectTypeId"].Value = Request.QueryString["typeid"];

                    if (docFormat == enumDocumentFormat.DOCX.ToString())
                    {
                        ControlUtility.ExportToDoc(docName, jnpWorkflowComments);
                    }
                    if (docFormat == enumDocumentFormat.PDF.ToString())
                    {
                        ControlUtility.ExportToPDF(docName, jnpWorkflowComments);
                    }

                    break;

                case enumDocumentType.All:
                    bool CRActive = false;
                    long crid     = Convert.ToInt64(Request.QueryString["crid"]);
                    if (CurrentPackage != null)
                    {
                        CRActive = CurrentPackage.HasActiveCR();

                        //updating order if printing in edit mode by clicking Print All button from within the package
                        if (CurrentNavMode != enumNavigationMode.View)
                        {
                            JQManager jm = new JQManager();
                            // load Factors
                            JQFactorCollection listFactors = jm.GetJQFactorCollectionByJQID(CurrentPackage.JQID);
                            jm.UpdateOrder(CurrentPackage.JQID, listFactors, CurrentUser.UserID);
                        }
                    }
                    else
                    {
                        if (crid > 0)
                        {
                            HCMS.Business.CR.CategoryRating categoryRating = HCMS.Business.CR.CategoryRatingManager.GetByID(crid);
                            CRActive = (bool)categoryRating.IsActive;
                        }
                        else
                        {
                            CRActive = false;
                        }
                    }
                    JNPReports.JNPReport JNPReportAllDoc = new JNPReports.JNPReport();
                    docName = string.Format("JNPReportAll{0}." + docFormat, StaffingObjectID);

                    if (!CRActive)
                    {
                        JNPReportAllDoc.subReportCR.Visible         = false;
                        JNPReportAllDoc.groupHeaderSection3.Visible = false;
                    }

                    JNPReportAllDoc.ReportParameters["jNPID"].Value = StaffingObjectID;
                    JNPReportAllDoc.ReportParameters["documentObjectTypeId"].Value = enumDocumentType.All;
                    JNPReportAllDoc.ReportParameters["jAID"].Value = Request.QueryString["jaid"];
                    JNPReportAllDoc.ReportParameters["cRID"].Value = crid;

                    if (docFormat == enumDocumentFormat.DOCX.ToString())
                    {
                        ControlUtility.ExportToDoc(docName, JNPReportAllDoc);
                    }
                    if (docFormat == enumDocumentFormat.PDF.ToString())
                    {
                        ControlUtility.ExportToPDF(docName, JNPReportAllDoc);
                    }

                    break;

                default:
                    break;
                }
            }

            base.Page_Load(sender, e);
        }