Beispiel #1
0
        /// <summary>
        /// Open a dialog to select Contact Attributes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SelectAttributes(object sender, EventArgs e)
        {
            TFrmContactAttributesDialog ContactAttributesDialog = new TFrmContactAttributesDialog(FPetraUtilsObject.GetForm());

            ContactAttributesDialog.ContactID = FContactDR.ContactLogId;
            ContactAttributesDialog.SelectedContactAttributeTable = FMainDS.PPartnerContactAttribute;

            if (ContactAttributesDialog.ShowDialog() == DialogResult.OK)
            {
                PPartnerContactAttributeTable Changes = ContactAttributesDialog.SelectedContactAttributeTable.GetChangesTyped();

                // if changes were made or a previously added row (unsaved) was deleted
                if ((Changes != null) || ContactAttributesDialog.AddedAttributeDeleted)
                {
                    FMainDS.PPartnerContactAttribute.Clear();
                    FMainDS.PPartnerContactAttribute.Merge(ContactAttributesDialog.SelectedContactAttributeTable);

                    FGridTableDV = ContactAttributesLogic.SetupContactAttributesGrid(ref grdSelectedAttributes,
                                                                                     FMainDS.PPartnerContactAttribute,
                                                                                     true,
                                                                                     FContactDR.ContactLogId);

                    // only enable save if there are actual changes from the original datatable
                    if (Changes != null)
                    {
                        FPetraUtilsObject.SetChangedFlag();
                    }
                }
            }
        }
        /// <summary>
        /// Open a dialog to select Contact Attributes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SelectAttributes(object sender, EventArgs e)
        {
            // open the contact attributes dialog
            TFrmContactAttributesDialog ContactAttributesDialog = new TFrmContactAttributesDialog(FPetraUtilsObject.GetForm());

            ContactAttributesDialog.ContactID = -1;
            ContactAttributesDialog.SelectedContactAttributeTable = FAttributeTable;

            if (ContactAttributesDialog.ShowDialog() == DialogResult.OK)
            {
                PPartnerContactAttributeTable Changes = ContactAttributesDialog.SelectedContactAttributeTable.GetChangesTyped();

                // if changes were made
                if (Changes != null)
                {
                    FAttributeTable = ContactAttributesDialog.SelectedContactAttributeTable;

                    // we do not need the deleted rows
                    FAttributeTable.AcceptChanges();

                    ContactAttributesLogic.SetupContactAttributesGrid(ref grdSelectedAttributes, FAttributeTable, false);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Open a dialog to select Contact Attributes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SelectAttributes(object sender, EventArgs e)
        {
            // open the contact attributes dialog
            TFrmContactAttributesDialog ContactAttributesDialog = new TFrmContactAttributesDialog(FPetraUtilsObject.GetForm());

            ContactAttributesDialog.ContactID = -1;
            ContactAttributesDialog.SelectedContactAttributeTable = FAttributeTable;

            if (ContactAttributesDialog.ShowDialog() == DialogResult.OK)
            {
                PPartnerContactAttributeTable Changes = ContactAttributesDialog.SelectedContactAttributeTable.GetChangesTyped();

                // if changes were made
                if (Changes != null)
                {
                    FAttributeTable = ContactAttributesDialog.SelectedContactAttributeTable;

                    // we do not need the deleted rows
                    FAttributeTable.AcceptChanges();

                    ContactAttributesLogic.SetupContactAttributesGrid(ref grdSelectedAttributes, FAttributeTable, false);
                }
            }
        }
        /// <summary>
        /// Open a dialog to select Contact Attributes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SelectAttributes(object sender, EventArgs e)
        {
            TFrmContactAttributesDialog ContactAttributesDialog = new TFrmContactAttributesDialog(FPetraUtilsObject.GetForm());

            ContactAttributesDialog.ContactID = FContactDR.ContactLogId;
            ContactAttributesDialog.SelectedContactAttributeTable = FMainDS.PPartnerContactAttribute;

            if (ContactAttributesDialog.ShowDialog() == DialogResult.OK)
            {
                PPartnerContactAttributeTable Changes = ContactAttributesDialog.SelectedContactAttributeTable.GetChangesTyped();

                // if changes were made or a previously added row (unsaved) was deleted
                if ((Changes != null) || ContactAttributesDialog.AddedAttributeDeleted)
                {
                    FMainDS.PPartnerContactAttribute.Clear();
                    FMainDS.PPartnerContactAttribute.Merge(ContactAttributesDialog.SelectedContactAttributeTable);

                    FGridTableDV = ContactAttributesLogic.SetupContactAttributesGrid(ref grdSelectedAttributes,
                        FMainDS.PPartnerContactAttribute,
                        true,
                        FContactDR.ContactLogId);

                    // only enable save if there are actual changes from the original datatable
                    if (Changes != null)
                    {
                        FPetraUtilsObject.SetChangedFlag();
                    }
                }
            }
        }
 public CustomValueChangedEvent(TFrmContactAttributesDialog AParentClass)
 {
     FParentClass = AParentClass;
 }
 public CustomValueChangedEvent(TFrmContactAttributesDialog AParentClass)
 {
     FParentClass = AParentClass;
 }