Exemplo n.º 1
0
        public static void ImportPartner(PartnerEditTDS AMainDS)
        {
            TDBTransaction ReadTransaction             = null;
            TDBTransaction SubmitChangesTransaction    = null;
            bool           SubmissionOK                = false;
            bool           ImportDefaultAcquCodeExists = false;

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref ReadTransaction,
                                                           delegate
            {
                ImportDefaultAcquCodeExists = PAcquisitionAccess.Exists(MPartnerConstants.PARTNERIMPORT_AQUISITION_DEFAULT,
                                                                        ReadTransaction);
            });

            if (!ImportDefaultAcquCodeExists)
            {
                PAcquisitionTable AcqTable = new PAcquisitionTable();
                PAcquisitionRow   row      = AcqTable.NewRowTyped();
                row.AcquisitionCode        = MPartnerConstants.PARTNERIMPORT_AQUISITION_DEFAULT;
                row.AcquisitionDescription = Catalog.GetString("Imported Data");
                AcqTable.Rows.Add(row);

                DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref SubmitChangesTransaction, ref SubmissionOK,
                                                           delegate
                {
                    PAcquisitionAccess.SubmitChanges(AcqTable, SubmitChangesTransaction);

                    SubmissionOK = true;
                });
            }

            PartnerEditTDSAccess.SubmitChanges(AMainDS);
        }
        private void InitializeManualCode()
        {
            // Hide invalid Acquisition Codes
            cmbAcquisitionCode.Filter = PAcquisitionTable.GetValidAcquisitionDBName() + " <> 0";

            // set values for controls
            cmbAcquisitionCode.SetSelectedString(TUserDefaults.GetStringDefault(TUserDefaults.PARTNER_ACQUISITIONCODE, "MAILROOM"));
            cmbLanguageCode.SetSelectedString(TUserDefaults.GetStringDefault(MSysManConstants.PARTNER_LANGUAGECODE, "99"));

            FShowMoneyAsCurrency   = TUserDefaults.GetBooleanDefault(StringHelper.PARTNER_CURRENCY_FORMAT_AS_CURRENCY, false);
            chkMoneyFormat.Checked = FShowMoneyAsCurrency;

            FShowDecimalsAsCurrency  = TUserDefaults.GetBooleanDefault(StringHelper.PARTNER_DECIMAL_FORMAT_AS_CURRENCY, false);
            chkDecimalFormat.Checked = FShowDecimalsAsCurrency;

            FShowThousands           = TUserDefaults.GetBooleanDefault(StringHelper.PARTNER_CURRENCY_SHOW_THOUSANDS, true);
            chkShowThousands.Checked = FShowThousands;

            // Examples
            txtCostExample.Context            = ".MPartner";
            txtCostExample.CurrencyCode       = "USD";
            txtCostExample.NumberValueDecimal = 1234.56m;

            txtNumericExample.Context            = ".MPartner";
            txtNumericExample.NumberValueDecimal = 1.75m;
        }
        private void InitializeManualCode()
        {
            // Hide invalid Acquisition Codes
            cmbAcquisitionCode.Filter = PAcquisitionTable.GetValidAcquisitionDBName() + " <> 0";

            // set values for controls
            cmbAcquisitionCode.SetSelectedString(TUserDefaults.GetStringDefault(TUserDefaults.PARTNER_ACQUISITIONCODE, "MAILROOM"));
            cmbLanguageCode.SetSelectedString(TUserDefaults.GetStringDefault(MSysManConstants.PARTNER_LANGUAGECODE, "99"));
        }
