예제 #1
0
 protected override void AddAssetToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (StartPageCheck())
     {
         using (AddAssetForm form = new AddAssetForm(Data.GetAvailableCurrencies()))
         {
             if (form.ShowDialog() == DialogResult.OK)
             {
                 MainPresenter.AddNewAsset(form.AssetName, form.AssetStatics, form.AssetCcyPairQuote);
                 MainPresenter.LoadAccounts(specifiedAddress: _AddressofElementShowed);
             }
         }
     }
 }
예제 #2
0
        public override Entity Execute(ActionContext context)
        {
            AddAssetForm form = new AddAssetForm(
                context.AssetManager.GetCities(),
                context.AssetManager.GetOwners(),
                context.AssetManager.GetAssets());

            if (form.ShowDialog(context.WindowOwner) == DialogResult.OK)
            {
                Asset asset = form.Asset;
                asset.Id = context.AssetManager.AddAsset(asset);


                context.Status = $"Asset with ID: '{asset.Id}' added to repositoy";
                return(form.Asset);
            }

            return(null);
        }