Exemplo n.º 1
0
        public List<clsPago> consulta(int Empresa)
        {
            try
            {
                List<clsPago> lista = new List<clsPago>();
                CuentasPorPagarEntities ent = new CuentasPorPagarEntities();
                var con = from w in ent.PagoCab where w.IdEmpresa == Empresa select w;
                foreach (var item in con)
                {
                    clsPago clas = new clsPago();
                    clas.NumPago = item.NumPago;
                    clas.FechaIngreso = item.FechaIngreso;
                    clas.NumOrdenPago = Convert.ToInt32(item.NumOrdenPago);

                    clas.TotalPagar = item.TotalPagar;
                    clas.IdUsuario = item.IdUsuario;
                    clas.IdEmpresa = item.IdEmpresa;
                    clas.IdEstado = item.Estado;
                    clas.NumComprobante = item.NumComprobante;
                    lista.Add(clas);

                }
                return lista;

            }
            catch (Exception)
            {
                return null;

            }
        }
        public List<clsPago> consultaPago()
        {
            try
            {
                List<clsPago> lista = new List<clsPago>();
                CuentasPorCobrarEntities ent = new CuentasPorCobrarEntities();
                var con = from w in ent.PagoCab select w;
                foreach (var item in con)
                {
                    clsPago pago = new clsPago();
                    pago.NumPago = item.NumPago;
                    pago.FechaIngreso = item.FechaIngreso;
                    pago.TotalPagar = Convert.ToInt32(item.TotalPagar);
                    lista.Add(pago);

                }
                return lista;

            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 3
0
        public void Modificar(clsPago Pago)
        {
            using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
            {
                var x = (from q in ent.PagoCab where q.NumPago == Pago.NumPago select q).First();
                x.NumPago = Pago.NumPago;
                x.FechaIngreso = Pago.FechaIngreso;
                x.NumOrdenPago = Pago.NumOrdenPago;

                x.TotalPagar = Pago.TotalPagar;
                x.IdUsuario = Pago.IdUsuario;
                x.IdEmpresa = Pago.IdEmpresa;
                x.Estado = Pago.IdEstado;
                x.NumComprobante = Pago.NumComprobante;
                ent.SaveChanges();

            }
        }
Exemplo n.º 4
0
        public Boolean Guardar(clsPago Pago)
        {
            try
            {
                int id = getIdSiguiente();
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {
                    PagoCab otro = new PagoCab()
                    {
                        NumPago = id,
                        FechaIngreso = Pago.FechaIngreso,
                        NumOrdenPago = Pago.NumOrdenPago,

                        TotalPagar = Pago.TotalPagar,
                        IdUsuario = Pago.IdUsuario,
                        IdEmpresa = Pago.IdEmpresa,
                        Estado = Pago.IdEstado,
                        NumComprobante = Pago.NumComprobante,
                    };
                    ent.AddToPagoCab(otro);
                    ent.SaveChanges();
                }
                return true;
            }
            catch (Exception ex)
            {
                return false;

            }
        }
Exemplo n.º 5
0
        public Boolean EliminarEstado(clsPago Pag)
        {
            try
            {
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {

                    var x = (from q in ent.PagoCab where q.NumPago == Pag.NumPago select q).First();

                    x.Estado = Pag.IdEstado;

                    ent.SaveChanges();

                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
Exemplo n.º 6
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            resultado = false;
            frmConsultaPago fre = new frmConsultaPago();
            fre.ShowDialog();
            clas = fre.Pg;
            if (clas.NumPago == 0)
            {
                limpiar();
                txtNumPago.Text = Convert.ToString(dato.getIdSiguiente());
                deFechaActual.EditValue = DateTime.Today;
            }
            else
            {
                datosPagoDetalle pgo = new datosPagoDetalle();
                set();
                cargar();

            }
        }