Exemplo n.º 4
0
        private void TPartnerNewDialogWinForm_Load(System.Object sender, System.EventArgs e)
        {
            FLogic = new TPartnerNewDialogScreenLogic();
            cmbPartnerClass.InitialiseUserControl();
            cmbAcquisitionCode.InitialiseUserControl();

            // Hide invalid Acquisition Codes
            this.cmbAcquisitionCode.Filter = PAcquisitionTable.GetValidAcquisitionDBName() + " <> 0";

            // Setup Data
            // As part of bug 5556 testing, checked if this returned a DataTable with any rows with RowState Modified.
            // The test didn't return much so this isn't conclusive, but it doesn't point to an error:
            // DataTable summary: 1 rows; 0 Added, 0 deleted, 0 detached, ***0 modified***, 1 unchanged.  Table name InstalledSitesList
            FInstalledSitesDT = TDataCache.TMPartner.GetCacheablePartnerTable(TCacheablePartnerTablesEnum.InstalledSitesList);

            if (FInstalledSitesDT.Rows.Count != 0)
            {
                FLogic.CreateColumns(grdInstalledSites, FInstalledSitesDT);

                // DataBindingrelated stuff
                SetupDataGridDataBinding();

                // Setup screen with default values
                InitialiseUI();

                if ((FPartnerClass == SharedTypes.PartnerClassEnumToString(TPartnerClass.PERSON)) ||
                    (FDefaultPartnerClass == SharedTypes.PartnerClassEnumToString(TPartnerClass.PERSON)))
                {
                    ShowFamilyPartnerSelection(true);
                }

                // Make the Grid respond on updown keys
                cmbPartnerClass.Focus();
                grdInstalledSites.Focus();

                // make sure that the grid row gets selected; Mono would not do it automatically
                DataGrid_FocusRowEntered(null, null);

                FFormSetupFinished = true;
            }
            else
            {
                MessageBox.Show(StrCantCreateNewPartner, MCommonResourcestrings.StrErrorNoInstalledSites);
                DialogResult = System.Windows.Forms.DialogResult.Cancel;
                Close();
                return;
            }
        }
Exemplo n.º 5
0
        private void TPartnerNewDialogWinForm_Load(System.Object sender, System.EventArgs e)
        {
            FLogic = new TPartnerNewDialogScreenLogic();
            cmbPartnerClass.InitialiseUserControl();
            cmbAcquisitionCode.InitialiseUserControl();

            // Hide invalid Acquisition Codes
            this.cmbAcquisitionCode.Filter = PAcquisitionTable.GetValidAcquisitionDBName() + " <> 0";

            // Setup Data
            FInstalledSitesDT = TDataCache.TMPartner.GetCacheablePartnerTable(TCacheablePartnerTablesEnum.InstalledSitesList);

            if (FInstalledSitesDT.Rows.Count != 0)
            {
                FLogic.CreateColumns(grdInstalledSites, FInstalledSitesDT);

                // DataBindingrelated stuff
                SetupDataGridDataBinding();

                // Setup screen with default values
                InitialiseUI();

                if ((FPartnerClass == SharedTypes.PartnerClassEnumToString(TPartnerClass.PERSON)) ||
                    (FDefaultPartnerClass == SharedTypes.PartnerClassEnumToString(TPartnerClass.PERSON)))
                {
                    ShowFamilyPartnerSelection(true);
                }

                // Make the Grid respond on updown keys
                cmbPartnerClass.Focus();
                grdInstalledSites.Focus();

                // make sure that the grid row gets selected; Mono would not do it automatically
                DataGrid_FocusRowEntered(null, null);

                FFormSetupFinished = true;
            }
            else
            {
                MessageBox.Show(StrCantCreateNewPartner, MCommonResourcestrings.StrErrorNoInstalledSites);
                DialogResult = System.Windows.Forms.DialogResult.Cancel;
                Close();
                return;
            }
        }
Exemplo n.º 6
0
        public static void SavePartner(PartnerEditTDS AMainDS)
        {
            TDBTransaction ReadTransaction = null;
            TDBTransaction SubmitChangesTransaction = null;
            bool SubmissionOK = false;
            bool ImportDefaultAcquCodeExists = false;

            DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref ReadTransaction,
                delegate
                {
                    ImportDefaultAcquCodeExists = PAcquisitionAccess.Exists(MPartnerConstants.PARTNERIMPORT_AQUISITION_DEFAULT,
                        ReadTransaction);
                });

            if (!ImportDefaultAcquCodeExists)
            {
                PAcquisitionTable AcqTable = new PAcquisitionTable();
                PAcquisitionRow row = AcqTable.NewRowTyped();
                row.AcquisitionCode = MPartnerConstants.PARTNERIMPORT_AQUISITION_DEFAULT;
                row.AcquisitionDescription = Catalog.GetString("Imported Data");
                AcqTable.Rows.Add(row);

                DBAccess.GDBAccessObj.BeginAutoTransaction(IsolationLevel.Serializable, ref SubmitChangesTransaction, ref SubmissionOK,
                    delegate
                    {
                        PAcquisitionAccess.SubmitChanges(AcqTable, SubmitChangesTransaction);

                        SubmissionOK = true;
                    });
            }

            PartnerEditTDSAccess.SubmitChanges(AMainDS);
        }