private void LlenarComboBox() { RepositoryBase <Factura> repositoryBase = new RepositoryBase <Factura>(); DevueltatextBox.Text = "0"; IDcomboBox.Items.Clear(); CLienteIDcomboBox.Items.Clear(); ProductoIdcomboBox.Items.Clear(); RepositoryBase <Cliente> repositoryC = new RepositoryBase <Cliente>(); foreach (var item in repositoryC.GetList(c => true)) { CLienteIDcomboBox.Items.Add(item.ClieteID); } RepositoryBase <Producto> repositoryBaseA = new RepositoryBase <Producto>(); foreach (var item in repositoryBaseA.GetList(c => true)) { ProductoIdcomboBox.Items.Add(item.ProductoID); } foreach (var item in FacturacionBLL.GetList(x => true)) { IDcomboBox.Items.Add(item.FacturaId); } }
private void Consultabutton_Click(object sender, EventArgs e) { int id; switch (TipocomboBox.SelectedIndex) { //ID case 0: LimpiarError(); if (SetError(1)) { MessageBox.Show("Introduce un numero"); return; } id = int.Parse(CriteriotextBox.Text); filtrar = t => t.FacturaID == id && (t.Fecha.Day >= DesdedateTimePicker.Value.Day) && (t.Fecha.Month >= DesdedateTimePicker.Value.Month) && (t.Fecha.Year >= DesdedateTimePicker.Value.Year) && (t.Fecha.Day <= HastadateTimePicker.Value.Day) && (t.Fecha.Month <= HastadateTimePicker.Value.Month) && (t.Fecha.Year <= HastadateTimePicker.Value.Year); break; //Listar Todo case 1: filtrar = t => true; break; } ConsultadataGridView.DataSource = FacturacionBLL.GetList(filtrar); ConsultadataGridView.Columns["Detalle"].Visible = false; }
protected void ButtonBuscar_Click1(object sender, EventArgs e) { PrestamoGridView.DataBind(); Expression <Func <Facturacion, bool> > filtro = x => true; FacturacionBLL facturacion = new FacturacionBLL(); int id; DateTime desde = Convert.ToDateTime(DesdeTextBox.Text); DateTime hasta = Convert.ToDateTime(HastaTextBox.Text); switch (TipodeFiltro.SelectedIndex) { case 0: //ID id = Utilities.Utils.ToInt(TextCriterio.Text); if (FechaCheckBox.Checked == true) { filtro = x => x.FacturaID == id && (x.Fecha >= desde && x.Fecha <= hasta); } else { filtro = c => c.FacturaID == id; } if (FacturacionBLL.GetList(filtro).Count() == 0) { Utilities.Utils.ShowToastr(this, " Prestamo ID No Existe", "Fallido", "success"); return; } break; case 1: //Todos if (FechaCheckBox.Checked == true) { filtro = x => true && (x.Fecha >= desde && x.Fecha <= hasta); } else { filtro = x => true; } if (FacturacionBLL.GetList(filtro).Count() == 0) { Utilities.Utils.ShowToastr(this, "No existen Dichas Cuentas", "Fallido", "success"); } break; } PrestamoGridView.DataSource = FacturacionBLL.GetList(filtro); PrestamoGridView.DataBind(); }
private void ReporteButton_Click(object sender, EventArgs e) { Facturacion facturacionn = new Facturacion(); if (ConsultadataGridView.Rows.Count > 0 && ConsultadataGridView.CurrentRow != null) { List <Facturacion> Detalle = (List <Facturacion>)ConsultadataGridView.DataSource; int id = Detalle.ElementAt(ConsultadataGridView.CurrentRow.Index).FacturaID; ReporteFacturacion abrir = new ReporteFacturacion(FacturacionBLL.GetList(x => x.FacturaID == id)); abrir.Show(); } else { MessageBox.Show("No existe", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
protected void Page_Load(object sender, EventArgs e) { List <FacturacionDetalle> prestamo = new List <FacturacionDetalle>(); if (!Page.IsPostBack) { CuentaReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; CuentaReportViewer.Reset(); CuentaReportViewer.LocalReport.ReportPath = Server.MapPath(@"../Reportes/ReciboFacturacion.rdlc"); CuentaReportViewer.LocalReport.DataSources.Clear(); CuentaReportViewer.LocalReport.DataSources.Add(new ReportDataSource("ReciboFacturacion", FacturacionBLL.GetList(x => true).Last().Detalle)); CuentaReportViewer.LocalReport.Refresh(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CuentaReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local; CuentaReportViewer.Reset(); CuentaReportViewer.LocalReport.ReportPath = Server.MapPath(@"../Reportes/Facturacion.rdlc"); CuentaReportViewer.LocalReport.DataSources.Clear(); CuentaReportViewer.LocalReport.DataSources.Add(new ReportDataSource("Facturacion", FacturacionBLL.GetList(filtro))); CuentaReportViewer.LocalReport.Refresh(); } }