public async override void Execute() { var newPodcastUrl = newSubscriptionService.GetSubscriptionUrl(); if (newPodcastUrl != null) { var pod = new Podcast { SubscriptionUrl = newPodcastUrl }; try { await podcastLoader.UpdatePodcast(pod); subscriptionManager.AddSubscription(pod); EventAggregator.Instance.Publish(new PodcastLoadedMessage(pod)); } catch (WebException) { messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL"); } catch (XmlException) { messageBoxDisplayService.Show("Sorry, that URL is not a podcast feed"); } } }
public async override void Execute() { var newPodcastUrl = newSubscriptionService.GetSubscriptionUrl(); if (newPodcastUrl != null) { var pod = new Podcast() { SubscriptionUrl = newPodcastUrl }; try { await podcastLoader.UpdatePodcast(pod); subscriptionManager.AddSubscription(pod); Utils.AddPodcastToTreeView(pod, subscriptionView); } catch (WebException) { messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL"); } catch (XmlException) { messageBoxDisplayService.Show("Sorry, that URL is not a podcast feed"); } } }
public override async void Execute() { var newPodcastSubscription = newSubscriptionService.GetSubscriptionUrl(); if (newPodcastSubscription != null) { var newPodcast = new Podcast() { SubscriptionUrl = newPodcastSubscription }; try { await podcastLoader.UpdatePodcast(newPodcast); subscriptionManager.AddPodcast(newPodcast); Utils.AddPodcastToSubscriptionView(subscriptionView, newPodcast); } catch (WebException) { messageBoxDisplayService.Show("Sorry, that podcast could not be found. Please check the URL"); } catch (XmlException) { messageBoxDisplayService.Show("Sorry, the URL is not a podcast feed"); } catch (XmlRssChannelNodeNotFoundException ex) { messageBoxDisplayService.Show(ex.Message); } } }
private void ActualizarCliente(Cliente cliente) { if (!cliente.Activo ?? true) { _messageBoxDisplayService.Show(this, string.Format(Resources.MensajeClienteInactivo, cliente.Denominacion, cliente.Cuit), Resources.LabelVentas); return; } _cliente = cliente; var deudaTotal = _clienteNegocio.DeudaTotal(_cliente.Id, this.Context.SucursalActual.Id); var deudaVencida = _clienteNegocio.DeudaVencida(_cliente.Id, this.Context.SucursalActual.Id); UcClienteDetalle.ActualizarCliente(_cliente, deudaTotal, deudaVencida); UcCuentaCorrienteInfo.ActualizarInfoCuentaCorriente(_cliente); //UcTotalesVenta.Senas = 0; //UcTotalesVenta.CreditosDevolucion = 0; UcTotalesVenta.SenasDisp = _ventaNegocio.SenaAFavorCliente(_cliente.Id, Context.SucursalActual.Id); UcTotalesVenta.CreditosDevolucionDisp = _ventaNegocio.CreditosPorDevolucion(_cliente.Id, Context.SucursalActual.Id); // UcTotalesVenta.ActualizarMontosAFavor(UcTotalesVenta.Senas, UcTotalesVenta.CreditosDevolucion); UcTotalesVenta.ActualizarMontosAFavor(UcTotalesVenta.SenasDisp, UcTotalesVenta.CreditosDevolucionDisp); UcTotalesVenta.Senas = 0; UcTotalesVenta.CreditosDevolucion = 0; UcBuscadorConsignacion.ActualizarFormaPago(_cliente); }
private void BtnEliminar_Click(object sender, EventArgs e) { var banco = Uow.Bancos.Obtener(p => p.Id == _bancoId); var cheques = Uow.ChequesTerceros.Listado().Where(c => c.BancoId == _bancoId).ToList(); var tarjetasMovimientos = Uow.TarjetasMovimientos.Listado().Where(m => m.BancoId == _bancoId).ToList(); if (cheques.Any() || tarjetasMovimientos.Any()) { _messageBoxDisplayService.Show(Resources.ErrorMessageBancoConDatos, Resources.LabelBancos); return; } var proveedores = Uow.Proveedores.Listado().Where(p => p.ProveerdorBcoId == _bancoId).ToList(); foreach (var proveedor in proveedores) { proveedor.ProveerdorBcoId = null; Uow.Proveedores.Modificar(proveedor); } var proveedoresBancos = Uow.ProveedoresBancos.Listado().Where(pb => pb.BancoId == _bancoId).ToList(); foreach (var proveedorBanco in proveedoresBancos) { Uow.ProveedoresBancos.Eliminar(proveedorBanco); } Uow.Bancos.Eliminar(banco); Uow.Commit(); }
private async void MainFormViewOnLoad(object sender, EventArgs eventArgs) { foreach (var pod in subscriptionManager.Subscriptions) { var podcast = pod; await podcastLoader.UpdatePodcast(podcast); Utils.AddPodcastToTreeView(pod, subscriptionView); } Utils.SelectFirstEpisode(subscriptionView, subscriptionManager); if (settingsService.FirstRun) { messageBoxDisplayService.Show("Welcome! Get started by clicking Add to subscribe to a podcast"); settingsService.FirstRun = false; settingsService.Save(); } }
private async void OnMainFormLoad(object sender, EventArgs e) { foreach (var pod in _podcasts) { await _podcastLoader.UpdatePodcast(pod); AddPodcastToTreeView(pod); } SelectFirstEpisode(); if (!_settingsService.FirstRun) { return; } _messageBoxDisplayService.Show("Welcome! Get started by clicking Add to subscribe to a new podcast."); _settingsService.FirstRun = false; _settingsService.Save(); }
private async void MainFormViewOnLoad(object sender, EventArgs eventArgs) { foreach (var pod in subscriptionManager.Subscriptions) { var podcast = pod; await podcastLoader.UpdatePodcast(podcast); EventAggregator.Instance.Publish(new PodcastLoadedMessage(podcast)); } EventAggregator.Instance.Publish(new PodcastLoadCompleteMessage(subscriptionManager.Subscriptions.ToArray())); if (settingsService.FirstRun) { messageBoxDisplayService.Show("Welcome! Get started by clicking Add to subscribe to a podcast"); settingsService.FirstRun = false; settingsService.Save(); } }
private async void MainFormViewOnLoad(object sender, EventArgs eventArgs) { foreach (var pod in subscriptionManager.Subscriptions) { var podcast = pod; var podcastLoadTask = podcastLoader.UpdatePodcast(podcast); var firstFinished = await Task.WhenAny(podcastLoadTask, Task.Delay(5000)); if (firstFinished == podcastLoadTask) { EventAggregator.Instance.Publish(new PodcastLoadedMessage(podcast)); } } if (settingsService.FirstRun) { messageBoxDisplayService.Show("Welcome! Get started by clicking Add to subscribe to a podcast"); settingsService.FirstRun = false; settingsService.Save(); } }
private bool ValidateInput(MetadataSource metadataSource) { if (metadataSource == MetadataSource.Grpc) { try { var kProtoFile = metadataSource == MetadataSource.Grpc ? _protoToKProtoConverter.Convert("zzz", _protoFileView.ProtoFileText) : null; if (kProtoFile == null || kProtoFile.GeneratedProtoFile == null || kProtoFile.GeneratedProtoFile.ProtoMessage.Count == 0) { _messageBoxDisplayService.Show("Invalid proto"); return(false); } } catch (ProtoCompileException ex) { _messageBoxDisplayService.Show(ex.Message); return(false); } } return(true); }
private void BtnEliminar_Click(object sender, EventArgs e) { var autor = Uow.Autores.Obtener(a => a.Id == _autorId); var titulos = Uow.Titulos.Listado().Where(t => t.AutorId == autor.Id).ToList(); if (titulos.Any()) { _messageBoxDisplayService.Show(Resources.ErrorMessageEditorialConTitulos, Resources.LabelAutores); return; } Uow.Autores.Eliminar(autor); Uow.Commit(); }
private async void MainFormViewOnLoad(object sender, EventArgs eventArgs) { foreach (var podcast in subscriptionManager.Podcasts) { var podcastLoadTask = Task.Run(() => podcastLoader.UpdatePodcast(podcast)); var firstFinished = await Task.WhenAny(podcastLoadTask, Task.Delay(5000)); if (firstFinished == podcastLoadTask) { Utils.AddPodcastToSubscriptionView(subscriptionView, podcast); if (subscriptionView.SelectedNode == null && !subscriptionView.IsEmpty()) { Utils.SelectFirstEpisode(subscriptionView, subscriptionManager); } } } if (settingsService.FirstRun) { messageBoxDisplayService.Show("Welcome! Get started by clicking Add to subscribe to a podcast"); settingsService.FirstRun = false; settingsService.Save(); } }
private void ActualizarCliente(Cliente cliente) { if (!cliente.Activo ?? true) { _messageBoxDisplayService.Show(this, string.Format(Resources.MensajeClienteInactivo, cliente.Denominacion, cliente.Cuit), Resources.LabelVentas); return; } _cliente = cliente; var deudaTotal = _clienteNegocio.DeudaTotal(_cliente.Id, this.Context.SucursalActual.Id); var deudaVencida = _clienteNegocio.DeudaVencida(_cliente.Id, this.Context.SucursalActual.Id); ucClienteDetalle.ActualizarCliente(_cliente, deudaTotal, deudaVencida); }
private void BtnEliminar_Click(object sender, EventArgs e) { var subTema = Uow.SubTemas.Obtener(st => st.Id == _subTemaId); var titulos = Uow.Titulos.Listado().Where(t => t.SubtemaId == _subTemaId).ToList(); if (titulos.Any()) { _messageBoxDisplayService.Show(Resources.ErrorMessageSubTemasConTitulos, Resources.LabelSubTemas); return; } Uow.SubTemas.Eliminar(subTema); Uow.Commit(); }
private void BtnEliminar_Click(object sender, EventArgs e) { var editorial = Uow.Editoriales.Obtener(ed => ed.Id == _editorialId); var titulos = Uow.Titulos.Listado().Where(t => t.EditorialId == _editorialId).ToList(); if (titulos.Any()) { _messageBoxDisplayService.Show(Resources.ErrorMessageEditorialConTitulos, Resources.LabelEditoriales); return; } editorial.Activo = false; Uow.Editoriales.Modificar(editorial); Uow.Commit(); }
private void BtnEliminar_Click(object sender, EventArgs e) { var tieneDeuda = _clienteNegocio.DeudaTotal(_clienteId, null) > 0; if (tieneDeuda) { _messageBoxDisplayService.Show(Resources.ErrorMessageClienteConDeuda, Resources.LabelClientes); return; } var cliente = Uow.Clientes.Obtener(p => p.Id == _clienteId); cliente.Activo = false; Uow.Clientes.Modificar(cliente); Uow.Commit(); }
private void OnOperatorClick(object sender, EventArgs e) { Button b = (Button)sender; _operation = b.Text; try { _calculatorEngine.SubmitOperation("=", Convert.ToDecimal(_shownText)); _isOperatorPressed = true; _equation = _shownText + " " + _operation; _calculatorView.EquationLabel(_equation); } catch (FormatException) { _messageBoxDisplayService.Show("Enter a valid value"); _shownText = "0"; _equation = "0"; //vreau ca operatia sa ramana salvata in eventualitatea in care userul a realizat din greseala o operatie "nevalida" si doreste sa continue efectuarea acesteia, cu un operand valid, dupa ce curata ResultBox-ul. } }