protected bool CheckIfEachMajorDutyHasOneDutyKSA() { List <JobAnalysisDuty> jaDuties = CurrentJobAnalysis.GetJobAnalysisDuty(); List <JobAnalysisDutyKSAFactor> jaDutyKSAFactorList = new List <JobAnalysisDutyKSAFactor>(); foreach (JobAnalysisDuty jaDuty in jaDuties) { jaDutyKSAFactorList = jaDuty.GetJobAnalysisDutyKSAFactorByJADutyID(); if (jaDutyKSAFactorList.Count <= 0) { return(false); } } return(true); }
//Issue Id: 169 //Author: Deepali Anuje //Date Fixed: 2/21/2012 //Description: Cond of Emp+Sel Factors from PDs Overall Quals are NOT appearing in COE table on Final KSA screen of JA protected void gridDutyKSAEmploymentConditions_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { if (base.CurrentFullPDID > 0) { this.JAKSAFactorList = CurrentJobAnalysis.GetJAKSAFactor(); //gridDutyKSAEmploymentConditions.DataSource = JAKSAFactorList.Where(p => (p.QualificationTypeID == (int)enumQualificationType.ConditionOfEmployment)) // .OrderBy(p => (p.QualificationTypeName)).ToList(); List <JQFactor> ls = JAKSAFactorList.Where(p => (p.QualificationTypeID == (int)enumQualificationType.ConditionOfEmployment)) .OrderBy(p => (p.QualificationTypeName)).ToList(); gridDutyKSAEmploymentConditions.DataSource = ls; lblConditionOfEmpHeader.Visible = (ls.Count > 0); gridDutyKSAEmploymentConditions.Visible = (ls.Count > 0); } }
private void bindData() { try { // Create a "lookup" list of DutyCounters to show correct Duty number in grid. This fix // even allows for Duties that have no DutyKSAs and shows number skips as needed List <JobAnalysisDuty> currentJADuties = base.CurrentJobAnalysis.GetJobAnalysisDuty(); currentJADuties = currentJADuties .OrderByDescending(ob => ob.JAPercentageOfTime) .ThenBy(ob2 => ob2.JADutyID).ToList(); DutyCounters = null; int dutyNum = 1; foreach (var d in currentJADuties) { DutyCounters.Add(new DutyCounter() { Number = dutyNum, JADutyID = d.JADutyID }); dutyNum++; } this.JADutyKSAFactorList = CurrentJobAnalysis.GetJobAnalysisDutyKSAFactor(); List <JobAnalysisDutyKSAFactor> lstJobAnalysisDutyKSACollection = new List <JobAnalysisDutyKSAFactor>(); lstJobAnalysisDutyKSACollection = JADutyKSAFactorList .Where(p => (p.QualificationTypeID != (int)enumQualificationType.ConditionOfEmployment)) .ToList(); // Issue: 729/768 // Mark Deibert, 9/16/2013 // Using exact same sorting as in ctrlDutyKSA this.gridDutyKSA.DataSource = lstJobAnalysisDutyKSACollection .OrderByDescending(ob => ob.PercentageOfTime) .ThenBy(ob2 => ob2.JADutyID); this.gridDutyKSA.DataBind(); SetPageView(); } catch (Exception ex) { base.HandleException(ex); } }
protected void customValTotalPercTime_ServerValidate(object source, ServerValidateEventArgs args) { List <JobAnalysisDuty> currentJADuties = CurrentJobAnalysis.GetJobAnalysisDuty(); int totalDutyPct = 0; foreach (JobAnalysisDuty duty in currentJADuties) { totalDutyPct += duty.JAPercentageOfTime; } if (totalDutyPct != 100) { string valmsg = GetLocalResourceObject("DutyPercentageTotal").ToString(); args.IsValid = false; customValTotalPercTime.ErrorMessage = valmsg; } else { args.IsValid = true; customValTotalPercTime.ErrorMessage = string.Empty; } }
protected void SetPageView() { //Issue 1001 - Added a link in Duty KSA page to display the First Factor langauge in a popup screen. string urlhlFactor1 = string.Format("../JA/Factor1PopUp.aspx"); hlFactor1.NavigateUrl = urlhlFactor1; hlFactor1.Attributes.Add("onclick", "javascript:ShowFirstFactorLanguagePopup(); return false;"); enumJNPWorkflowStatus currentws = base.CurrentJNPWS; GridColumn Editcolumn = rgJADuty.MasterTableView.OwnerGrid.Columns.FindByUniqueName("EditCommandColumn"); GridColumn Deletecolumn = rgJADuty.MasterTableView.OwnerGrid.Columns.FindByUniqueName("DeleteCommandColumn"); GridColumn Viewcolumn = rgJADuty.MasterTableView.OwnerGrid.Columns.FindByUniqueName("ViewCommandColumn"); //View if (CurrentNavMode == enumNavigationMode.View) { //no add rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; //edit column should not be visible if (Editcolumn != null) { Editcolumn.Visible = false; Editcolumn.Display = false; } // no delete if (Deletecolumn != null) { Deletecolumn.Visible = false; } //only View if (Viewcolumn != null) { Viewcolumn.Visible = true; Viewcolumn.Display = true; } btnContinue.Text = "Continue"; btnContinue.ToolTip = "Continue"; rgJADuty.Rebind(); // To hide the Add New Duty link in View mode. } //Edit else { //admin if ((base.IsAdmin) && (base.InProcessJNPWorkflowStatuses.Contains(currentws))) { //allow add rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; //allow edit if (Editcolumn != null) { Editcolumn.Visible = true; Editcolumn.Display = true; } // allow delete if (Deletecolumn != null) { Deletecolumn.Visible = true; } //hide View if (Viewcolumn != null) { Viewcolumn.Visible = false; Viewcolumn.Display = false; } } else //non -admin --edit { //Issue 1060 Editable for HR in FinalReview if ((base.HasHRGroupPermission) && (CurrentJNPWS == enumJNPWorkflowStatus.FinalReview) && (!CurrentJNP.IsJNPSignedByHR)) { //allow add rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; //allow edit if (Editcolumn != null) { Editcolumn.Visible = true; Editcolumn.Display = true; } // allow delete if (Deletecolumn != null) { Deletecolumn.Visible = true; } //hide View if (Viewcolumn != null) { Viewcolumn.Visible = false; Viewcolumn.Display = false; } } else { bool showedit = base.ShowEditFields(enumDocumentType.JA); Editcolumn.Visible = showedit; Deletecolumn.Visible = showedit; Viewcolumn.Visible = !showedit; //add if (showedit) { rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; } else { rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; } // In Final Review: User should not be allowed to add new duty/edit/delete existing duty regardless of signatures if (currentws == enumJNPWorkflowStatus.FinalReview) { rgJADuty.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None; Editcolumn.Visible = false; Deletecolumn.Visible = false; Viewcolumn.Visible = true; } } } rgJADuty.Rebind(); } SetGridQualView(); //Scroll to the top to dispaly the validation message. List <JobAnalysisDuty> currentJADuties = CurrentJobAnalysis.GetJobAnalysisDuty(); int totalDutyPct = 0; foreach (JobAnalysisDuty duty in currentJADuties) { totalDutyPct += duty.JAPercentageOfTime; } if ((totalDutyPct != 100) || (!CheckIfEachMajorDutyHasOneDutyKSA())) { btnContinue.OnClientClick = "scrolltoTopDuty()"; } }