/// <summary> /// Determines all p_partner_attribute_type records that have p_category_code_c 'Phone'. /// </summary> /// <returns>String that contains all p_partner_attribute_type records that have p_category_code_c 'Phone'.</returns> public static string GetPhonePartnerAttributesConcatStr() { // TODO Make this Method multi-threading safe (as it gets used server-side, too)! See implementations in Methods 'AddCachedTableInternal' and 'GetContentsEntry' of TCacheableTablesManager... if (FPhonePartnerAttributesConcatStr == null) { PPartnerAttributeTypeTable PPartnerAttributeTypeDT = null; if (GetCacheablePartnerTableDelegate != null) { PPartnerAttributeTypeDT = (PPartnerAttributeTypeTable)GetCacheablePartnerTableDelegate( TCacheablePartnerTablesEnum.ContactTypeList); } else { throw new InvalidOperationException("Delegate 'TGetCacheablePartnerTable' must be initialised before calling this Method"); } if (GetPartnerCalculationsPhonePartnerAttributeTypesDelegate != null) { FPhonePartnerAttributesConcatStr = GetPartnerCalculationsPhonePartnerAttributeTypesDelegate(PPartnerAttributeTypeDT, null); } else { throw new InvalidOperationException( "Delegate 'TGetPartnerCalculationsCertainPartnerAttributeKinds' must be initialised before calling this Method"); } } return(FPhonePartnerAttributesConcatStr); }
private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { PPartnerAttributeTypeTable typeTable = (PPartnerAttributeTypeTable)TDataCache.TMPartner. GetCacheablePartnerTable(TCacheablePartnerTablesEnum.ContactTypeList); DataView typeDataView = new DataView(typeTable); typeDataView.Sort = PPartnerAttributeTypeTable.GetCategoryCodeDBName(); TFormDataKeyDescriptionList recordList = new TFormDataKeyDescriptionList(); recordList.Title = "Contact Categories and Types"; recordList.KeyTitle = Catalog.GetString("Contact Category"); recordList.DescriptionTitle = Catalog.GetString("Contact Type"); recordList.Field3Title = Catalog.GetString("Description"); PPartnerAttributeTypeRow typeRow; foreach (DataRowView typeRowView in typeDataView) { TFormDataKeyDescription record = new TFormDataKeyDescription(); typeRow = (PPartnerAttributeTypeRow)typeRowView.Row; record.Key = typeRow.CategoryCode; record.Description = typeRow.AttributeType; record.Field3 = typeRow.Description; recordList.Add(record); } TStandardFormPrint.PrintRecordList(recordList, 3, APrintApplication, typeDataView.Count, typeDataView, "", APreviewMode); }
/// <summary> /// Specifies a new Filter and applies it, then selects the Row passed in with <paramref name="ACurrentRowIndex"/>. /// </summary> /// <param name="ANewCode">New Code to filter on.</param> /// <param name="ACurrentRowIndex">The index of the Row that should get displayed (the 'current' Row).</param> private void FilterOnCode(string ANewCode, int ACurrentRowIndex) { string FilterStr = String.Format("{0}='{1}'", PPartnerAttributeTypeTable.GetCategoryCodeDBName(), ANewCode); FFilterAndFindObject.FilterPanelControls.SetBaseFilter(FilterStr, true); FFilterAndFindObject.ApplyFilter(); grdDetails.SelectRowWithoutFocus(ACurrentRowIndex); }
private DataTable GetPartnerAttributeSystemCategoryTypeListTable(TDBTransaction AReadTransaction, string ATableName) { PPartnerAttributeCategoryRow template = new PPartnerAttributeCategoryTable().NewRowTyped(false); template.SystemCategory = true; TSharedDataCache.TMPartner.MarkSystemCategorySettingsConcatStrNeedsRefreshing(); return(PPartnerAttributeTypeAccess.LoadViaPPartnerAttributeCategoryTemplate(template, null, null, AReadTransaction, StringHelper.InitStrArr(new String[] { "ORDER BY", PPartnerAttributeTypeTable.GetTableDBName() + "." + PPartnerAttributeTypeTable.GetIndexDBName() + " ASC" }), 0, 0)); }
private DataTable GetContactTypeListTable(TDBTransaction AReadTransaction, string ATableName) { PPartnerAttributeCategoryRow template = new PPartnerAttributeCategoryTable().NewRowTyped(false); template.PartnerContactCategory = true; template.SystemCategory = false; return(PPartnerAttributeTypeAccess.LoadViaPPartnerAttributeCategoryTemplate(template, null, null, AReadTransaction, StringHelper.InitStrArr(new String[] { "ORDER BY", PPartnerAttributeTypeTable.GetTableDBName() + "." + PPartnerAttributeTypeTable.GetIndexDBName() + " ASC" }), 0, 0)); }
/// <summary> /// Performs checks to determine whether a deletion of the current row is permissable /// </summary> /// <param name="ARowToDelete">the currently selected row to be deleted</param> /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param> /// <returns>true if user is permitted and able to delete the current row</returns> private bool PreDeleteManual(PPartnerAttributeTypeRow ARowToDelete, ref string ADeletionQuestion) { // If the last Row in the Grid is to be deleted: check if there are added 'Detail' Rows in *other* 'Master' Rows, // and if any of those 'Master' Rows was added too, tell the user that data needs to be saved first before deletion // of the present 'Detail' Row can go ahead. // The reason for that is that the deletion of that last 'Detail' Row will cause the OnNoMoreDetailRecords Event to // be raised by the UserControl, which in turn will cause the Form to call the 'SaveChanges' Method of the // UserControl before the Form saves its own data. While this in itself is OK, saving in the 'SaveChanges' Method // of the UserControl would fail as a 'Master' Row itself was newly added AND it wouldn't be in the DB yet! return(TDeleteGridRows.MasterDetailFormsSpecialPreDeleteCheck(this.Count, FPartnerAttributeCategoryDT, FMainDS.PPartnerAttributeType, PPartnerAttributeCategoryTable.GetCategoryCodeDBName(), PPartnerAttributeTypeTable.GetCategoryCodeDBName())); }
private void ImportPartnerAttribute(TDBTransaction ATransaction) { PPartnerAttributeRow PartnerAttributeRow = FMainDS.PPartnerAttribute.NewRowTyped(); PartnerAttributeRow.PartnerKey = FPartnerKey; PartnerAttributeRow.AttributeType = ReadString(); PartnerAttributeRow.Sequence = (Int32)MCommon.WebConnectors.TSequenceWebConnector.GetNextSequence( TSequenceNames.seq_partner_attribute_index); PartnerAttributeRow.Index = ReadInt32(); PartnerAttributeRow.Value = ReadString(); PartnerAttributeRow.Comment = ReadString(); PartnerAttributeRow.Primary = ReadBoolean(); PartnerAttributeRow.WithinOrganisation = ReadBoolean(); PartnerAttributeRow.Specialised = ReadBoolean(); PartnerAttributeRow.Confidential = ReadBoolean(); PartnerAttributeRow.Current = ReadBoolean(); PartnerAttributeRow.NoLongerCurrentFrom = ReadNullableDate(); if (FPartnerAttributeTypeTable == null) { FPartnerAttributeTypeTable = PPartnerAttributeTypeAccess.LoadAll( StringHelper.StrSplit(PPartnerAttributeTypeTable.GetAttributeTypeDBName(), ","), ATransaction); } // Ignore Attribute Types that are not in the database. avoid constraint violation if (!FIgnorePartner && (FPartnerAttributeTypeTable.Rows.Find(PartnerAttributeRow.AttributeType) != null)) { FMainDS.PPartnerAttribute.Rows.Add(PartnerAttributeRow); } Ict.Petra.Shared.MPartner.Calculations.DeterminePartnerContactDetailAttributes(FMainDS.PPartnerAttribute); }
/// <summary> /// dummy implementation of this method so autogenerated code works /// </summary> public void InitUserControl() { rtbContactDetails.BuildLinkWithValue = BuildLinkWithValue; FPartnerAttributeCategoryDT = (PPartnerAttributeCategoryTable)TDataCache.TMPartner.GetCacheablePartnerTable2(TCacheablePartnerTablesEnum. ContactCategoryList, PPartnerAttributeCategoryTable.GetTableName()); FPartnerAttributeTypeDT = (PPartnerAttributeTypeTable)TDataCache.TMPartner.GetCacheablePartnerTable2( TCacheablePartnerTablesEnum.ContactTypeList, PPartnerAttributeTypeTable.GetTableName()); FPetraUtilsObject.SetToolTip(btnReload, Catalog.GetString("Reload Partner Info")); }