예제 #1
0
        protected void AddDutyKSA(object sender, GridCommandEventArgs e)
        {
            JobAnalysisDutyKSAFactor jaDutyKSAFactor = new JobAnalysisDutyKSAFactor();

            AssignJADutyKSAFactorValues(jaDutyKSAFactor, e);
            jaDutyKSAFactor.Add();
        }
예제 #2
0
        protected void UpdateDutyKSA(object sender, GridCommandEventArgs e)
        {
            GridEditFormItem editform   = (GridEditFormItem)e.Item;
            long             jQFactorID = (long)editform.GetDataKeyValue("JQFactorID");

            if (jQFactorID > 0)
            {
                JobAnalysisDutyKSAFactor jaDutyKSAFactor = new JobAnalysisDutyKSAFactor(jQFactorID);
                AssignJADutyKSAFactorValues(jaDutyKSAFactor, e);
                jaDutyKSAFactor.Update();
            }
        }
예제 #3
0
        protected void DeleteDutyKSA(object sender, GridCommandEventArgs e)
        {
            if (sender is RadGrid)
            {
                GridDataItem gridItem = e.Item as GridDataItem;

                int jQFactorID = int.Parse(gridItem.GetDataKeyValue("JQFactorID").ToString());
                JobAnalysisDutyKSAFactor dutyKSAFactor = new JobAnalysisDutyKSAFactor(jQFactorID);
                dutyKSAFactor.UpdatedByID = base.CurrentUserID;
                dutyKSAFactor.Delete();
                rgDutyKSA.Rebind();
            }
        }
예제 #4
0
 private void AssignValues(JobAnalysisDutyKSAFactor jaDutyKSAFactor)
 {
     jaDutyKSAFactor.JADutyID        = JADutyID;
     jaDutyKSAFactor.JQFactorTitle   = this.radEditorJAKSADescription.Text;
     jaDutyKSAFactor.KSAID           = long.Parse(this.radcomboKSA.SelectedValue);
     jaDutyKSAFactor.QualificationID = int.Parse(this.radComboDutyQualID.SelectedValue);
     jaDutyKSAFactor.JQFactorTypeID  = int.Parse(this.radcomboQualificationTypeID.SelectedValue);
     jaDutyKSAFactor.UpdatedByID     = base.CurrentUserID;
     jaDutyKSAFactor.UpdateDate      = DateTime.Now;
     if (CurrentMode == eMode.Insert)
     {
         jaDutyKSAFactor.IsFinalKSA    = false;
         jaDutyKSAFactor.ImportanceID  = enumImportanceScale.None;
         jaDutyKSAFactor.NeedAtEntryID = enumNeedAtEntryScale.None;
         jaDutyKSAFactor.DistinguishingValueScaleID = enumDistinguishingValueScale.None;
         jaDutyKSAFactor.CreatedByID = base.CurrentUserID;
         jaDutyKSAFactor.CreateDate  = DateTime.Now;
     }
 }
