Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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!");
                    }
                }
            }
        }
Example #4
0
 public bool Update(DetalleReporte t)
 {
     return(objDetalleReporteRepo.Update(t));
 }
Example #5
0
 public bool Insert(DetalleReporte t)
 {
     return(objDetalleReporteRepo.Insert(t));
 }