Beispiel #1
0
 public HomeViewModel()
 {
     ManufacturerVM = new ManufacturerVM();
     WholesalerVM   = new WholesalerVM();
     PharmacyVM     = new PharmacyVM();
     PatientVM      = new PatientVM();
 }
        private async void DeployButton_ClickAsync(object sender, RoutedEventArgs e)
        {
            var deployment = new WholesalerDeployment();

            deployment.Name   = (string.IsNullOrEmpty(tokenName.Text) || string.IsNullOrWhiteSpace(tokenName.Text)) ? ViewModel.Name : tokenName.Text;
            deployment.Symbol = (string.IsNullOrEmpty(tokenSymbol.Text) || string.IsNullOrWhiteSpace(tokenSymbol.Text)) ? ViewModel.Symbol : tokenSymbol.Text;
            ViewModel         = DataContext as WholesalerVM;
            await ViewModel.DeployCommand(deployment);
        }
        private async void DispatchButton_ClickAsync(object sender, RoutedEventArgs e)
        {
            var fxn = new DispatchFunction();

            fxn.SourceAddress      = ViewModel.SetUp.Accounts.two.Address;
            fxn.SourceType         = 1;
            fxn.DestinationAddress = (string.IsNullOrEmpty(_accountParam.Text) || string.IsNullOrWhiteSpace(_accountParam.Text)) ? ViewModel.SetUp.Accounts.three.Address : _accountParam.Text;
            fxn.DestinationType    = (string.IsNullOrEmpty(_typeParam.Text) || string.IsNullOrWhiteSpace(_typeParam.Text)) ? Convert.ToByte(1) : Convert.ToByte(_typeParam.Text);
            fxn.TokenId            = string.IsNullOrEmpty(tokenId.Text) || string.IsNullOrWhiteSpace(tokenId.Text) ? BigInteger.Parse(tokenId.Text) : new BigInteger(new Random().Next(10, 1000));
            ViewModel = DataContext as WholesalerVM;
            await ViewModel.DispatchCommand(fxn);

            await UpdateTracking();
        }