Ejemplo n.º 1
0
 void HandleDataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (e.Success)
     {
         TDataCache.TMCommon.RefreshCacheableCommonTable(TCacheableCommonTablesEnum.CountryList);
     }
 }
 private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (FNewDonorWarning)
     {
         FPetraUtilsObject_DataSaved_NewDonorWarning(Sender, e);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// todoComment
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void OnDataSaved(System.Object sender, TDataSavedEventArgs e)
 {
     if (DataSaved != null)
     {
         DataSaved(this, e);
     }
 }
Ejemplo n.º 4
0
        private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
        {
            if (e.Success)
            {
                // Reload details on successful save. This is so dtpDetailDateEffective can be made readonly
                if (!FPetraUtilsObject.HasChanges)
                {
                    ShowDetailsManual(FPreviouslySelectedDetailRow);
                }

                if (!this.Modal)
                {
                    // Broadcast message to update partner's Partner Edit screen if open
                    TFormsMessage BroadcastMessage;

                    BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcGiftDestinationChanged);

                    BroadcastMessage.SetMessageDataGiftDestination(
                        FPartnerKey,
                        FMainDS.PPartnerGiftDestination);

                    TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage);
                }
            }
        }
Ejemplo n.º 5
0
        private void FPetraUtilsObject_DataSaved_NewDonorWarning(object Sender, TDataSavedEventArgs e)
        {
            // if data successfully saved then look for new donors and warn the user
            if (e.Success && (FGiftDetailTable != null) && FNewDonorWarning)
            {
                // this list contains a list of all new donors that were entered onto form
                List <Int64> NewDonorsList = ucoTransactions.NewDonorsList;

                foreach (GiftBatchTDSAGiftDetailRow Row in FGiftDetailTable.Rows)
                {
                    // check changed data is either added or modified and that it is by a new donor
                    if (((Row.RowState == DataRowState.Added) || (Row.RowState == DataRowState.Modified)) &&
                        (!Row.IsDonorKeyNull() && NewDonorsList.Contains(Row.DonorKey)))
                    {
                        if (MessageBox.Show(string.Format(Catalog.GetString(
                                                              "{0} ({1}) is a new Donor.{2}Do you want to add subscriptions for them?{2}" +
                                                              "(Note: this message can be disabled in the 'File' menu by unselecting the 'New Donor Warning' item.)"),
                                                          Row.DonorName, Row.DonorKey, "\n\n"),
                                            Catalog.GetString("New Donor"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            // Open the donor's Edit screen so subscriptions can be added
                            TFrmPartnerEdit frm = new TFrmPartnerEdit(FPetraUtilsObject.GetForm());

                            frm.SetParameters(TScreenMode.smEdit, Row.DonorKey, TPartnerEditTabPageEnum.petpSubscriptions);
                            frm.ShowDialog();
                        }

                        // ensures message is not displayed twice for one new donor with two gifts
                        NewDonorsList.Remove(Row.DonorKey);
                    }
                }

                ucoTransactions.NewDonorsList.Clear();
            }
        }
Ejemplo n.º 6
0
 private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (!FPetraUtilsObject.HasChanges)
     {
         // only set to read only if saving of data was successful
         SetPrimaryKeyReadOnly(true);
     }
 }
Ejemplo n.º 7
0
 private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (e.Success)
     {
         // We need to notify a listener such as the Form Letter dialog
         TFormsMessage broadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcMailingSetupSaved, this.ToString());
         TFormsList.GFormsList.BroadcastFormMessage(broadcastMessage);
     }
 }
Ejemplo n.º 8
0
 void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (!e.Success)
     {
         string msg = Catalog.GetString(
             "The data was not saved successfully.  If the reason given was that you, or another user, has modified the same data, please check that you have not used the same fee code for a 'Payable' and a 'Receivable' Administration Grant.");
         MessageBox.Show(msg, Catalog.GetString("Additional Help For Administration Grants"), MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 9
0
 private void FPetraUtilsObject_DataSaved(object sender, TDataSavedEventArgs e)
 {
     if (e.Success && FLatestSaveIncludedForex)
     {
         // Notify the exchange rate screen, if it is there
         TFormsMessage broadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcGLOrGiftBatchSaved, this.ToString());
         TFormsList.GFormsList.BroadcastFormMessage(broadcastMessage);
     }
 }
 /// <summary>
 /// When this document is saved in the database, I can check whether
 /// my calling form should be updated.
 /// </summary>
 /// <param name="Sender"></param>
 /// <param name="e"></param>
 private void OnDataSaved(object Sender, TDataSavedEventArgs e)
 {
     if (e.Success)
     {
         TFormsMessage broadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcAPTransactionChanged);
         broadcastMessage.SetMessageDataAPTransaction(txtSupplierName.Text);
         TFormsList.GFormsList.BroadcastFormMessage(broadcastMessage);
     }
 }
        private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
        {
            if (!FPetraUtilsObject.HasChanges)
            {
                // only set to read only if saving of data was successful
                SetPrimaryKeyReadOnly(true);

                // the following command sets the button for the unit key field to disabled
                // (not automatically happening with SetPrimaryKeyReadOnly)
                txtUnitKey.Enabled = false;
            }
        }
        private void DataSaved(object Sender, TDataSavedEventArgs e)
        {
            TTypedDataTable ChildDTWhoseDataGotSaved;

            // Save the changes in the user control
            if ((e.Success) &&
                (!FDataSavedInNoMasterDataToSaveEvent))
            {
                FPetraUtilsObject.SetChangedFlag();

                ucoValues.SaveChanges(out ChildDTWhoseDataGotSaved);

                FPetraUtilsObject.DisableSaveButton();
            }

            // Ensure Filter functionality is enabled (might have been disabled in Method 'Uco_NoMoreDetailRecords')
            ActionEnabledEvent(null, new ActionEventArgs("cndFindFilterAvailable", true));
        }
