/// <summary> /// hide/show field for "County/State" /// </summary> public void ShowCountyStateField(bool AShow) { if (AShow) { // replace county label with system default if it exists string LocalisedCountyLabel; string Name; LocalisedStrings.GetLocStrCounty(out LocalisedCountyLabel, out Name); LocalisedCountyLabel = LocalisedCountyLabel.Replace(":", "").Replace("&", ""); if (!string.IsNullOrEmpty(LocalisedCountyLabel)) { lblCounty.Text = LocalisedCountyLabel + ":"; } } lblCounty.Visible = AShow; txtCounty.Visible = AShow; }
/// <summary> /// constructor /// </summary> /// <param name="ASourceTable"></param> /// <param name="ASearchForActivePartners"></param> /// <param name="AVisibleFields"></param> public void CreateBankDetailsColumns(DataTable ASourceTable, Boolean ASearchForActivePartners, ArrayList AVisibleFields) { const int PARTNERCLASS_COLUMNWIDTH = 65; String dummy; String LocalisedCountyLabel; LocalisedStrings.GetLocStrCounty(out LocalisedCountyLabel, out dummy); // done this way in case it changes LocalisedCountyLabel = LocalisedCountyLabel.Replace(":", "").Replace("&", ""); FDataGrid.AddTextColumn("Class", ASourceTable.Columns["p_partner_class_c"], PARTNERCLASS_COLUMNWIDTH); FDataGrid.AddTextColumn("Partner Key", ASourceTable.Columns["p_partner_key_n"]); FDataGrid.AddTextColumn("Partner Name", ASourceTable.Columns["p_partner_short_name_c"]); FDataGrid.AddTextColumn("Account Number", ASourceTable.Columns["p_bank_account_number_c"]); FDataGrid.AddTextColumn("Account Name", ASourceTable.Columns["p_account_name_c"]); FDataGrid.AddTextColumn("Bank Name", ASourceTable.Columns["p_branch_name_c"]); FDataGrid.AddTextColumn("Bank/Branch Code", ASourceTable.Columns["p_branch_code_c"]); FDataGrid.AddTextColumn("BIC/SWIFT Code", ASourceTable.Columns["p_bic_c"]); FDataGrid.AddTextColumn("IBAN", ASourceTable.Columns["p_iban_c"]); FDataGrid.AddTextColumn("Expiry Date", ASourceTable.Columns["p_expiry_date_d"]); FDataGrid.AddTextColumn("Comment", ASourceTable.Columns["p_comment_c"]); }
private void CreateColumns() { string Tmp; string LocalisedCountyLabel; LocalisedStrings.GetLocStrCounty(out LocalisedCountyLabel, out Tmp); // Done this way in case it changes LocalisedCountyLabel = LocalisedCountyLabel.Replace(":", "").Replace("&", ""); grdResult.Columns.Clear(); grdResult.AddTextColumn("City", FPagedDataTable.Columns[PLocationTable.GetCityDBName()]); grdResult.AddTextColumn("Post Code", FPagedDataTable.Columns[PLocationTable.GetPostalCodeDBName()]); grdResult.AddTextColumn("Addr1", FPagedDataTable.Columns[PLocationTable.GetLocalityDBName()]); grdResult.AddTextColumn("Street-2", FPagedDataTable.Columns[PLocationTable.GetStreetNameDBName()]); grdResult.AddTextColumn("Addr3", FPagedDataTable.Columns[PLocationTable.GetAddress3DBName()]); grdResult.AddTextColumn(LocalisedCountyLabel, FPagedDataTable.Columns[PLocationTable.GetCountyDBName()]); grdResult.AddTextColumn("Country", FPagedDataTable.Columns[PLocationTable.GetCountryCodeDBName()]); grdResult.AddTextColumn("Location Key", FPagedDataTable.Columns[PLocationTable.GetLocationKeyDBName()]); grdResult.AddTextColumn("SiteKey", FPagedDataTable.Columns[PLocationTable.GetSiteKeyDBName()]); grdResult.AutoResizeGrid(); }
/// <summary> /// constructor /// </summary> /// <param name="ASourceTable"></param> /// <param name="ADetailedResults"></param> /// <param name="ASearchForActivePartners"></param> /// <param name="AVisibleFields"></param> public void CreateColumns(DataTable ASourceTable, Boolean ADetailedResults, Boolean ASearchForActivePartners, ArrayList AVisibleFields) { const int PARTNERCLASS_COLUMNWIDTH = 65; String dummy; String LocalisedCountyLabel; /* The following code should work, but for some reason nothing happens... (not critical, but would be nice) * //Create a custom View class and a Condition that uses it * SourceGrid.Cells.Views.Cell NonActivePartnerView = new SourceGrid.Cells.Views.Cell(); * NonActivePartnerView.ForeColor = Color.DarkGray; * NonActivePartnerView.BackColor = Color.Green; * * SourceGrid.Conditions.ConditionView ConditionNonActive = * new SourceGrid.Conditions.ConditionView(NonActivePartnerView); * * ConditionNonActive.EvaluateFunction = delegate(SourceGrid.DataGridColumn column, * int gridRow, object itemRow) * { * DataRowView row = (DataRowView)itemRow; * * MessageBox.Show("Partner Status: " + row[1]); * * if (row["p_status_code_c"] != "ACTIVE") * { * MessageBox.Show("Partner not Active: " + row[1]); * return true; * } * else * { * return false; * } * }; */ LocalisedStrings.GetLocStrCounty(out LocalisedCountyLabel, out dummy); // done this way in case it changes LocalisedCountyLabel = LocalisedCountyLabel.Replace(":", "").Replace("&", ""); if (ADetailedResults) { FDataGrid.AddTextColumn("Class", ASourceTable.Columns["p_partner_class_c"], PARTNERCLASS_COLUMNWIDTH); FDataGrid.AddPartnerKeyColumn("Partner Key", ASourceTable.Columns["p_partner_key_n"]); FDataGrid.AddTextColumn("Partner Name", ASourceTable.Columns["p_partner_short_name_c"]); if (AVisibleFields.Contains("PreviousName")) { FDataGrid.AddTextColumn("Previous Name", ASourceTable.Columns["p_previous_name_c"]); } if (ASearchForActivePartners) { FDataGrid.AddTextColumn("Partner Status", ASourceTable.Columns["p_status_code_c"]); } FDataGrid.AddTextColumn("City", ASourceTable.Columns["p_city_c"]); FDataGrid.AddTextColumn("Post Code", ASourceTable.Columns["p_postal_code_c"]); FDataGrid.AddTextColumn("Addr1", ASourceTable.Columns["p_locality_c"]); FDataGrid.AddTextColumn("Addr2", ASourceTable.Columns["p_street_name_c"]); if (AVisibleFields.Contains("Address3")) { FDataGrid.AddTextColumn("Addr3", ASourceTable.Columns["p_address_3_c"]); } if (AVisibleFields.Contains("County")) { FDataGrid.AddTextColumn(LocalisedCountyLabel, ASourceTable.Columns["p_county_c"]); } FDataGrid.AddTextColumn("Country", ASourceTable.Columns["p_country_code_c"]); if (ASourceTable.Columns.Contains("p_family_key_n")) { FDataGrid.AddPartnerKeyColumn("Family Key", ASourceTable.Columns["p_family_key_n"]); } if (!ASearchForActivePartners) { FDataGrid.AddTextColumn("Partner Status", ASourceTable.Columns["p_status_code_c"]); } FDataGrid.AddTextColumn("Location Type", ASourceTable.Columns["p_location_type_c"]); FDataGrid.AddTextColumn("Location Key", ASourceTable.Columns["p_location_key_i"]); } else { FDataGrid.AddTextColumn("Class", ASourceTable.Columns["p_partner_class_c"], PARTNERCLASS_COLUMNWIDTH); FDataGrid.AddPartnerKeyColumn("Partner Key", ASourceTable.Columns["p_partner_key_n"]); FDataGrid.AddTextColumn("Partner Name", ASourceTable.Columns["p_partner_short_name_c"]); if (ASearchForActivePartners) { FDataGrid.AddTextColumn("Partner Status", ASourceTable.Columns["p_status_code_c"]); } FDataGrid.AddTextColumn("City", ASourceTable.Columns["p_city_c"]); FDataGrid.AddTextColumn("Addr2", ASourceTable.Columns["p_street_name_c"]); if (!ASearchForActivePartners) { FDataGrid.AddTextColumn("Partner Status", ASourceTable.Columns["p_status_code_c"]); } FDataGrid.AddTextColumn("Location Key", ASourceTable.Columns["p_location_key_i"]); } /* * // Add Condition to all Columns of the Grid * foreach (SourceGrid.DataGridColumn col in FDataGrid.Columns) * { * col.Conditions.Add(ConditionNonActive); * } */ }
private void SetupFindCriteriaLists() { object[] CheckedListItemArray; CheckedListBox TheCheckedListBox; Int32 Counter1; Int32 Counter2; String LocalisedCountyLabel; String Dummy; FFindCriteriaListsSetupRunning = true; LocalisedStrings.GetLocStrCounty(out LocalisedCountyLabel, out Dummy); LocalisedCountyLabel = LocalisedCountyLabel.Replace(":", "").Replace("&", ""); CheckedListItemArray = new object[7]; CheckedListItemArray[0] = new TFindCriteriaListItem("Partner Name", "PartnerName", TFindCriteriaColumn.fccLeft); CheckedListItemArray[1] = new TFindCriteriaListItem("Personal (First) Name", "PersonalName", TFindCriteriaColumn.fccLeft); CheckedListItemArray[2] = new TFindCriteriaListItem("Previous Name", "PreviousName", TFindCriteriaColumn.fccLeft); CheckedListItemArray[3] = new TFindCriteriaListItem("Partner Key", "PartnerKey", TFindCriteriaColumn.fccRight); CheckedListItemArray[4] = new TFindCriteriaListItem("OMSS Key", "OMSSKey", TFindCriteriaColumn.fccRight); CheckedListItemArray[5] = new TFindCriteriaListItem("Partner Class", "PartnerClass", TFindCriteriaColumn.fccRight); CheckedListItemArray[6] = new TFindCriteriaListItem("Partner Status", "PartnerStatus", TFindCriteriaColumn.fccRight); clbPartnerFindCriteria.Items.AddRange(CheckedListItemArray); CheckedListItemArray = new object[11]; CheckedListItemArray[0] = new TFindCriteriaListItem("Address 1", "Address1", TFindCriteriaColumn.fccLeft); CheckedListItemArray[1] = new TFindCriteriaListItem("Address 2", "Address2", TFindCriteriaColumn.fccLeft); CheckedListItemArray[2] = new TFindCriteriaListItem("Address 3", "Address3", TFindCriteriaColumn.fccLeft); CheckedListItemArray[3] = new TFindCriteriaListItem("Post Code", "PostCode", TFindCriteriaColumn.fccLeft); CheckedListItemArray[4] = new TFindCriteriaListItem("City/Town", "City", TFindCriteriaColumn.fccLeft); CheckedListItemArray[5] = new TFindCriteriaListItem(LocalisedCountyLabel, "County", TFindCriteriaColumn.fccLeft); CheckedListItemArray[6] = new TFindCriteriaListItem("Country", "Country", TFindCriteriaColumn.fccLeft); CheckedListItemArray[7] = new TFindCriteriaListItem("Mailing Addresses Only", "MailingAddressOnly", TFindCriteriaColumn.fccLeft); CheckedListItemArray[8] = new TFindCriteriaListItem("Phone Number", "PhoneNumber", TFindCriteriaColumn.fccLeft); CheckedListItemArray[9] = new TFindCriteriaListItem("Email", "Email", TFindCriteriaColumn.fccLeft); CheckedListItemArray[10] = new TFindCriteriaListItem("Location Key", "LocationKey", TFindCriteriaColumn.fccRight); clbAddressFindCriteria.Items.AddRange(CheckedListItemArray); CheckedListItemArray = new object[1]; CheckedListItemArray[0] = new TFindCriteriaListItem("Personnel Criteria Section", "PersonnelCriteria", TFindCriteriaColumn.fccRight); clbOtherFindCriteria.Items.AddRange(CheckedListItemArray); Counter2 = 0; TheCheckedListBox = clbPartnerFindCriteria; while (Counter2 <= 2) { for (Counter1 = 0; Counter1 <= TheCheckedListBox.Items.Count - 1; Counter1 += 1) { TFindCriteriaListItem CurrentItem = (TFindCriteriaListItem)TheCheckedListBox.Items[Counter1]; if (FCriteriaFieldsLeft != null) { if (FCriteriaFieldsLeft.Contains(CurrentItem.InternalName)) { TheCheckedListBox.SetItemChecked(Counter1, true); } } if (FCriteriaFieldsRight != null) { if (FCriteriaFieldsRight.Contains(CurrentItem.InternalName)) { TheCheckedListBox.SetItemChecked(Counter1, true); } } } Counter2 = Counter2 + 1; if (Counter2 == 1) { TheCheckedListBox = clbAddressFindCriteria; } if (Counter2 == 2) { TheCheckedListBox = clbOtherFindCriteria; } } FFindCriteriaListsSetupRunning = false; // disable PartnerKeyBehavior checkbox Counter1 = 0; foreach (TFindCriteriaListItem CurrentItem in clbPartnerFindCriteria.Items) { if (CurrentItem.InternalName == "PartnerKey") { chkExactPartnerKeyMatchSearch.Enabled = clbPartnerFindCriteria.GetItemChecked(Counter1); return; } Counter1 = Counter1 + 1; } }