Example #1
0
        // GET: Facturas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Facturas facturas = db.Facturas.Find(id);

            if (facturas == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClienteId = new SelectList(db.Clientes, "ClienteId", "CedulaCliente", facturas.ClienteId);
            return(View(facturas));
        }
Example #2
0
        private void drawActualFactura()
        {
            resetConsole();

            string line      = new string('-', Console.WindowWidth);
            string emptyLine = new string(' ', Console.WindowWidth - 2);
            string helpLine  = "1-Anterior  2-Posterior  3-Añadir  4-Añadir Linea  0-Salir";
            string topLine   = "Clientes (ficha actual: " + Index + "/" + Facturas.Count + ")";
            string date      = (DateTime.Now.Date + "").Substring(0, 11) + "       " +
                               (DateTime.Now + "").Substring(11);

            //Cuadrado de arriba
            Console.SetCursorPosition(0, 0);
            Console.Write(line);
            Console.Write("|" + emptyLine + "|");
            Console.Write(line);
            Console.SetCursorPosition(1, 1);
            Console.Write(topLine);
            Console.SetCursorPosition(Console.WindowWidth / 2, 1);
            Console.Write(date);

            //Cabecera factura
            Console.SetCursorPosition(0, 4);
            Console.Write("Número de factura: ");
            Console.Write(Facturas.Get(Index).CabeceraActual.Numero);
            Console.Write("  Fecha: ");
            Console.Write((Facturas.Get(Index).CabeceraActual.Date + "").Substring(0, 11));
            Console.Write("  Cliente: ");
            Console.Write(Facturas.Get(Index).CabeceraActual.ClienteActual.Cif);

            //Lineas de factura
            for (int i = 0; i < Facturas.Get(Index).Lineas.Count; i++)
            {
                Console.SetCursorPosition(0, 6 + i);
                Console.Write(Facturas.Get(Index).Lineas[i].ProductoActual.Codigo);
                Console.Write(" x ");
                Console.Write((Facturas.Get(Index).Lineas[i].Cantidad));
            }

            //Parte de abajo
            Console.SetCursorPosition(0, Console.WindowHeight - 4);
            Console.Write(line);
            Console.SetCursorPosition(Console.WindowWidth / 2 -
                                      (helpLine.Length / 2), Console.WindowHeight - 3);
            Console.WriteLine(helpLine);

            Console.ResetColor();
        }
        protected void agregarLinkButton_Click(object sender, EventArgs e)
        {
            List <FacturasDetalles> facturacions = new List <FacturasDetalles>();

            Facturas facturacion = new Facturas();



            if (string.IsNullOrEmpty(ImporteTextbox.Text))
            {
                Utilities.Utils.ShowToastr(this, "Importe esta vacio", "Fallido", "error");
            }

            if (detalleGridView.Rows.Count != 0)
            {
                facturacion.Detalles = (List <FacturasDetalles>)ViewState["Facturacion"];
            }

            int     cliente  = Utilities.Utils.ToInt(ClienteDropDownList.SelectedValue);
            int     ropaId   = Utilities.Utils.ToInt(RopaDropDownList.SelectedValue);
            int     cantidad = Utilities.Utils.ToInt(CantidadTexbox.Text);
            decimal precio   = Utilities.Utils.ToDecimal(PrecioTextbox.Text);
            decimal Importe  = Utilities.Utils.ToDecimal(ImporteTextbox.Text);


            facturacion.Detalles.Add(new FacturasDetalles(0, Utilities.Utils.ToInt(FacturaIdTextbox.Text), ropaId, cantidad, precio, Importe));

            decimal subtotal = 0;
            decimal total    = 0;

            foreach (var item in facturacion.Detalles)
            {
                subtotal += item.Importe;
            }

            SubtotalTextBox.Text = subtotal.ToString();

            total += subtotal;

            TotalTextBox.Text = total.ToString();

            ViewState["Facturacion"] = facturacion.Detalles;


            detalleGridView.DataSource = ViewState["Facturacion"];
            detalleGridView.DataBind();
            MontoTextBox.Text = "";
        }
        protected void GuardarButton_Click(object sender, EventArgs e)
        {
            bool        paso        = false;
            FacturasBLL repositorio = new FacturasBLL();
            Facturas    factura     = new Facturas();

            if (HayErrores())
            {
                return;
            }
            else
            {
                factura = LlenaClase();

                if (Utils.ToInt(FacturaIdTextbox.Text) == 0)
                {
                    paso = FacturasBLL.Guardar(factura);
                    Utils.ShowToastr(this, "Guardado", "Exito", "success");
                    Limpiar();
                }
                else
                {
                    FacturasBLL repository = new FacturasBLL();
                    int         id         = Utils.ToInt(FacturaIdTextbox.Text);
                    factura = FacturasBLL.Buscar(id);

                    if (factura != null)
                    {
                        paso = FacturasBLL.Modificar(LlenaClase());
                        Utils.ShowToastr(this, "Modificado", "Exito", "success");
                        Limpiar();
                    }
                    else
                    {
                        Utils.ShowToastr(this, "Id no existe", "Error", "error");
                    }
                }

                if (paso)
                {
                    Limpiar();
                }
                else
                {
                    Utils.ShowToastr(this, "No se pudo guardar", "Error", "error");
                }
            }
        }
    protected void gridDocumentos_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label lbl_CatDcumentosId         = (Label)e.Row.FindControl("lbl_CatDcumentosId");
                Label lbl_Pzas                   = (Label)e.Row.FindControl("lbl_Pzas");
                Label lbl_DocumentosRelacioFolio = (Label)e.Row.FindControl("lbl_DocumentosRelacioFolio");
                Label lbl_DocStatus              = (Label)e.Row.FindControl("lbl_DocStatus");

                HyperLink HypFolio = (HyperLink)e.Row.FindControl("HypFolio");

                DocumentosRelacio obj_Pzas = new DocumentosRelacio();

                obj_Pzas.CatDcumentosId = SqlInt32.Parse(lbl_CatDcumentosId.Text);
                obj_Pzas.FacturasId     = SqlInt32.Parse(lbl_IdHojaViaje.Text);
                obj_Pzas.SelectOneDocRelacionadosPzas();

                if (!obj_Pzas.Pzas.IsNull)
                {
                    lbl_Pzas.Text = obj_Pzas.Pzas.ToString();
                }

                if (lbl_CatDcumentosId.Text == "1")
                {
                    Facturas obj_SelecDocentry = new Facturas();
                    obj_SelecDocentry.Facturas_DocNum = SqlInt32.Parse(lbl_DocumentosRelacioFolio.Text);
                    obj_SelecDocentry.SelectFacturaDocEntry();


                    TSHAK.Components.SecureQueryString QueryString = new TSHAK.Components.SecureQueryString(new Byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 8 });
                    QueryString["DocEntry"]  = obj_SelecDocentry.Facturas_DocEntry.ToString();
                    QueryString["DocStatus"] = lbl_DocStatus.Text;
                    QueryString["TipoDoc"]   = "FACTURA";

                    HypFolio.NavigateUrl = "http://www2.promoshop.com.mx/Factura_Electro/Default.aspx?data=" + HttpUtility.UrlEncode(QueryString.ToString());
                }
                else
                {
                    HypFolio.Enabled = false;
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
        protected void BuscarLinkButton_Click1(object sender, EventArgs e)
        {
            Repositorio <Facturas> rep = new Repositorio <Facturas>();
            Facturas f = rep.Buscar(ToInt(FacturaIdTextBox.Text));

            if (f != null)
            {
                LlenarCampo(f);
                ViewState["Detalle"] = f.Detalle;
            }
            else
            {
                CallModal("Esta factura no Existe");
                Limpiar();
            }
        }
        private void BuscarButton_Click(object sender, RoutedEventArgs e)
        {
            Facturas encontrado = FacturasBLL.Search(factura.FacturaId);

            if (encontrado != null)
            {
                factura = encontrado;
                Cargar();
            }
            else
            {
                Limpiar();
                MessageBox.Show("No existe en la base de datos", "Mensaje",
                                MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #8
0
        private Facturas LlenaClase()
        {
            Facturas facturas = new Facturas();

            facturas.FacturaId = (int)IdNumericUpDown.Value;
            facturas.Fecha     = FechaDateTimePicker.Value.Date;
            facturas.ClienteId = (int)NombresComboBox.SelectedValue;
            facturas.SubTotal  = SubTotalNumericUpDown.Value;
            facturas.Itbis     = ItbisNumericUpDown.Value;
            facturas.Total     = TotalNumericUpDown.Value;
            facturas.Efectivo  = EfectivoNumericUpDown.Value;
            facturas.Devuelta  = DevueltaNumericUpDown.Value;
            facturas.Detalles  = detalles;

            return(facturas);
        }
Example #9
0
        private void EliminarButton_Click(object sender, EventArgs e)
        {
            Facturas facturas = FacturasBLL.Buscar((int)IdNumericUpDown.Value);

            if (facturas != null)
            {
                FacturasBLL.Eliminar(facturas.FacturaId);
                //EliminarTotal();
                MessageBox.Show("Eliminado Correctamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                NuevoButton.PerformClick();
            }
            else
            {
                MessageBox.Show("No Se Puso Eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Example #10
0
 private void Limpiar()
 {
     facturaIdTextBox.Text                   = "0";
     fechaDataPicker.SelectedDate            = DateTime.Now;
     fechaVencimientoDatePicker.SelectedDate = DateTime.Now.AddDays(30);
     clienteComboBox.Text           = string.Empty;
     articuloComboBox.Text          = string.Empty;
     CantidadTextBox.Text           = string.Empty;
     totalLabel.Content             = 0;
     impuestoLabel.Content          = 0;
     subTotalLabel.Content          = 0;
     this.clienteComboBox.IsEnabled = true;
     this.facturasDetalles          = new List <FacturasDetalle>();
     this.facturas = new Facturas();
     this.Actualizar();
 }
Example #11
0
        public ActionResult Imprimir1(int?id)
        {
            Facturas factura = new Facturas();

            dat.Id = id;
            var actionPDF = new Rotativa.ActionAsPdf("ImprimirFactura", new { id = id }) //some route values)
            {
                //FileName = "TestView.pdf",
            };

            byte[] applicationPDFData = actionPDF.BuildFile(this.ControllerContext);
            factura.Factura = applicationPDFData;
            db.Facturas.Add(factura);
            db.SaveChanges();
            return(actionPDF);
        }
        public ActionResult Edit(Facturas facturas)
        {
            if (facturas.orden_aceptacion_numero != null)
            {
                UsuarioTO usuarioTO = Cache.DiccionarioUsuariosLogueados[User.Identity.Name];
                var       temp_fac  = db.Facturas.Find(facturas.id_factura);
                temp_fac.orden_aceptacion_numero = facturas.orden_aceptacion_numero;
                temp_fac.fecha_modificacion      = DateTime.Now;
                temp_fac.id_usuario_modificacion = usuarioTO.usuario.id_usuario;
                db.Entry(temp_fac).State         = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Details", "Facturas_Detalle", new { id = temp_fac.id_factura }));
            }

            return(View(facturas));
        }
Example #13
0
        private void EliminarBoton_Click_1(object sender, EventArgs e)
        {
            var fact = new Facturas();
            int id   = Convert.ToInt32(IdTextBox.Text);

            if (IdTextBox.Text == null)
            {
                MessageBox.Show("Dejaste el campo del ID vacio");
            }
            else
            {
                FacturasBll.Eliminar(id);
                MessageBox.Show("Factura Eliminada !");
                Limpiar();
            }
        }
Example #14
0
        public async Task <bool> UpdateAsync(Facturas model)
        {
            using (var connection = _connectionFactory.GetConnection)
            {
                var query      = "uspFacturasUpdate";
                var parameters = new DynamicParameters();

                parameters.Add("IDCliente", model.IDCliente);
                parameters.Add("IDPlan", model.IDPlan);
                parameters.Add("Valor_Plan_Actual", model.Valor_Plan_Actual);

                //Persistir la info en la bd
                var result = connection.QuerySingle <string>(query, param: parameters, commandType: System.Data.CommandType.StoredProcedure);
                return(result == "success" ? true : false);
            }
        }
Example #15
0
        public static bool Modificar(Facturas Factura)
        {
            bool     Paso     = false;
            Contexto contexto = new Contexto();
            RepositorioBase <Facturas> Repositorio = new RepositorioBase <Facturas>();
            Productos Producto = new Productos();

            try
            {
                Facturas FacturaAnterior = contexto.Facturas.Where(e => e.FacturaId == Factura.FacturaId).Include(d => d.Detalle).FirstOrDefault();

                contexto = new Contexto();
                foreach (var item in FacturaAnterior.Detalle)
                {
                    if (!Factura.Detalle.Any(d => d.DetalleFacturaId == item.DetalleFacturaId))
                    {
                        contexto.Productos.Find(item.ProductoId).Cantidad += item.Cantidad;
                        contexto.Entry(item).State = EntityState.Deleted;
                    }
                }

                foreach (var item in Factura.Detalle)
                {
                    if (item.DetalleFacturaId == 0)
                    {
                        contexto.Productos.Find(item.ProductoId).Cantidad -= item.Cantidad;
                        contexto.Entry(item).State = EntityState.Added;
                    }
                    else
                    {
                        contexto.Entry(item).State = EntityState.Modified;
                    }
                }
                contexto.Entry(Factura).State = EntityState.Modified;
                Paso = contexto.SaveChanges() > 0;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                contexto.Dispose();
            }

            return(Paso);
        }
Example #16
0
        protected void BuscarLinkButton_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                factura = FacturaRepositorio.Buscar(Utils.ToInt(FacturaIdTextBox.Text));

                if (factura != null)
                {
                    Utils.MostrarMensaje(this, "Hay Resultado", "Exito!!", "info");
                    LlenarCampos(factura);
                }
                else
                {
                    Utils.MostrarMensaje(this, "No Hay Resultado", "Fallo!!", "warning");
                }
            }
        }
        public ActionResult Create([Bind(Include = "id_factura,id_serie_factura,serie,numero_factura,id_cat_tipo_facturacion,id_razon_social,nombre_factura,nit,direccion,fecha_factura,descripcion,total,id_cat_estado_factura,fecha_cobro,fecha_pago,activo,eliminado,id_usuario_creacion,id_usuario_modificacion,id_usuario_eliminacion,fecha_creacion,fecha_modificacion,fecha_eliminacion")] Facturas facturas)
        {
            if (ModelState.IsValid)
            {
                db.Facturas.Add(facturas);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.id_usuario_creacion     = new SelectList(db.Usuarios, "id_usuario", "email", facturas.id_usuario_creacion);
            ViewBag.id_usuario_eliminacion  = new SelectList(db.Usuarios, "id_usuario", "email", facturas.id_usuario_eliminacion);
            ViewBag.id_usuario_modificacion = new SelectList(db.Usuarios, "id_usuario", "email", facturas.id_usuario_modificacion);
            ViewBag.id_cat_estado_factura   = new SelectList(db.Cat_Estados_Factura, "id_cat_estado_factura", "nombre", facturas.id_cat_estado_factura);
            ViewBag.id_serie_factura        = new SelectList(db.Series_Facturas, "id_serie_factura", "serie", facturas.id_serie_factura);
            ViewBag.id_razon_social         = new SelectList(db.Razones_Sociales, "id_razon_social", "razon_social", facturas.id_razon_social);
            return(View(facturas));
        }
        public static Facturas Buscar(int nuevoId)
        {
            Facturas ID = null;

            using (var conexion = new BeautyCoreDb())
            {
                try
                {
                    ID = conexion.Facturas.Find(nuevoId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(ID);
        }
        public static Facturas BuscarEncabezado(int?facturaId)
        {
            Facturas factura = null;

            using (var conexion = new BeautyCoreDb())
            {
                try
                {
                    factura = conexion.Facturas.Find(facturaId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(factura);
        }
        private void LlenarCampo(Facturas facturas)
        {
            //ClienteDropDownList.SelectedValue = facturas.ClienteId.ToString();
            //FacturaGridView.DataSource = facturas.Detalle;
            //FacturaGridView.DataBind();
            //MontoTextBox.Text = facturas.Total.ToString();


            ClienteDropDownList.DataSource            = repositorioProducto.GetList(x => true);
            ProductoDropDownList.DataValueField       = "ProductoId";
            ProductoDropDownList.DataTextField        = "Descripcion";
            ProductoDropDownList.AppendDataBoundItems = true;
            ProductoDropDownList.DataBind();
            FacturaGridView.DataSource = facturas.Detalle;
            FacturaGridView.DataBind();
            FiltrarPrecio();
        }
Example #21
0
        public void GuardarTest()
        {
            bool     paso     = false;
            Facturas facturas = new Facturas();

            facturas.ClienteId = 1;
            facturas.FacturaId = 2;
            facturas.Fecha     = DateTime.Now;
            facturas.ITBIS     = 108;
            facturas.SubTotal  = 500;
            facturas.Total     = 608;
            facturas.Recibido  = 1000;
            facturas.Devuelta  = 392;

            paso = FacturasBLL.Guardar(facturas);
            Assert.AreEqual(paso, true);
        }
Example #22
0
        public void ModificarTest()
        {
            bool     paso     = false;
            Facturas facturas = new Facturas();

            facturas.ClienteId = 4;
            facturas.FacturaId = 3;
            facturas.Fecha     = DateTime.Now;
            facturas.ITBIS     = 250;
            facturas.SubTotal  = 5000;
            facturas.Total     = 5250;
            facturas.Recibido  = 6000;
            facturas.Devuelta  = 750;

            paso = FacturasBLL.Modificar(facturas);
            Assert.AreEqual(paso, true);
        }
Example #23
0
        public static Facturas BuscarEncabezado(int?facturaId)
        {
            Facturas factura = null;

            using (var conexion = new DigitalServicesDB())
            {
                try
                {
                    factura = conexion.Factura.Find(facturaId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(factura);
        }
Example #24
0
        private void BuscarBtn(object sender, RoutedEventArgs e)
        {
            Facturas anterior = FacturasBLL.Buscar(int.Parse(facturaIdTextBox.Text));

            if (anterior != null)
            {
                facturas = anterior;
                this.facturasDetalles = anterior.FacturasDetalles;
                Actualizar();
                Lista();
                Calcular();
            }
            else
            {
                MessageBox.Show("No encontrado");
            }
        }
Example #25
0
        public static string PutFacturaById(string id, Facturas x)
        {
            try
            {
                x._id = ObjectId.Parse(id);
                var collection = db.GetCollection <BsonDocument>("Facturas");
                var filter     = Builders <BsonDocument> .Filter.Eq("_id", ObjectId.Parse(id));

                collection.ReplaceOne(filter, x.ToBsonDocument());

                return("Factura Actualizada");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Validar();
         Facturas factura = new Facturas();
         FechaTextBox.Text = DateTime.Now.ToString("dd/MM/yyyy");
         ObtenerDropDownList();
         if (Request.QueryString["FacturaId"] != null)
         {
             if (factura.Buscar(Validaciones.Entero(Request.QueryString["FacturaId"].ToString())))
             {
                 DevolverValores(factura);
             }
         }
     }
 }
Example #27
0
        private decimal loadItemsFactura()
        {
            DataTable dt = Facturas.getItemsFacturables(_estadia_id);

            dtgItemsFactura.DataSource = dt;
            dtgItemsFactura.Columns["consumo_id"].Visible = false;
            dtgItemsFactura.Columns["codigo"].Visible     = false;

            decimal totalFactura = 0;

            foreach (DataRow dr in dt.Rows)
            {
                totalFactura += Convert.ToDecimal(dr["total"]) * Convert.ToInt32(dr["cantidad"]);
            }

            return(totalFactura);
        }
Example #28
0
        public static Facturas Buscar(int facturaId)
        {
            Facturas factura = null;

            using (var db = new MoviesExtremeDb())
            {
                try
                {
                    factura = db.Factura.Find(facturaId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(factura);
        }
Example #29
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            var factura = new Facturas();

            if (string.IsNullOrWhiteSpace(FacturaIdTextBox.Text))
            {
                Utilidades.ShowToastr(this, "ID Vacio", "Resultados", "error");
            }
            else
            {
                int id = Utilidades.TOINT(FacturaIdTextBox.Text);

                factura = BLL.FacturasBLL.Buscar(f => f.FacturaId == id);
                if (factura != null)
                {
                    Limpiar();

                    Entidades.Clientes cli = new Clientes();
                    listaRelaciones = BLL.FacturasProductosBLL.GetList(A => A.FacturaId == factura.FacturaId);

                    if (factura != null)
                    {
                        if (listaRelaciones.Count == 0)
                        {
                            Utilidades.ShowToastr(this, "No se ha registrado Producto con este ID", "Resultados", "error");
                        }
                        else
                        {
                            LlenarRegistro(listaRelaciones);
                            ClienteIdTextBox.Text = Convert.ToString(factura.ClienteId);
                            NombreTextBox.Text    = factura.NombreCliente;
                            SubtotalTextBox.Text  = Convert.ToString(factura.SubTotal);
                            ItbisTextBox.Text     = Convert.ToString(factura.Itbis);
                            TotalTextBox.Text     = Convert.ToString(factura.Total);
                            FechaTextBox.Text     = factura.Fecha.ToString("yyyy-MM-dd");

                            Utilidades.ShowToastr(this, "Sus Resultados", "Resultados", "success");
                        }
                    }
                }
                else
                {
                    Utilidades.ShowToastr(this, "No existe factura", "Error", "error");
                }
            }
        }
Example #30
0
        public void GuardarTest()
        {
            // Assert.Fail();
            Facturas c = new Facturas();

            c.NombreCliente      = "Fernando";
            c.TipoPago           = "efectivo";
            c.Impuesto           = 18;
            c.Fecha              = DateTime.Today;
            c.MontoAdicional     = 300;
            c.SubTotal           = 500;
            c.Total              = 550;
            c.Descuento          = 25;
            c.DescuentoPorciento = 0;
            c.Comentario         = "comentario";
            Assert.IsTrue(FacturasBll.Guardar(c) != false);
        }
    protected void btnAceptar_Click(object sender, EventArgs e)
    {
        Facturas f;

        if (id == null)
        {
            f = new Facturas();
        }
        else
        {
            f = Facturas.FindFirst(Expression.Eq("Id", Int32.Parse(id)));
        }

        f.IdTipoFactura = int.Parse(cmbTipoFactura.SelectedValue);
        f.Descripcion = txtDescripcion.Text;
        f.FechaRecepcionFactura = dtFechaRecepcion.Fecha;
        f.Fecha = dtFechaFactura.Fecha;
        f.IdProveedor = int.Parse(cmbProveedor.SelectedValue);
        f.ImporteGravado = Decimal.Parse(txtImporteGravado.Text);
        f.ImporteNoGravado = Decimal.Parse(txtImporteNOGravado.Text);
        f.ImporteTotal = Decimal.Parse(txtImporteTotal.Text);
        f.MontoRetencion = Decimal.Parse("0,00"); //"falta!!!";
        if (txtPorcentajeIVa.Text == "")
        {
            f.PorcentajeIva = Decimal.Parse("0,00");
        }
        else
        { f.PorcentajeIva = Decimal.Parse(txtPorcentajeIVa.Text); }

        f.PlazoPago = txtPlazoPago.Text;
        f.IdFacturaEstados = FacturaEstados.FindFirst(Expression.Eq("Descripcion", "INGRESADO")).Id;
        f.NFactura = txtCabecera_NroFactura.Text +"-" + txtNroFactura.Text;

        f.Save();

        LimpiaForm();
    }