Ejemplo n.º 13
0
        private void DataSaved(object Sender, TDataSavedEventArgs e)
        {
            TTypedDataTable ChildDTWhoseDataGotSaved;

            // Save the changes in the user control
            if (e.Success)
            {
                if (!FDataSavedInNoMasterDataToSaveEvent)
                {
                    FPetraUtilsObject.SetChangedFlag();

                    ucoValues.SaveChanges(out ChildDTWhoseDataGotSaved);

                    FPetraUtilsObject.DisableSaveButton();
                }

                TSharedDataCache.TMPartner.MarkPhonePartnerAttributesConcatStrNeedsRefreshing();
                TSharedDataCache.TMPartner.MarkEmailPartnerAttributesConcatStrNeedsRefreshing();
            }

            // Ensure Filter functionality is enabled (might have been disabled in Method 'Uco_NoMoreDetailRecords')
            ActionEnabledEvent(null, new ActionEventArgs("cndFindFilterAvailable", true));
        }
 private void OnDataSaved(System.Object sender, TDataSavedEventArgs e)
 {
     // need to add columns again once it is saved
     AddSpecialColumns();
 }
Ejemplo n.º 15
0
 private void OnHierarchySaved(System.Object sender, TDataSavedEventArgs e)
 {
     SetPrimaryKeyReadOnly(false);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// The data has been saved
 /// </summary>
 private void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
 {
     ucoAPLedgerSettings.OnDataSaved();
 }
        void FPetraUtilsObject_DataSaved(object Sender, TDataSavedEventArgs e)
        {
            // Do not save anything if the main table did not save correctly
            if (!e.Success)
            {
                return;
            }

            // Ensure we get the current row's information
            if (FPreviouslySelectedDetailRow != null)
            {
                FPreviouslySelectedDetailRow[UsedByColumnOrdinal] = clbUsedBy.GetCheckedStringList();
            }

            // Now we need to save the PDataLabelUse table info using our data from our UsedBy column
            // Go round all the rows, seeing which rows have a new UsedBy value
            foreach (PDataLabelRow labelRow in FMainDS.PDataLabel.Rows)
            {
                if ((labelRow.RowState != DataRowState.Deleted) &&
                    (labelRow[UsedByColumnOrdinal].ToString() != labelRow[UsedByColumnOrdinal - 1].ToString()))
                {
                    // This row's UsedBy column has been edited
                    // Get the key and the list of usedBy's for this row
                    int      key        = labelRow.Key;
                    string   usedByList = labelRow[UsedByColumnOrdinal].ToString();
                    string[] uses       = usedByList.Split(',');

                    // Get the usedBy's that are in the database at the moment
                    DataRow[] UseRows = FExtraDS.PDataLabelUse.Select("p_data_label_key_i=" + key.ToString());

                    // For each current UsedBy, make sure it has a row in the database.
                    // If not, we need to add a new row, using an Idx1 value greater than anything used before
                    foreach (string use in uses)
                    {
                        bool bUseExistsAlready = false;

                        foreach (DataRow r in UseRows)
                        {
                            string tryUse = r.ItemArray[PDataLabelUseTable.ColumnUseId].ToString();

                            if (String.Compare(tryUse, use, true) == 0)
                            {
                                bUseExistsAlready = true;
                                break;
                            }
                        }

                        if (!bUseExistsAlready)
                        {
                            PDataLabelUseRow newRow = FExtraDS.PDataLabelUse.NewRowTyped();
                            newRow.DataLabelKey = key;
                            newRow.Use          = use;
                            newRow.Idx1         = ++MaxIdx1Value;
                            FExtraDS.PDataLabelUse.Rows.Add(newRow);
                        }
                    }

                    // Now go round the other way
                    // Go round each database row and check if its UsedBy is still in our current usedBy List
                    // If we don't find it in the current list we need to delete this row
                    foreach (DataRow r in UseRows)
                    {
                        string tryUse          = r.ItemArray[PDataLabelUseTable.ColumnUseId].ToString();
                        bool   bUseStillExists = false;

                        foreach (string use in uses)
                        {
                            if (String.Compare(tryUse, use, true) == 0)
                            {
                                bUseStillExists = true;
                                break;
                            }
                        }

                        if (!bUseStillExists)
                        {
                            // We no longer need this row for this usedBy/LabelKey
                            r.Delete();
                        }
                    }
                }
            }

            Ict.Common.Data.TTypedDataTable SubmitDT = FExtraDS.PDataLabelUse.GetChangesTyped();

            if (SubmitDT == null)
            {
                return;                                 // nothing to save
            }

            SaveDataLabelUseChanges(SubmitDT);
        }
Ejemplo n.º 18
0
 /**
  * This Procedure will get called from the SaveChanges procedure whenever a
  * Save operation is finished (successful or unsuccesful).
  *
  * @param sender The Object that throws this Event
  * @param e Event Arguments. Success property is true if saving was successful,
  * otherwise false.
  *
  */
 public void FormDataSaved(System.Object sender, TDataSavedEventArgs e)
 {
     MessageBox.Show("DataSaved Event. Success: " + e.Success.ToString());
 }