private void SaveCategoryRatingGroups()
        {
            try
            {
                CategoryRatingGroup bestQuilifiedGroup = CategoryRatingGroupManager.GetBestQuilifiedGroup(CurrentCRID);
                bestQuilifiedGroup.ScoringRangeGroupTypeName = rtbBQGroupTypeName.Text.Trim();
                bestQuilifiedGroup.RangeMin             = Int32.Parse(rtbBQRangeMin.Text);
                bestQuilifiedGroup.RangeMax             = Int32.Parse(rtbBQRangeMax.Text);
                bestQuilifiedGroup.QualifyingStatements = rtbBQQualifyingStatements.Text.Trim();
                CategoryRatingGroupManager.Update(bestQuilifiedGroup, base.CurrentUserID);

                CategoryRatingGroup wellQuilifiedGroup = CategoryRatingGroupManager.GetWellQuilifiedGroup(CurrentCRID);
                if (wellQuilifiedGroup != null)
                {
                    wellQuilifiedGroup.ScoringRangeGroupTypeName = rtbWQGroupTypeName.Text.Trim();
                    wellQuilifiedGroup.RangeMin             = Int32.Parse(rtbWQRangeMin.Text);
                    wellQuilifiedGroup.RangeMax             = Int32.Parse(rtbWQRangeMax.Text);
                    wellQuilifiedGroup.QualifyingStatements = rtbWQQualifyingStatements.Text.Trim();
                    CategoryRatingGroupManager.Update(wellQuilifiedGroup, base.CurrentUserID);
                }

                CategoryRatingGroup quilifiedGroup = CategoryRatingGroupManager.GetQuilifiedGroup(CurrentCRID);
                quilifiedGroup.ScoringRangeGroupTypeName = rtbQGroupTypeName.Text.Trim();
                quilifiedGroup.RangeMin             = Int32.Parse(rtbQRangeMin.Text);
                quilifiedGroup.RangeMax             = Int32.Parse(rtbQRangeMax.Text);
                quilifiedGroup.QualifyingStatements = rtbQQualifyingStatements.Text.Trim();
                CategoryRatingGroupManager.Update(quilifiedGroup, base.CurrentUserID);
            }
            catch (Exception ex)
            {
                ExceptionBase.HandleException(ex);
            }
        }
        private void PopulateCategoryRatingGroups()
        {
            CategoryRatingGroup bestQuilifiedGroup = CategoryRatingGroupManager.GetBestQuilifiedGroup(CurrentCRID);

            if (bestQuilifiedGroup != null)
            {
                rtbBQGroupTypeName.Text        = bestQuilifiedGroup.ScoringRangeGroupTypeName;
                rtbBQRangeMin.Text             = bestQuilifiedGroup.RangeMin.ToString();
                rtbBQRangeMax.Text             = bestQuilifiedGroup.RangeMax.ToString();
                rtbBQQualifyingStatements.Text = bestQuilifiedGroup.QualifyingStatements;
            }

            CategoryRatingGroup wellQuilifiedGroup = CategoryRatingGroupManager.GetWellQuilifiedGroup(CurrentCRID);

            if (wellQuilifiedGroup != null)
            {
                rtbWQGroupTypeName.Text        = wellQuilifiedGroup.ScoringRangeGroupTypeName;
                rtbWQRangeMin.Text             = wellQuilifiedGroup.RangeMin.ToString();
                rtbWQRangeMax.Text             = wellQuilifiedGroup.RangeMax.ToString();
                rtbWQQualifyingStatements.Text = wellQuilifiedGroup.QualifyingStatements;
            }

            CategoryRatingGroup quilifiedGroup = CategoryRatingGroupManager.GetQuilifiedGroup(CurrentCRID);

            if (quilifiedGroup != null)
            {
                rtbQGroupTypeName.Text      = quilifiedGroup.ScoringRangeGroupTypeName;
                rtbQGroupTypeName.Font.Bold = true;

                rtbQRangeMin.Text             = quilifiedGroup.RangeMin.ToString();
                rtbQRangeMax.Text             = quilifiedGroup.RangeMax.ToString();
                rtbQQualifyingStatements.Text = quilifiedGroup.QualifyingStatements;

                if (string.IsNullOrEmpty(quilifiedGroup.QualifyingStatements))
                {
                    JNPackage jnpPackage = new JNPackage(base.CurrentJNPID);
                    Series    series     = new Series(jnpPackage.SeriesID);

                    rtbQQualifyingStatements.Text = CategoryRatingManager.GetMinimumQualification(series.TypeOfWorkID, jnpPackage.HighestAdvertisedGrade);;
                }
            }
        }
        protected void btnWellQualified_Command(object sender, CommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Delete")
                {
                    CategoryRatingGroup group = CategoryRatingGroupManager.GetWellQuilifiedGroup(CurrentCRID);
                    if (group != null)
                    {
                        CategoryRatingGroupManager.Delete(group, this.CurrentUserID);
                        wellQualified.Visible        = false;
                        btnWellQualified.Text        = "Add Well Qualified Section";
                        btnWellQualified.CommandName = "Add";
                    }
                }
                else if (e.CommandName == "Add")
                {
                    long crGroupID = CategoryRatingGroupManager.AddCRGroupByScoringRangeGroupType(enumScoringRangeGroupType.WellQualified, CurrentCRID, CurrentUserID);
                    if (crGroupID > 0)
                    {
                        wellQualified.Visible = true;
                        CategoryRatingGroup wellQuilifiedGroup = CategoryRatingGroupManager.GetByID(crGroupID);
                        if (wellQuilifiedGroup != null)
                        {
                            rtbWQGroupTypeName.Text        = wellQuilifiedGroup.ScoringRangeGroupTypeName;
                            rtbWQRangeMin.Text             = wellQuilifiedGroup.RangeMin.ToString();
                            rtbWQRangeMax.Text             = wellQuilifiedGroup.RangeMax.ToString();
                            rtbWQQualifyingStatements.Text = wellQuilifiedGroup.QualifyingStatements;

                            btnWellQualified.Text        = "Remove Well Qualified Section";
                            btnWellQualified.CommandName = "Delete";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionBase.HandleException(ex);
            }
        }