예제 #5
0
        protected void dropdownImportance_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                RadComboBox      dropdownImportance = (RadComboBox)sender;
                GridEditableItem editedItem         = (GridEditableItem)dropdownImportance.NamingContainer;

                RadComboBox dropdownNeedAtEntry         = editedItem.FindControl("dropdownNeedAtEntry") as RadComboBox;
                RadComboBox dropdownDistinguishingValue = editedItem.FindControl("dropdownDistinguishingValue") as RadComboBox;

                long jQFactorID = (long)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["JQFactorID"];
                JobAnalysisDutyKSAFactor currentKSAFactor = new JobAnalysisDutyKSAFactor(jQFactorID);


                if (currentKSAFactor != null)
                {
                    if (dropdownImportance.SelectedValue != "")
                    {
                        currentKSAFactor.ImportanceID = (enumImportanceScale)ControlUtility.GetDropdownValue(dropdownImportance);
                    }
                    if (dropdownNeedAtEntry.SelectedValue != "")
                    {
                        currentKSAFactor.NeedAtEntryID = (enumNeedAtEntryScale)ControlUtility.GetDropdownValue(dropdownNeedAtEntry);
                    }
                    if (dropdownDistinguishingValue.SelectedValue != "")
                    {
                        currentKSAFactor.DistinguishingValueScaleID = (enumDistinguishingValueScale)ControlUtility.GetDropdownValue(dropdownDistinguishingValue);
                    }
                    currentKSAFactor.UpdatedByID = base.CurrentUserID;
                    currentKSAFactor.UpdateScaleAndFinalInformation();
                    bindData();
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
예제 #6
0
        private void AssignJADutyKSAFactorValues(JobAnalysisDutyKSAFactor jaDutyKSAFactor, GridCommandEventArgs e)
        {
            GridEditFormItem editform    = (GridEditFormItem)e.Item;
            RadComboBox      radcomboKSA = (RadComboBox)editform.FindControl("radcomboKSA");
            RadEditor        radEditorJAKSADescription   = editform.FindControl("radEditorJAKSADescription") as RadEditor;
            RadComboBox      radComboDutyQualID          = (RadComboBox)editform.FindControl("radComboDutyQualID");
            RadComboBox      radcomboQualificationTypeID = (RadComboBox)editform.FindControl("radcomboQualificationTypeID");

            var jqFactorTypeId = GetJQFactorTypeIdFromQualificationTypeId(int.Parse(radcomboQualificationTypeID.SelectedValue));

            jaDutyKSAFactor.JADutyID            = base.CurrentJADutyID;
            jaDutyKSAFactor.JQID                = base.CurrentJQID;
            jaDutyKSAFactor.JQFactorTitle       = radEditorJAKSADescription.Text;
            jaDutyKSAFactor.QualificationID     = int.Parse(radComboDutyQualID.SelectedValue);
            jaDutyKSAFactor.QualificationTypeID = int.Parse(radcomboQualificationTypeID.SelectedValue);
            jaDutyKSAFactor.JQFactorTypeID      = jqFactorTypeId;
            jaDutyKSAFactor.UpdatedByID         = base.CurrentUserID;
            jaDutyKSAFactor.UpdateDate          = DateTime.Now;

            if (e.CommandName == RadGrid.PerformInsertCommandName)
            {
                jaDutyKSAFactor.KSAID         = long.Parse(radcomboKSA.SelectedValue);
                jaDutyKSAFactor.IsFinalKSA    = (jqFactorTypeId == (int)enumJQFactorType.SelectiveFactor);
                jaDutyKSAFactor.ImportanceID  = enumImportanceScale.None;
                jaDutyKSAFactor.NeedAtEntryID = enumNeedAtEntryScale.None;
                jaDutyKSAFactor.DistinguishingValueScaleID = enumDistinguishingValueScale.None;
                jaDutyKSAFactor.CreatedByID = base.CurrentUserID;
                jaDutyKSAFactor.CreateDate  = DateTime.Now;
            }
            if (e.CommandName == RadGrid.UpdateCommandName)
            {
                if (System.Configuration.ConfigurationManager.AppSettings["ShowQualFactorInstructionButton"].ToString().ToLower() == "false")
                {
                    jaDutyKSAFactor.JQFactorInstruction = radEditorJAKSADescription.Text;
                }
            }
        }
예제 #7
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            JobAnalysisDutyKSAFactor jaDutyKSAFactor;

            try
            {
                if (CurrentMode == eMode.Insert)
                {
                    if (JADutyID > 0)
                    {
                        jaDutyKSAFactor = new JobAnalysisDutyKSAFactor();
                        AssignValues(jaDutyKSAFactor);
                        jaDutyKSAFactor.Add();
                        lblmsg.Text = "Duty-KSA added successfully.";
                        JQFactorID  = jaDutyKSAFactor.JQFactorID;
                        CurrentMode = eMode.Edit;
                    }
                    else
                    {
                        this.lblError.Text = "Current Job Analysis Duty is not set";
                    }
                }
                else if (CurrentMode == eMode.Edit)
                {
                    jaDutyKSAFactor = new JobAnalysisDutyKSAFactor(JQFactorID);
                    this.JADutyID   = jaDutyKSAFactor.JADutyID;
                    AssignValues(jaDutyKSAFactor);
                    jaDutyKSAFactor.Update();
                    lblmsg.Text = "Duty-KSA updated successfully.";
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
예제 #8
0
        protected void checkboxIsFinalKSA1_CheckedChange(object sender, EventArgs e)
        {
            try
            {
                string script      = string.Empty;
                string navigateurl = string.Empty;

                script = string.Format("GetKSACheckedCount();");
                CheckBox         chkbx      = (CheckBox)sender;
                GridEditableItem editedItem = (GridEditableItem)chkbx.NamingContainer;

                RadComboBox dropdownImportance          = editedItem.FindControl("dropdownImportance") as RadComboBox;
                RadComboBox dropdownNeedAtEntry         = editedItem.FindControl("dropdownNeedAtEntry") as RadComboBox;
                RadComboBox dropdownDistinguishingValue = editedItem.FindControl("dropdownDistinguishingValue") as RadComboBox;

                // MD 8/1: Disable this check for now, per Pam
                //// Make sure all of the Scale dropdowns are selected before allowing 'Is Final' to be checked
                //litNoScalesSelected.Visible = false;
                //if (chkbx.Checked && (
                //    dropdownImportance.SelectedIndex < 1 ||
                //    dropdownNeedAtEntry.SelectedIndex < 1 ||
                //    dropdownDistinguishingValue.SelectedIndex < 1))
                //{
                //    litNoScalesSelected.Visible = true;
                //    chkbx.Checked = false;
                //    return;
                //}


                TextBox txtDutyNumber = editedItem.FindControl("txtDutyNumber") as TextBox;

                JobAnalysisDutyKSAFactor currentKSAFactor = new JobAnalysisDutyKSAFactor();

                CheckBox checkboxIsFinalKSA1 = editedItem.FindControl("checkboxIsFinalKSA1") as CheckBox;

                if (GetCheckedKSACount(true) <= 8 && currentKSAFactor != null)
                {
                    currentKSAFactor.JQFactorID    = (long)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["JQFactorID"];
                    currentKSAFactor.JQID          = base.CurrentJQID;
                    currentKSAFactor.JADutyID      = (long)editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["JADutyID"];
                    currentKSAFactor.ImportanceID  = (enumImportanceScale)ControlUtility.GetDropdownValue(dropdownImportance);
                    currentKSAFactor.NeedAtEntryID = (enumNeedAtEntryScale)ControlUtility.GetDropdownValue(dropdownNeedAtEntry);
                    currentKSAFactor.DistinguishingValueScaleID = (enumDistinguishingValueScale)ControlUtility.GetDropdownValue(dropdownDistinguishingValue);
                    currentKSAFactor.IsFinalKSA  = checkboxIsFinalKSA1.Checked;
                    currentKSAFactor.UpdatedByID = base.CurrentUserID;
                    currentKSAFactor.UpdateScaleAndFinalInformation();

                    txtDutyNumber.Text = txtDutyNumber.Text;

                    //Add to the tooltip manager
                    this.RadToolTipManager1.TargetControls.Add(txtDutyNumber.ClientID, txtDutyNumber.Text.Substring(txtDutyNumber.Text.Length - 1) + "|" + currentKSAFactor.JADutyID.ToString(), true);

                    bindData();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
                    chkbx.Checked = false;
                }
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
예제 #9
0
        private void gridDutyKSA_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                HideRefreshButton(e);
                JobAnalysisDutyKSAFactor currentKSAFactor = e.Item.DataItem as JobAnalysisDutyKSAFactor;

                if (e.Item is GridDataItem)
                {
                    Literal literalKSADescription        = e.Item.FindControl("literalKSADescription") as Literal;
                    Literal literalQualificationTypeName = e.Item.FindControl("literalQualificationTypeName") as Literal;
                    Literal literalTotalScore            = e.Item.FindControl("literalTotalScore") as Literal;
                    //Label lblDutyNumber = e.Item.FindControl("lblDutyNumber") as Label;
                    //Label tooltipDutyNumber = e.Item.FindControl("ToolTipDutyNumber") as Label;
                    TextBox txtDutyNumber = e.Item.FindControl("txtDutyNumber") as TextBox;

                    CheckBox    checkboxIsFinalKSA1         = e.Item.FindControl("checkboxIsFinalKSA1") as CheckBox;
                    RadComboBox dropdownImportance          = e.Item.FindControl("dropdownImportance") as RadComboBox;
                    RadComboBox dropdownNeedAtEntry         = e.Item.FindControl("dropdownNeedAtEntry") as RadComboBox;
                    RadComboBox dropdownDistinguishingValue = e.Item.FindControl("dropdownDistinguishingValue") as RadComboBox;

                    // bind importance scale
                    ControlUtility.BindRadComboBoxControl(dropdownImportance, LookupWrapper.GetImportanceScale(false), null, "ImportanceName", "ImportanceID", "[-- Select --]");

                    // bind need at entry
                    ControlUtility.BindRadComboBoxControl(dropdownNeedAtEntry, LookupWrapper.GetNeedAtEntryScale(false), null, "NeedAtEntryName", "NeedAtEntryID", "[-- Select --]");

                    // bind distinguishing value scale
                    ControlUtility.BindRadComboBoxControl(dropdownDistinguishingValue, LookupWrapper.GetDistinguishingValueScale(false), null, "ScaleName", "ScaleID", "[-- Select --]");

                    // now set values
                    ControlUtility.SafeListControlSelect(dropdownImportance, (int)currentKSAFactor.ImportanceID);
                    ControlUtility.SafeListControlSelect(dropdownNeedAtEntry, (int)currentKSAFactor.NeedAtEntryID);
                    ControlUtility.SafeListControlSelect(dropdownDistinguishingValue, (int)currentKSAFactor.DistinguishingValueScaleID);


                    literalKSADescription.Text        = currentKSAFactor.JQFactorTitle;
                    literalQualificationTypeName.Text = currentKSAFactor.QualificationTypeName;
                    literalTotalScore.Text            = currentKSAFactor.TotalScore.ToString();

                    // Lookup the correct Duty sequence number stored in list of DutyCounters created in ctrlDutyKSA.ascx bindData()
                    currentDutyNumber  = DutyCounters.Find(c => c.JADutyID == currentKSAFactor.JADutyID).Number;
                    txtDutyNumber.Text = "Duty " + (currentDutyNumber == null ? "" : currentDutyNumber.ToString());

                    //Add the image id to the tooltip manager
                    this.RadToolTipManager1.TargetControls.Add(txtDutyNumber.ClientID, currentDutyNumber.ToString() + "|" + currentKSAFactor.JADutyID.ToString(), true);


                    if (checkboxIsFinalKSA1 != null)
                    {
                        checkboxIsFinalKSA1.Checked = currentKSAFactor.IsFinalKSA;
                    }

                    if (currentKSAFactor.QualificationTypeID == (int)enumQualificationType.SelectiveFactor)
                    {
                        checkboxIsFinalKSA1.Checked = true;
                        checkboxIsFinalKSA1.Enabled = false;
                    }
                }
                else if (e.Item is GridEditableItem && e.Item.IsInEditMode)
                {
                    RadComboBox dropdownImportance          = e.Item.FindControl("dropdownImportance") as RadComboBox;
                    RadComboBox dropdownNeedAtEntry         = e.Item.FindControl("dropdownNeedAtEntry") as RadComboBox;
                    RadComboBox dropdownDistinguishingValue = e.Item.FindControl("dropdownDistinguishingValue") as RadComboBox;
                    CheckBox    checkboxIsFinalKSA1         = e.Item.FindControl("checkboxIsFinalKSA1") as CheckBox;

                    // bind importance scale
                    ControlUtility.BindRadComboBoxControl(dropdownImportance, LookupWrapper.GetImportanceScale(false), null, "ImportanceName", "ImportanceID", "[-- Select --]");

                    // bind need at entry
                    ControlUtility.BindRadComboBoxControl(dropdownNeedAtEntry, LookupWrapper.GetNeedAtEntryScale(false), null, "NeedAtEntryName", "NeedAtEntryID", "[-- Select --]");

                    // bind distinguishing value scale
                    ControlUtility.BindRadComboBoxControl(dropdownDistinguishingValue, LookupWrapper.GetDistinguishingValueScale(false), null, "ScaleName", "ScaleID", "[-- Select --]");

                    // now set values
                    ControlUtility.SafeListControlSelect(dropdownImportance, (int)currentKSAFactor.ImportanceID);
                    ControlUtility.SafeListControlSelect(dropdownNeedAtEntry, (int)currentKSAFactor.NeedAtEntryID);
                    ControlUtility.SafeListControlSelect(dropdownDistinguishingValue, (int)currentKSAFactor.DistinguishingValueScaleID);

                    if (checkboxIsFinalKSA1 != null)
                    {
                        checkboxIsFinalKSA1.Checked = currentKSAFactor.IsFinalKSA;
                    }

                    if (currentKSAFactor.QualificationTypeID == (int)enumQualificationType.SelectiveFactor)
                    {
                        checkboxIsFinalKSA1.Checked = true;
                        checkboxIsFinalKSA1.Enabled = false;
                    }
                }
                SetPageView();
            }
            catch (Exception ex)
            {
                base.HandleException(ex);
            }
        }
예제 #10
0
 private static int sortJADutyKSAByJADutyID(JobAnalysisDutyKSAFactor jaDutyKSAFactor1, JobAnalysisDutyKSAFactor jaDutyKSAFactor2)
 {
     return(jaDutyKSAFactor1.JADutyID.CompareTo(jaDutyKSAFactor2.JADutyID));
 }
예제 #11
0
 private static int sortJADutyKSAByPercOfTime(JobAnalysisDutyKSAFactor jaDutyKSAFactor1, JobAnalysisDutyKSAFactor jaDutyKSAFactor2)
 {
     return(jaDutyKSAFactor1.PercentageOfTime.CompareTo(jaDutyKSAFactor2.PercentageOfTime));
 }
예제 #12
0
        private void SetEditForm(object sender, GridItemEventArgs e)
        {
            GridItem         griditem = e.Item as GridItem;
            GridEditFormItem editform = (GridEditFormItem)e.Item;

            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {
                RadComboBox radcomboKSA = (RadComboBox)editform.FindControl("radcomboKSA");
                RadEditor   radEditorJAKSADescription = editform.FindControl("radEditorJAKSADescription") as RadEditor;
                //HtmlTableRow trsearch = editform.FindControl("trKSASearch") as HtmlTableRow;
                HtmlTableCell tdsearch = editform.FindControl("tdKSASearch") as HtmlTableCell;

                HtmlTableRow  trksadd                     = editform.FindControl("trKSADD") as HtmlTableRow;
                HtmlTableRow  trKSADutyOption             = editform.FindControl("trKSADutyOption") as HtmlTableRow;
                ctrlSearchKSA searchKSA                   = editform.FindControl("SearchKSA") as ctrlSearchKSA;
                Button        btnUpdate                   = editform.FindControl("btnUpdate") as Button;
                RadComboBox   radComboDutyQualID          = (RadComboBox)editform.FindControl("radComboDutyQualID");
                RadComboBox   radcomboQualificationTypeID = (RadComboBox)editform.FindControl("radcomboQualificationTypeID");
                ControlUtility.BindRadComboBoxControl(radComboDutyQualID, BindQualifications(), null, "QualificationName", "QualificationID");
                ControlUtility.BindRadComboBoxControl(radcomboQualificationTypeID, BindQualificationTypes(), null, "QualificationTypeName", "QualificationTypeID");

                //Issue 1015 - Make "KSA" default instead of "KSA-Quality Ranking Factor"
                if (radcomboQualificationTypeID != null)
                {
                    radcomboQualificationTypeID.SelectedValue = "3";
                }

                if (griditem.DataItem is JobAnalysisDutyKSAFactor)
                {
                    JobAnalysisDutyKSAFactor jaDutyKSAFactor = griditem.DataItem as JobAnalysisDutyKSAFactor;

                    radEditorJAKSADescription.Content         = jaDutyKSAFactor.JQFactorTitle.Replace("\n", "<br />");
                    radComboDutyQualID.SelectedValue          = jaDutyKSAFactor.QualificationID.ToString();
                    radcomboQualificationTypeID.SelectedValue = jaDutyKSAFactor.QualificationTypeID.ToString();
                }

                if (e.Item is GridEditFormInsertItem)
                {
                    tdsearch.Visible = true;
                    //trsearch.Visible = true;
                    trksadd.Visible    = true;
                    searchKSA.SeriesID = base.CurrentJNP.SeriesID;
                    //searchKSA.ShowGradeSelection = false;
                    searchKSA.CurrentGrade = CurrentJNP.HighestAdvertisedGrade;
                    //searchKSA.BindData();
                    BindKSACombo(radcomboKSA);
                    btnUpdate.CommandName = RadGrid.PerformInsertCommandName;
                    btnUpdate.Text        = "Add KSA";
                    rgDutyKSA.ShowFooter  = false;
                    radcomboQualificationTypeID.Enabled = true;
                    trKSADutyOption.Visible             = true;

                    HtmlTableRow rw = (HtmlTableRow)editform.FindControl("row1");

                    if (rw != null)
                    {
                        rw.Visible = true;
                    }

                    //Hiring Managers should not be able to add SF to duties in Revise Status, but should be able to add KSAs and KSA -QRF.
                    //System Admins and HR with Supervisory Access will still be able to add SF in Revise status.

                    if (CurrentJNPWS == enumJNPWorkflowStatus.Revise)
                    {
                        if (base.IsAdmin || base.HasHRGroupPermission)
                        {
                            //Don't remove SF in Revise status.
                        }
                        else
                        {
                            RadComboBoxItem itemSF = radcomboQualificationTypeID.FindItemByValue(Convert.ToInt32(enumQualificationType.SelectiveFactor).ToString());

                            if (itemSF != null)
                            {
                                radcomboQualificationTypeID.Items.Remove(itemSF);
                            }
                        }
                    }
                }
                else //edit duty ksa
                {
                    tdsearch.Visible = false;
                    //trsearch.Visible = false;
                    trksadd.Visible         = false;
                    trKSADutyOption.Visible = false;
                    // JA issue 920:Qualification type should not be allowed to be changed in edit mode.
                    radcomboQualificationTypeID.Enabled = false;
                    btnUpdate.CommandName = RadGrid.UpdateCommandName;
                    btnUpdate.Text        = "Save KSA";

                    if (IsInView)
                    {
                        radComboDutyQualID.Enabled          = false;
                        radcomboQualificationTypeID.Enabled = false;
                        btnUpdate.Enabled = false;
                    }
                    rgDutyKSA.ShowFooter = true;
                }

                if (CurrentJNPWS != enumJNPWorkflowStatus.Published)
                {
                    if (base.IsAdmin)
                    {
                        //Qualification type should not be allowed to be changed in edit mode.
                        //radcomboQualificationTypeID.Enabled = true;

                        if (!IsInView) // For Issue 991 - To make uneditable in view mode
                        {
                            btnUpdate.Enabled = true;
                        }
                    }
                }
            }
        }