private void UiPicture_Click(object sender, EventArgs e) { uiPicture pic = sender as uiPicture; if (currentCustomerFisico != null) { Wallet wallet = new Wallet { CustomerId = currentCustomerFisico.CustomerId, CryptoCurrencyId = UtilConvert.ToInt(pic.Tag) }.ObterPorId(); GeneratePanel(wallet); } else if (currentCustomerJuridico != null) { Wallet wallet = new Wallet { CustomerId = currentCustomerJuridico.CustomerId, CryptoCurrencyId = UtilConvert.ToInt(pic.Tag) }.ObterPorId(); GeneratePanel(wallet); } else { new Alert("Ocorreu um erro grave! comunique ao seu gestor.", uiCSB.Toastr.Type.Error); } }
private void uiFlowPanelMoedas_ParentChanged(object sender, EventArgs e) { List <Cryptocurency> cryptocurrencys = new Cryptocurency().ObterTodos(); foreach (Cryptocurency cryptocurrency in cryptocurrencys) { uiPicture uiPicture = uiPicture1; uiPicture.BackgroundImage = UtilImage.ByteToImage(new Archive() { ArchiveId = cryptocurrency.ArchiveId }.ObterPorCod().Blob); uiPicture.Tag = UtilConvert.ToString(cryptocurrency.CryptocurrencyId); //uiPicture.Click += new EventHandler(UiPicture_Click); uiPicture.Visible = true; uiFlowPanelMoedas.Controls.Add(uiPicture); } }