private void CargarObras() { try { teatro = cboTeatro.SelectedItem as Teatro; using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { listaObra = servicio.ComboManGetListaTeatro(teatro.IdTeatro); cboObra.DataSource = listaObra; cboObra.DisplayMember = "Nombre"; } } catch (Exception ex) { MessageBox.Show("Ocurrió un error " + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private async void CargarTeatros() { try { using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { listaTeatro = await servicio.ListarTeatrosAsync(); cboTeatro.DataSource = listaTeatro; cboTeatro.DisplayMember = "Nombre"; } CargarObras(); } catch (Exception ex) { MessageBox.Show("Ocurrió un error " + ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarObras() { teatro = metroComboBox1.SelectedItem as Teatro; using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { try { listaObra = servicio.ListarObraTeatro(teatro.IdTeatro); metroComboBox2.DataSource = listaObra; metroComboBox2.DisplayMember = "Nombre"; } catch (Exception ex) { MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } CargarFuncion(); }
private async void CargarTeatros() { using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { Animacion.ShowLoader(this); try { listaTeatro = await servicio.ListarTeatrosAsync(); } catch (Exception ex) { MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } Animacion.HideLoader(this); metroComboBox1.DataSource = listaTeatro; metroComboBox1.DisplayMember = "Nombre"; } CargarObras(); }
private void CargarFuncion() { txtFecha.Text = dateTimePicker1.Value.ToShortDateString(); obra = metroComboBox2.SelectedItem as Obra; diaFuncion = Util.DayOfWeekHelper(dateTimePicker1.Value.Date.DayOfWeek); FechaFuncion = dateTimePicker1.Value.Date; using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { try { listaFuncion = servicio.ListarFuncionDiaObra(diaFuncion, obra.IdObra); metroComboBox3.DataSource = listaFuncion; metroComboBox3.DisplayMember = "Horario"; } catch (Exception ex) { MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private async void btnGenerar_Click_1(object sender, EventArgs e) { if (!isProcessing) { try { isProcessing = true; fechaInicio = dtpFechaInicio.Value.Date; fechaFin = dtpFechaFin.Value.Date; List <RankingCliente> listaRankingCliente; using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { listaRankingCliente = await servicio.ObtenerRankingClienteAsync(fechaInicio, fechaFin); } reportViewer1.ProcessingMode = ProcessingMode.Local; reportViewer1.LocalReport.DataSources.Clear(); ReportDataSource Reporte = new ReportDataSource("DataSet1", listaRankingCliente); reportViewer1.LocalReport.DataSources.Add(Reporte); List <ReportParameter> parametros = new List <ReportParameter>(); parametros.Add(new ReportParameter("fechaInicio", "" + fechaInicio)); parametros.Add(new ReportParameter("fechaFin", "" + fechaFin)); //Añado parametros al reportviewer this.reportViewer1.LocalReport.SetParameters(parametros); reportViewer1.RefreshReport(); reportViewer1.Focus(); } catch (Exception ex) { MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Reporte en ejecución", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnCrear_Click(object sender, EventArgs e) { if (ValidarCampos()) { using (IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>()) { zona.Nombre = txtNombreZona.Text.ToUpper().Trim(); zona.Descripcion = txtDescripcionZona.Text.ToUpper().Trim(); zona.Estado = cboEstado.SelectedIndex == 0 ? "A" : "I"; zona.Precio = Convert.ToSingle(txtPrecioZona.Text); if (servicio.ActualizarZona(zona)) { MessageBox.Show("Proceso realizado correctamente", "Aviso"); this.Close(); } else { MessageBox.Show("Ocurrio un error", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private async void ReenviarCorreo() { try { Animacion.ShowLoader(this); IServiceTeatro servicio = Contenedor.current.Resolve <IServiceTeatro>(); bool resultado = await servicio.ReenviarCorreo(txtCorreoDestino.Text.Trim(), txtCorreoDestinoCC.Text.Trim(), completeHtml, txtAsunto.Text, logEmail); Animacion.HideLoader(this); if (resultado) { MessageBox.Show("Correo reenviado correctamente", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Ocurrio un error enviando el correo", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("Ocurrió un error: " + ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } }