public bool Insert(DetalleReporte t) { bool rpta = false; try { using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["BD_Financiamiento"].ToString())) { con.Open(); var query = new SqlCommand("inser into DetalleReporte values (@IDTransaccion,@IDReporte)", con); query.Parameters.AddWithValue("@IDTransaccion", t.IDTransaccion.IDTransaccion); query.Parameters.AddWithValue("@IDReporte", t.IDReporte.IDReporte); query.ExecuteNonQuery(); rpta = true; } } catch (Exception ex) { throw ex; } return(rpta); }
public DetalleReporte FindByID(int?id) //importate { DetalleReporte detalle = null; try { var con = new SqlConnection(ConfigurationManager.ConnectionStrings["BD_Financiamiento"].ToString()); { con.Open(); var query = new SqlCommand("" + id + "'", con);//modificar base de datos ->porq? using (var dr = query.ExecuteReader()) { while (dr.Read()) { } } } } catch (Exception ex) { throw ex; } return(detalle); }
private void Guardarbutton_Click_1(object sender, EventArgs e) { LimpiarProvider(); if (SetError(2)) { MessageBox.Show("Llenar Campos vacios"); return; } Factura factura = LlenaClase(); if (IDcomboBox.Text == string.Empty) { if (FacturacionBLL.Guardar(factura)) { MessageBox.Show("Guardado!!"); LlenarComboBox(); FacturacionBLL.DescontarProductos(facturas.Detalle); var result = MessageBox.Show("Desea Imprimir un recibo?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { RepositoryBase <Cliente> repositorio = new RepositoryBase <Cliente>(); var usuario = repositorio.Buscar(factura.ClienteID); DetalleReporte reporte = new DetalleReporte(facturas.Detalle, UsuariotextBox.Text, usuario.Nombre); reporte.Show(); } Clean(); } else { MessageBox.Show("No se pudo Guardar!!"); } } else { var result = MessageBox.Show("Seguro de Modificar?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { if (FacturacionBLL.Modificar(LlenaClase())) { MessageBox.Show("Modificado !"); if (Detalle.Count != 0) { foreach (var item in Detalle) { FacturaDetalleBLL.Eliminar(item.Id); } } if (Arreglar) { FacturacionBLL.ArreglarProductoList(Detalle); Arreglar = false; } var resultado = MessageBox.Show("Desea Imprimir un recibo?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { Factura facturas = LlenaClase(); RepositoryBase <Cliente> repositorio = new RepositoryBase <Cliente>(); var usuario = repositorio.Buscar(factura.ClienteID); DetalleReporte reporte = new DetalleReporte(facturas.Detalle, UsuariotextBox.Text, usuario.Nombre); reporte.Show(); } Clean(); } else { MessageBox.Show("No se pudo modificar!"); } } } }
public bool Update(DetalleReporte t) { return(objDetalleReporteRepo.Update(t)); }
public bool Insert(DetalleReporte t) { return(objDetalleReporteRepo.Insert(t)); }