Beispiel #1
0
 private void ConsultarDatosEntreFechas()
 {
     if (chbFiltrarFecha.Checked == true)
     {
         DateTime desde = Convert.ToDateTime(dtpDesde.Text);
         DateTime h     = Convert.ToDateTime(dtpHasta.Text);
         DateTime hasta = h.AddDays(1);
         dgvDatos.SetDataSource(
             from p in EComprasRepository.ObtenerCompras()
             .Where(p => p.Fecha >= desde && p.Fecha < hasta)
             orderby p.Id
             select new
         {
             p.Id,
             p.Fecha,
             Proveedor = ProveedoresRepository.ObtenerProveedorPorId(Convert.ToDecimal(p.IdProveedor)).RazonSocial,
             Usuario   = UsuariosRepository.ObtenerUsuarioPorId(Convert.ToDecimal(p.IdUsuario)).NombreCompleto
         }
             );
     }
     else
     {
         ConsultarDatos();
     }
 }
Beispiel #2
0
        private void CompletarDatosProveedor()
        {
            var p = ProveedoresRepository.ObtenerProveedorPorId(IdProveedor);

            txtDireccion.Text = p.Direccion;
            txtDocumento.Text = TiposDocumentoRepository.TiposDocumentoPorId(p.IdTipoDocumento).Descripcion +
                                "  " + p.NroDocumento.ToString().Trim();
        }
Beispiel #3
0
 private Models.Proveedores ObtenerProveedoresSeleccionado()
 {
     try
     {
         int rowindex = dgvDatos.CurrentCell.RowIndex;
         var id       = (Int32)dgvDatos.Rows[rowindex].Cells[0].Value;
         var a        = ProveedoresRepository.ObtenerProveedorPorId(id);
         return(a);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #4
0
 private void ConsultarDatos()
 {
     dgvDatos.SetDataSource(
         from p in EComprasRepository.ObtenerCompras()
         orderby p.Id
         select new
     {
         p.Id,
         p.Fecha,
         Proveedor = ProveedoresRepository.ObtenerProveedorPorId(Convert.ToDecimal(p.IdProveedor)).RazonSocial,
         Usuario   = UsuariosRepository.ObtenerUsuarioPorId(Convert.ToDecimal(p.IdUsuario)).NombreCompleto
     }
         );
 }
Beispiel #5
0
        private void dgvDatos_SelectionChanged(object sender, EventArgs e)
        {
            var a = ObtenerArticuloSeleccionado();

            if (a == null)
            {
                txtDescripcion.Text  = "";
                txtCodBarra.Text     = "";
                txtMarca.Text        = "";
                txtRubro.Text        = "";
                txtProveedor.Text    = "";
                txtStock.Text        = "";
                txtStockMin.Text     = "";
                txtCostoInicial.Text = "";
                txtDesc1.Text        = "";
                txtDesc2.Text        = "";
                txtDesc3.Text        = "";
                txtCosto.Text        = "";
                txtLista1.Text       = "";
                txtLista2.Text       = "";
                txtLista3.Text       = "";
                txtIVA.Text          = "";
                return;
            }
            txtDescripcion.Text  = a.Descripcion;
            txtCodBarra.Text     = a.CodBarra;
            txtMarca.Text        = MarcasRepository.ObtenerMarcaPorId(Convert.ToInt16(a.IdMarca)).Marca;
            txtRubro.Text        = RubrosRepository.ObtenerRubroPorId(Convert.ToInt16(a.IdRubro)).Rubro;
            txtProveedor.Text    = ProveedoresRepository.ObtenerProveedorPorId(Convert.ToInt16(a.IdProveedor)).RazonSocial;
            txtStock.Text        = Convert.ToString(a.Stock);
            txtStockMin.Text     = Convert.ToString(a.StockMinimo);
            txtCostoInicial.Text = "$ " + Convert.ToString(a.CostoInicial);
            txtDesc1.Text        = "$ " + Convert.ToString(a.Descuento1) + " (" + Convert.ToString(a.DescuentoPorc1) + "%)";
            txtDesc2.Text        = "$ " + Convert.ToString(a.Descuento2) + " (" + Convert.ToString(a.DescuentoPorc2) + "%)";;
            txtDesc3.Text        = "$ " + Convert.ToString(a.Descuento3) + " (" + Convert.ToString(a.DescuentoPorc3) + "%)";;
            txtCosto.Text        = "$ " + Convert.ToString(a.Costo);
            txtLista1.Text       = "$ " + Convert.ToString(a.PrecioL1) + " (" + Convert.ToString(a.PrecioPorcL1) + "%)";
            txtLista2.Text       = "$ " + Convert.ToString(a.PrecioL2) + " (" + Convert.ToString(a.PrecioPorcL2) + "%)";
            txtLista3.Text       = "$ " + Convert.ToString(a.PrecioL3) + " (" + Convert.ToString(a.PrecioPorcL3) + "%)";
            txtIVA.Text          = Convert.ToString(a.IVA);
        }
Beispiel #6
0
        private void dgvDatos_SelectionChanged(object sender, EventArgs e)
        {
            var p = ObtenerCompraSeleccionada();

            if (p == null)
            {
                limpiarTxt();
                return;
            }
            limpiarTxt();
            //var cliente = ClientesRepository.ObtenerClientePorId(Convert.ToDecimal(p.IdCliente));
            var proveedor = ProveedoresRepository.ObtenerProveedorPorId(Convert.ToDecimal(p.IdProveedor));

            txtCompraNro.Text = p.Id.ToString().Trim();
            txtProveedor.Text = proveedor.RazonSocial;
            txtNroDoc.Text    = proveedor.NroDocumento.ToString();
            txtDireccion.Text = proveedor.Direccion;
            txtTotal.Text     = p.Importe.ToString().Trim();
            txtRetirado.Text  = p.Retirado == 1 ? "Si" : "No";
            txtPagado.Text    = p.Pagado == 1 ? "Si" : "No";

            cargarDetalles(p.Id);
        }