public Boolean Guardar(clsImpuesto Imp)
        {
            try
            {
                int id = getIdSiguiente();
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {

                    Impuesto impu = new Impuesto()
                    {
                        IdImpuesto = id,
                        Descripcion = Imp.Descripcion,
                        FechaRegistro = DateTime.Today, // Medio.FechaRegistro,

                        Porcentaje=Convert.ToDecimal (Imp.Porcentaje),
                        Estado = Imp.Estado,
                        IdEmpresa = Imp.IdEmpresa,
                        IdUsuario = Imp.IdUsuario,

                    };
                    ent.AddToImpuesto(impu);
                    ent.SaveChanges();
                }

                return true;

            }
            catch (Exception ex)
            {
                return false;
            }
        }
Ejemplo n.º 2
0
        public Boolean Guardar(clsImpuesto Imp)
        {
            try
            {
                int id = getIdSiguiente();
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {
                    Impuesto impu = new Impuesto()
                    {
                        IdImpuesto    = id,
                        Descripcion   = Imp.Descripcion,
                        FechaRegistro = DateTime.Today, // Medio.FechaRegistro,

                        Porcentaje = Convert.ToDecimal(Imp.Porcentaje),
                        Estado     = Imp.Estado,
                        IdEmpresa  = Imp.IdEmpresa,
                        IdUsuario  = Imp.IdUsuario,
                    };
                    ent.AddToImpuesto(impu);
                    ent.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public List <clsImpuesto> consulta()
        {
            try
            {
                List <clsImpuesto>      lista = new List <clsImpuesto>();
                CuentasPorPagarEntities ent   = new CuentasPorPagarEntities();
                var con = from w in ent.Impuesto select w;
                foreach (var item in con)
                {
                    clsImpuesto clas = new clsImpuesto();
                    clas.IdImpuesto    = item.IdImpuesto;
                    clas.Descripcion   = item.Descripcion;
                    clas.Porcentaje    = Convert.ToDouble(item.Porcentaje);
                    clas.FechaRegistro = (item.FechaRegistro);
                    clas.Estado        = item.Estado;
                    clas.IdEmpresa     = item.IdEmpresa;
                    clas.IdUsuario     = item.IdUsuario;

                    lista.Add(clas);
                }

                return(lista);
            }

            catch (Exception)
            {
                return(null);
            }
        }
        public List<clsImpuesto> consulta()
        {
            try
            {
                List<clsImpuesto > lista = new List<clsImpuesto>();
                CuentasPorPagarEntities ent = new CuentasPorPagarEntities();
                var con = from w in ent.Impuesto select w;
                foreach (var item in con)
                {
                    clsImpuesto clas = new clsImpuesto();
                    clas.IdImpuesto = item.IdImpuesto;
                    clas.Descripcion = item.Descripcion;
                     clas.Porcentaje =Convert.ToDouble (item.Porcentaje);
                    clas.FechaRegistro = (item.FechaRegistro);
                    clas.Estado = item.Estado;
                        clas.IdEmpresa = item.IdEmpresa;
                    clas.IdUsuario = item.IdUsuario;

                    lista.Add(clas);

                }

                return lista;
            }

            catch (Exception)
            {
                return null;
            }
        }
Ejemplo n.º 5
0
        public void Modificar(clsImpuesto Imp)
        {
            using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
            {
                var x = (from q in ent.Impuesto where q.IdImpuesto == Imp.IdImpuesto select q).First();

                x.Descripcion   = Imp.Descripcion;
                x.FechaRegistro = Imp.FechaRegistro;
                x.Estado        = Imp.Estado;
                x.Porcentaje    = Convert.ToDecimal(Imp.Porcentaje);
                x.IdEmpresa     = Imp.IdEmpresa;
                x.IdUsuario     = Imp.IdUsuario;
                ent.SaveChanges();
            }
        }
Ejemplo n.º 6
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            frmConsultaImpuesto fr = new frmConsultaImpuesto();

            fr.ShowDialog();

            clas                      = fr.mp;
            txtCodigo.Text            = Convert.ToString(clas.IdImpuesto);
            txtDescripcion.Text       = clas.Descripcion;
            txtPorcentaje.Text        = Convert.ToString(clas.Porcentaje);
            deFechaRegistro.EditValue = clas.FechaRegistro;
            cbxEstado.SelectedIndex   = clas.Estado;
            solo                      = clas.IdEmpresa;
            solo                      = clas.IdUsuario;
        }
Ejemplo n.º 7
0
        private void btnBuscar_Click_1(object sender, EventArgs e)
        {
            frmConsultaImpuesto Imp = new frmConsultaImpuesto();

            Imp.ShowDialog();
            clas = Imp.mp;
            if (clas.IdImpuesto == 0)
            {
                limpiar();
                txtCodigo.Text = Convert.ToString(dato.getIdSiguiente());
            }
            else
            {
                Set();
            }
        }
Ejemplo n.º 8
0
        public Boolean Eliminar(clsImpuesto Imp)
        {
            try
            {
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {
                    var x = (from q in ent.Impuesto where q.IdImpuesto == Imp.IdImpuesto select q).First();

                    ent.DeleteObject(x);

                    ent.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        public Boolean Eliminar(clsImpuesto Imp)
        {
            try
            {
                using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
                {

                    var x = (from q in ent.Impuesto where q.IdImpuesto == Imp.IdImpuesto select q).First();

                    ent.DeleteObject(x);

                    ent.SaveChanges();

                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
Ejemplo n.º 10
0
 private void btnBuscar_Click_1(object sender, EventArgs e)
 {
     frmConsultaImpuesto Imp = new frmConsultaImpuesto();
     Imp.ShowDialog();
     clas = Imp.mp;
     if (clas.IdImpuesto == 0)
     {
         limpiar();
         txtCodigo.Text = Convert.ToString(dato.getIdSiguiente());
     }
     else
     {
         Set();
     }
 }
Ejemplo n.º 11
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            frmConsultaImpuesto fr = new frmConsultaImpuesto();
            fr.ShowDialog();

            clas = fr.mp;
            txtCodigo.Text = Convert.ToString(clas.IdImpuesto);
            txtDescripcion.Text = clas.Descripcion;
            txtPorcentaje.Text = Convert.ToString(clas.Porcentaje);
            deFechaRegistro.EditValue = clas.FechaRegistro;
            cbxEstado.SelectedIndex  = clas.Estado;
            solo = clas.IdEmpresa;
            solo = clas.IdUsuario;
        }
        public void Modificar(clsImpuesto Imp)
        {
            using (CuentasPorPagarEntities ent = new CuentasPorPagarEntities())
            {
                var x = (from q in ent.Impuesto where q.IdImpuesto == Imp.IdImpuesto select q).First();

                x.Descripcion = Imp.Descripcion;
                x.FechaRegistro = Imp.FechaRegistro;
                x.Estado = Imp.Estado;
                x.Porcentaje = Convert.ToDecimal( Imp.Porcentaje);
                x.IdEmpresa = Imp.IdEmpresa;
                x.IdUsuario = Imp.IdUsuario;
                ent.SaveChanges();

            }
        }