private void FormBenefitEdit_Load(object sender, System.EventArgs e) { if (BenCur == null) { MessageBox.Show("Benefit cannot be null."); DialogResult = DialogResult.Cancel; return; } if (!Security.IsAuthorized(Permissions.InsPlanEdit)) { butOK.Enabled = false; } if (BenCur.PatPlanNum == 0) //attached to insplan { checkPat.Checked = false; } else { checkPat.Checked = true; } listCategory.Items.Clear(); listCategory.Items.Add(Lan.g(this, "None")); listCategory.SelectedIndex = 0; _listCovCats = CovCats.GetDeepCopy(true); for (int i = 0; i < _listCovCats.Count; i++) { listCategory.Items.Add(_listCovCats[i].Description); if (_listCovCats[i].CovCatNum == BenCur.CovCatNum) { listCategory.SelectedIndex = i + 1; } } textProcCode.Text = ProcedureCodes.GetStringProcCode(BenCur.CodeNum); listType.Items.Clear(); for (int i = 0; i < Enum.GetNames(typeof(InsBenefitType)).Length; i++) { listType.Items.Add(Lan.g("enumInsBenefitType", Enum.GetNames(typeof(InsBenefitType))[i])); if ((int)BenCur.BenefitType == i) { listType.SelectedIndex = i; } } if (BenCur.Percent == -1) { textPercent.Text = ""; } else { textPercent.Text = BenCur.Percent.ToString(); } if (BenCur.MonetaryAmt == -1) { textAmount.Text = ""; } else { textAmount.Text = BenCur.MonetaryAmt.ToString("n"); } listTimePeriod.Items.Clear(); for (int i = 0; i < Enum.GetNames(typeof(BenefitTimePeriod)).Length; i++) { listTimePeriod.Items.Add(Lan.g("enumBenefitTimePeriod", Enum.GetNames(typeof(BenefitTimePeriod))[i])); if ((int)BenCur.TimePeriod == i) { listTimePeriod.SelectedIndex = i; } } textQuantity.Text = BenCur.Quantity.ToString(); listQuantityQualifier.Items.Clear(); for (int i = 0; i < Enum.GetNames(typeof(BenefitQuantity)).Length; i++) { listQuantityQualifier.Items.Add(Lan.g("enumBenefitQuantity", Enum.GetNames(typeof(BenefitQuantity))[i])); if ((int)BenCur.QuantityQualifier == i) { listQuantityQualifier.SelectedIndex = i; } } for (int i = 0; i < Enum.GetNames(typeof(BenefitCoverageLevel)).Length; i++) { listCoverageLevel.Items.Add(Lan.g("enumBenefitCoverageLevel", Enum.GetNames(typeof(BenefitCoverageLevel))[i])); if ((int)BenCur.CoverageLevel == i) { listCoverageLevel.SelectedIndex = i; } } //determine if this is an annual max /*if(textCode.Text=="" * && listType.SelectedIndex==(int)InsBenefitType.Limitations * && (listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.CalendarYear || listTimePeriod.SelectedIndex==(int)BenefitTimePeriod.ServiceYear) || && listQuantityQualifier.SelectedIndex==(int)BenefitQuantity.None) ||{ || isAnnualMax=true; ||}*/ }
private void FillSpans() { CovCats.RefreshCache(); CovSpans.RefreshCache(); _listCovCats = CovCats.GetDeepCopy(); gridMain.BeginUpdate(); gridMain.ListGridColumns.Clear(); GridColumn col = new GridColumn(Lan.g(this, "Category"), 90); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "From Code"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "To Code"), 70); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "Hidden"), 45); gridMain.ListGridColumns.Add(col); col = new GridColumn(Lan.g(this, "E-Benefit Category"), 100); gridMain.ListGridColumns.Add(col); gridMain.ListGridRows.Clear(); GridRow row; CovSpan[] spansForCat; for (int i = 0; i < _listCovCats.Count; i++) { row = new GridRow(); row.Tag = _listCovCats[i].Copy(); row.ColorBackG = Color.FromArgb(225, 225, 225); if (i != 0) { gridMain.ListGridRows[gridMain.ListGridRows.Count - 1].ColorLborder = Color.Black; } row.Cells.Add(_listCovCats[i].Description); row.Cells.Add(""); row.Cells.Add(""); if (_listCovCats[i].IsHidden) { row.Cells.Add("X"); } else { row.Cells.Add(""); } if (_listCovCats[i].EbenefitCat == EbenefitCategory.None) { row.Cells.Add(""); } else { row.Cells.Add(_listCovCats[i].EbenefitCat.ToString()); } gridMain.ListGridRows.Add(row); spansForCat = CovSpans.GetForCat(_listCovCats[i].CovCatNum); for (int j = 0; j < spansForCat.Length; j++) { row = new GridRow(); row.Tag = spansForCat[j].Copy(); row.Cells.Add(""); row.Cells.Add(spansForCat[j].FromCode); row.Cells.Add(spansForCat[j].ToCode); row.Cells.Add(""); row.Cells.Add(""); gridMain.ListGridRows.Add(row); } } gridMain.EndUpdate(); }