Exemple #1
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);
            }
        }
Exemple #2
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);
            }
        }