Esempio n. 1
0
 private void OnPartnerClassMainDataChanged(TPartnerClassMainDataChangedEventArgs e)
 {
     /* MessageBox.Show('OnPartnerClassMainDataChanged. e.PartnerClass: ' + e.PartnerClass.ToString); */
     if (PartnerClassMainDataChanged != null)
     {
         PartnerClassMainDataChanged(this, e);
     }
 }
Esempio n. 2
0
        private void OnAnyDataColumnChanging(System.Object sender, EventArgs e)
        {
            Control ctrl = (Control)sender;

            // return if control has not actually been changed (i.e. CTRL+A will unneccessarily fire this event)
            if (ctrl.GetType() == typeof(TextBox))
            {
                if ((((TextBox)ctrl).SelectedText == ctrl.Text) && (ctrl.Text != ""))
                {
                    return;
                }
            }

            TPartnerClassMainDataChangedEventArgs EventFireArgs;

            /* messagebox.show('Column_Changing Event: Column=' + e.Column.ColumnName + */
            /* '; Column content=' + e.Row[e.Column.ColumnName].ToString + */
            /* '; ' + e.ProposedValue.ToString); */
            /* MessageBox.Show('PartnerClass: ' + FPartnerClass.ToString); */
            EventFireArgs = new TPartnerClassMainDataChangedEventArgs();
            EventFireArgs.PartnerClass = FPartnerClass;

            if (FPartnerClass == "PERSON")
            {
                if ((sender == txtPersonTitle) ||
                    (sender == txtPersonFirstName) ||
                    (sender == txtPersonMiddleName) || (sender == txtPersonFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtPersonFamilyName.Text,
                                                                                                  txtPersonTitle.Text,
                                                                                                  txtPersonFirstName.Text,
                                                                                                  txtPersonMiddleName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "FAMILY")
            {
                if ((sender == txtFamilyTitle) || (sender == txtFamilyFirstName) ||
                    (sender == txtFamilyFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtFamilyFamilyName.Text,
                                                                                                  txtFamilyTitle.Text,
                                                                                                  txtFamilyFirstName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "CHURCH")
            {
                if (sender == txtChurchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtChurchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "ORGANISATION")
            {
                if (sender == txtOrganisationName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtOrganisationName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "UNIT")
            {
                if (sender == txtUnitName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtUnitName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "BANK")
            {
                if (sender == txtBranchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtBranchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "VENUE")
            {
                if (sender == txtVenueName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtVenueName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
        }
 private void OnPartnerClassMainDataChanged(TPartnerClassMainDataChangedEventArgs e)
 {
     /* MessageBox.Show('OnPartnerClassMainDataChanged. e.PartnerClass: ' + e.PartnerClass.ToString); */
     if (PartnerClassMainDataChanged != null)
     {
         PartnerClassMainDataChanged(this, e);
     }
 }
        private void OnAnyDataColumnChanging(System.Object sender, EventArgs e)
        {
            Control ctrl = (Control)sender;

            // return if control has not actually been changed (i.e. CTRL+A will unneccessarily fire this event)
            if (ctrl.GetType() == typeof(TextBox))
            {
                if ((((TextBox)ctrl).SelectedText == ctrl.Text) && (ctrl.Text != ""))
                {
                    return;
                }
            }

            TPartnerClassMainDataChangedEventArgs EventFireArgs;

            /* messagebox.show('Column_Changing Event: Column=' + e.Column.ColumnName + */
            /* '; Column content=' + e.Row[e.Column.ColumnName].ToString + */
            /* '; ' + e.ProposedValue.ToString); */
            /* MessageBox.Show('PartnerClass: ' + FPartnerClass.ToString); */
            EventFireArgs = new TPartnerClassMainDataChangedEventArgs();
            EventFireArgs.PartnerClass = FPartnerClass;

            if (FPartnerClass == "PERSON")
            {
                if ((sender == txtPersonTitle)
                    || (sender == txtPersonFirstName)
                    || (sender == txtPersonMiddleName) || (sender == txtPersonFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtPersonFamilyName.Text,
                        txtPersonTitle.Text,
                        txtPersonFirstName.Text,
                        txtPersonMiddleName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "FAMILY")
            {
                if ((sender == txtFamilyTitle) || (sender == txtFamilyFirstName)
                    || (sender == txtFamilyFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtFamilyFamilyName.Text,
                        txtFamilyTitle.Text,
                        txtFamilyFirstName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "CHURCH")
            {
                if (sender == txtChurchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtChurchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "ORGANISATION")
            {
                if (sender == txtOrganisationName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtOrganisationName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "UNIT")
            {
                if (sender == txtUnitName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtUnitName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "BANK")
            {
                if (sender == txtBranchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtBranchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "VENUE")
            {
                if (sender == txtVenueName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtVenueName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
        }
        private void OnAnyDataColumnChanging(System.Object sender, EventArgs e)
        {
            TPartnerClassMainDataChangedEventArgs EventFireArgs;

            /* messagebox.show('Column_Changing Event: Column=' + e.Column.ColumnName + */
            /* '; Column content=' + e.Row[e.Column.ColumnName].ToString + */
            /* '; ' + e.ProposedValue.ToString); */
            /* MessageBox.Show('PartnerClass: ' + FPartnerClass.ToString); */
            EventFireArgs = new TPartnerClassMainDataChangedEventArgs();
            EventFireArgs.PartnerClass = FPartnerClass;

            if (FPartnerClass == "PERSON")
            {
                if ((sender == txtPersonTitle) ||
                    (sender == txtPersonFirstName) ||
                    (sender == txtPersonMiddleName) || (sender == txtPersonFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtPersonFamilyName.Text,
                                                                                                  txtPersonTitle.Text,
                                                                                                  txtPersonFirstName.Text,
                                                                                                  txtPersonMiddleName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "FAMILY")
            {
                if ((sender == txtFamilyTitle) || (sender == txtFamilyFirstName) ||
                    (sender == txtFamilyFamilyName))
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtFamilyFamilyName.Text,
                                                                                                  txtFamilyTitle.Text,
                                                                                                  txtFamilyFirstName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "CHURCH")
            {
                if (sender == txtChurchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtChurchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "ORGANISATION")
            {
                if (sender == txtOrganisationName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtOrganisationName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "UNIT")
            {
                if (sender == txtUnitName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtUnitName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "BANK")
            {
                if (sender == txtBranchName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtBranchName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
            else if (FPartnerClass == "VENUE")
            {
                if (sender == txtVenueName)
                {
                    FMainDS.PPartner[0].PartnerShortName = Calculations.DeterminePartnerShortName(txtVenueName.Text);
                    OnPartnerClassMainDataChanged(EventFireArgs);
                }
            }
        }
        private void UcoUpperPart_PartnerClassMainDataChanged(System.Object Sender, TPartnerClassMainDataChangedEventArgs e)
        {
            FPetraUtilsObject.HasChanges = true;

            SetScreenCaption();
        }