コード例 #1
0
        private void ButtonSubmit_Click(object sender, EventArgs e)
        {
            TableUtility tableUtility = new TableUtility(Globals.WatchdogAddIn.Application.ActiveWorkbook);
            Currency     currency     = new Currency(textBoxCurrency.Text);
            Fund         newFund      = new Fund(textBoxFundName.Text, textBoxIsin.Text, textBoxCustodyNr.Text, currency);

            tableUtility.CreateMissingTable(currency);
            tableUtility.CreateMissingTable(newFund);

            List <string> currencyData = new List <string>()
            {
                currency.IsoCode
            };

            tableUtility.InsertTableRow(currency, currencyData);
            List <string> fundData = new List <string>()
            {
                newFund.Name,
                newFund.CustodyAccountNumber,
                newFund.Isin,
                currency.GetIndex().ToString()
            };

            tableUtility.InsertTableRow(newFund, fundData);
            fundBindingSource.Add(newFund);
        }
コード例 #2
0
        public void OnSubmit(List<string> passedValue, string reference)
        {
            TableUtility tableUtility = new TableUtility(Globals.WatchdogAddIn.Application.ActiveWorkbook);
            RatingAgency ratingAgency = new RatingAgency(passedValue[0]);
            tableUtility.CreateMissingTable(RatingAgency.GetDefaultValue());
            tableUtility.InsertTableRow(ratingAgency, new List<string>
            {
                passedValue[0]
            });
            ratingAgencyBindingSource.Add(ratingAgency);

        }
コード例 #3
0
        private void AddCurrency(string currencyIsoCode)
        {
            TableUtility tableUtility = new TableUtility(Globals.WatchdogAddIn.Application.ActiveWorkbook);

            tableUtility.CreateMissingTable(Currency.GetDefaultValue());
            Currency currency = new Currency
            {
                IsoCode = currencyIsoCode
            };

            tableUtility.InsertTableRow(currency, new List <string>()
            {
                currency.IsoCode
            });
            currencyBindingSource.Add(currency);
        }
コード例 #4
0
        private void AddAssetClass(string assetClassName)
        {
            TableUtility tableUtility = new TableUtility(Globals.WatchdogAddIn.Application.ActiveWorkbook);

            tableUtility.CreateMissingTable(AssetClass.GetDefaultValue());
            AssetClass assetClass = new AssetClass
            {
                Name = assetClassName
            };

            tableUtility.InsertTableRow(assetClass, new List <string>()
            {
                assetClass.Name
            });
            assetClassBindingSource.Add(assetClass);
        }
コード例 #5
0
        private void RowValidatedRatings(object sender, DataGridViewCellEventArgs e)
        {

            if (currentRatingAgency == null)
            {
                return;
            }
            TableUtility tableUtility = new TableUtility(Globals.WatchdogAddIn.Application.ActiveWorkbook);
            tableUtility.CreateMissingTable(Rating.GetDefaultValue());
            Rating newRating = dataGridViewRatingCodes.Rows[e.RowIndex].DataBoundItem as Rating;
            if (newRating == null)
            {
                return;
            }
            if (newRating.Index == 0)
            {
                tableUtility.InsertTableRow(newRating, new List<string>
                {
                    newRating.RatingCode,
                    newRating.RatingNumericValue.ToString(),
                    currentRatingAgency.Index.ToString()
                });
                return;
            }

            if (!currentRow.RatingCode.Equals(newRating.RatingCode))
            {
                TableUpdateWrapper update = new TableUpdateWrapper(currentRow.Index, "rating_code", newRating.RatingCode);
                tableUtility.UpdateTableRow(currentRow, update);
            }

            if (currentRow.RatingNumericValue != newRating.RatingNumericValue)
            {
                TableUpdateWrapper update = new TableUpdateWrapper(currentRow.Index, "numeric_value", newRating.RatingNumericValue.ToString());
                tableUtility.UpdateTableRow(currentRow, update);
            }

        }