Ejemplo n.º 1
0
        public List <GruposImpuestosItems> GruposImpuestosItemsGetAll()
        {
            List <GruposImpuestosItems> lstGruposImpuestosItems = new List <GruposImpuestosItems>();

            try
            {
                ds = new DataSet();
                Conexion         oConexion = new Conexion();
                OracleConnection cn        = oConexion.getConexion();
                cn.Open();
                string sqlSelect = "select * from Grupos_Impuestos_Items ";
                cmd     = new OracleCommand(sqlSelect, cn);
                adapter = new OracleDataAdapter(cmd);
                cmd.ExecuteNonQuery();
                adapter.Fill(ds);
                DataTable dt = new DataTable();
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; dt.Rows.Count > i; i++)
                    {
                        DataRow dr = dt.Rows[i];
                        GruposImpuestosItems NewEnt = new GruposImpuestosItems();
                        NewEnt = CargarGruposImpuestosItems(dr);
                        lstGruposImpuestosItems.Add(NewEnt);
                    }
                }
                return(lstGruposImpuestosItems);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public GruposImpuestosItems GruposImpuestosItemsGetById(long Id)
 {
     try
     {
         DataSet          ds        = new DataSet();
         Conexion         oConexion = new Conexion();
         OracleConnection cn        = oConexion.getConexion();
         cn.Open();
         string sqlSelect = "SELECT * FROM Grupos_Impuestos_Items " +
                            "WHERE gii_numero=" + Id.ToString();
         cmd     = new OracleCommand(sqlSelect, cn);
         adapter = new OracleDataAdapter(cmd);
         cmd.ExecuteNonQuery();
         adapter.Fill(ds);
         DataTable dt;
         dt = ds.Tables[0];
         GruposImpuestosItems NewEnt = new GruposImpuestosItems();
         if (dt.Rows.Count > 0)
         {
             DataRow dr = dt.Rows[0];
             NewEnt = CargarGruposImpuestosItems(dr);
         }
         return(NewEnt);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
        public void CargarGrupoImpuesto(string id)
        {
            GruposImpuestosItems    oCii    = new GruposImpuestosItems();
            GruposImpuestosItemsBus oCiiBus = new GruposImpuestosItemsBus();

            oCii = oCiiBus.GruposImpuestosItemsGetById(long.Parse(id));

            TiposIva    oTii    = new TiposIva();
            TiposIvaBus oTiiBus = new TiposIvaBus();

            oTii = oTiiBus.TiposIvaGetById(oCii.tivCodigo);

            Conceptos    oCpt    = new Conceptos();
            ConceptosBus oCptBus = new ConceptosBus();

            oCpt = oCptBus.ConceptosGetById(oCii.cptNumero);

            GruposConceptosImpuestos    oGci    = new GruposConceptosImpuestos();
            GruposConceptosImpuestosBus oGciBus = new GruposConceptosImpuestosBus();

            oGci = oGciBus.GruposConceptosImpuestosGetById(oCii.gciCodigo);

            _vista.strGrupoImpuestosItems = oTii.TivCodigo + " - " + oTii.TivDescripcion +
                                            " / " + oCii.giiPorcentaje +
                                            " % / Vigencia " + oCii.giiVigenciaDesde.ToShortDateString() +
                                            " / " + oCpt.cptCodigo + " - " + oCpt.cptDescripcion +
                                            " / " + oGci.GciCodigo + " - " + oGci.GciDescripcion;
            _vista.intGiiNumero = int.Parse(id);
        }
Ejemplo n.º 4
0
        private GruposImpuestosItems CargarGruposImpuestosItems(DataRow dr)
        {
            try
            {
                GruposImpuestosItems oObjeto = new GruposImpuestosItems();
                oObjeto.giiNumero = int.Parse(dr["GII_NUMERO"].ToString());
                oObjeto.tivCodigo = dr["TIV_CODIGO"].ToString();
                if (dr["GII_PORCENTAJE"].ToString() != "")
                {
                    oObjeto.giiPorcentaje = decimal.Parse(dr["GII_PORCENTAJE"].ToString());
                }
                oObjeto.giiVigenciaDesde = DateTime.Parse(dr["GII_VIGENCIA_DESDE"].ToString());
                if (dr["GII_VIGENCIA_HASTA"].ToString() != "")
                {
                    oObjeto.giiVigenciaHasta = DateTime.Parse(dr["GII_VIGENCIA_HASTA"].ToString());
                }
                if (dr["GII_IMPORTE_MINIMO"].ToString() != "")
                {
                    oObjeto.giiImporteMinimo = decimal.Parse(dr["GII_IMPORTE_MINIMO"].ToString());
                }
                if (dr["GII_IMPORTE_FIJO"].ToString() != "")
                {
                    oObjeto.giiImporteFijo = decimal.Parse(dr["GII_IMPORTE_FIJO"].ToString());
                }
                if (dr["GII_IMPORTE_BASE_MINIMO"].ToString() != "")
                {
                    oObjeto.giiImporteBaseMinimo = decimal.Parse(dr["GII_IMPORTE_BASE_MINIMO"].ToString());
                }
                if (dr["PAI_CODIGO"].ToString() != "")
                {
                    oObjeto.paiCodigo = dr["PAI_CODIGO"].ToString();
                }
                if (dr["PRV_CODIGO"].ToString() != "")
                {
                    oObjeto.prvCodigo = dr["PRV_CODIGO"].ToString();
                }
                if (dr["LOC_NUMERO"].ToString() != "")
                {
                    oObjeto.locNumero = int.Parse(dr["LOC_NUMERO"].ToString());
                }
                oObjeto.cptNumero = long.Parse(dr["CPT_NUMERO"].ToString());
                oObjeto.gciCodigo = dr["GCI_CODIGO"].ToString();

                return(oObjeto);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
 public long GruposImpuestosItemsAdd(GruposImpuestosItems oGruposImpuestosItems)
 {
     try
     {
         Conexion         oConexion = new Conexion();
         OracleConnection cn        = oConexion.getConexion();
         cn.Open();
         // Clave Secuencia
         ds  = new DataSet();
         sql = "insert into Grupos_Impuestos_Items( GII_NUMERO," +
               " TIV_CODIGO, " +
               " GII_PORCENTAJE," +
               " GII_VIGENCIA_DESDE," +
               " GII_VIGENCIA_HASTA, " +
               " GII_IMPORTE_MINIMO, " +
               " GII_IMPORTE_FIJO, " +
               " GII_IMPORTE_BASE_MINIMO, " +
               " PAI_CODIGO, " +
               " PRV_CODIGO, " +
               " LOC_NUMERO, " +
               " CPT_NUMERO, " +
               " GCI_CODIGO) " +
               "values(pkg_secuencias.fnc_prox_secuencia('GII_NUMERO'),'"
               + oGruposImpuestosItems.tivCodigo + "', '"
               + oGruposImpuestosItems.giiPorcentaje + "', "
               + "TO_DATE('" + oGruposImpuestosItems.giiVigenciaDesde + "', 'DD/MM/YYYY HH24:MI:SS'), "
               + "TO_DATE('" + oGruposImpuestosItems.giiVigenciaHasta + "', 'DD/MM/YYYY HH24:MI:SS'), '"
               + oGruposImpuestosItems.giiImporteMinimo + "', '"
               + oGruposImpuestosItems.giiImporteFijo + "', '"
               + oGruposImpuestosItems.giiImporteBaseMinimo + "', '"
               + oGruposImpuestosItems.paiCodigo + "', '"
               + oGruposImpuestosItems.prvCodigo + "', '"
               + oGruposImpuestosItems.locNumero + "', '"
               + oGruposImpuestosItems.cptNumero + "', '"
               + oGruposImpuestosItems.gciCodigo + "')";
         Console.WriteLine("sql");
         Console.WriteLine("sql  " + sql);
         Console.WriteLine("sql");
         cmd      = new OracleCommand(sql, cn);
         adapter  = new OracleDataAdapter(cmd);
         response = cmd.ExecuteNonQuery();
         cn.Close();
         return(response);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void Inicializar()
        {
            ProvinciasBus oProvinciasBus = new ProvinciasBus();

            oUtil.CargarCombo(_vista.cmbPrsProvincia, oProvinciasBus.ProvinciasGetByFilter("ARG"), "PRV_CODIGO", "PRV_DESCRIPCION", "Seleccione Provincia");
            _vista.cmbPrsProvincia.SelectedValue = "NQ";
            LocalidadesBus oLocalidadesBus = new LocalidadesBus();

            oUtil.CargarCombo(_vista.cmbPrsLocalidad, oLocalidadesBus.LocalidadesGetByProvincia(_vista.cmbPrsProvincia.SelectedValue.ToString()), "LOC_NUMERO", "LOC_DESCRIPCION", "Seleccione Localidad");
            GruposConceptosImpuestosBus oGciBus = new GruposConceptosImpuestosBus();

            oUtil.CargarCombo(_vista.cmbGciGrupo, oGciBus.GruposConceptosImpuestosGetAllDT(), "gci_codigo", "gci_descripcion", "Seleccione Grupo");
            TiposIvaBus oTivBus = new TiposIvaBus();

            oUtil.CargarCombo(_vista.cmbTivCodigo, oTivBus.TiposIvaGetAllDT(), "tiv_codigo", "tiv_descripcion", "Seleccione un Tipo");

            if (_vista.intGiiNumero != 0)
            {
                GruposImpuestosItems    oGruposImpuestosItems    = new GruposImpuestosItems();
                GruposImpuestosItemsBus oGruposImpuestosItemsBus = new GruposImpuestosItemsBus();

                oGruposImpuestosItems             = oGruposImpuestosItemsBus.GruposImpuestosItemsGetById(_vista.intGiiNumero);
                _vista.cmbTivCodigo.SelectedValue = oGruposImpuestosItems.tivCodigo;
                _vista.decGiiPorcentaje           = oGruposImpuestosItems.giiPorcentaje;
                _vista.datGiiVigenciaDesde        = oGruposImpuestosItems.giiVigenciaDesde;
                _vista.datGiiVigenciaHasta        = oGruposImpuestosItems.giiVigenciaHasta;
                _vista.decGiiImporteMinimo        = oGruposImpuestosItems.giiImporteMinimo;
                _vista.decGiiImporteFijo          = oGruposImpuestosItems.giiImporteFijo;
                _vista.decGiiImporteBaseMinimo    = oGruposImpuestosItems.giiImporteBaseMinimo;

                _vista.logCptConcepto = oGruposImpuestosItems.cptNumero;
                if (!string.IsNullOrEmpty(oGruposImpuestosItems.cptNumero.ToString()))
                {
                    CargarConcepto(oGruposImpuestosItems.cptNumero.ToString());
                }

                if (!string.IsNullOrEmpty(oGruposImpuestosItems.locNumero.ToString()))
                {
                    Localidades oLocalidades = new Localidades();
                    oLocalidades = oLocalidadesBus.LocalidadesGetById(int.Parse(oGruposImpuestosItems.locNumero.ToString()));
                    _vista.cmbPrsProvincia.SelectedValue = oLocalidades.PrvCodigo;
                    oUtil.CargarCombo(_vista.cmbPrsLocalidad, oLocalidadesBus.LocalidadesGetByProvincia(oLocalidades.PrvCodigo), "LOC_NUMERO", "LOC_DESCRIPCION", "Seleccione Localidad");
                    _vista.cmbPrsLocalidad.SelectedValue = oGruposImpuestosItems.locNumero;
                }
                _vista.logCptConcepto            = oGruposImpuestosItems.cptNumero;
                _vista.cmbGciGrupo.SelectedValue = oGruposImpuestosItems.gciCodigo;
            }
        }
        public long Guardar()
        {
            long logResultado;
            GruposImpuestosItems    oGruposImpuestosItems    = new GruposImpuestosItems();
            GruposImpuestosItemsBus oGruposImpuestosItemsBus = new GruposImpuestosItemsBus();

            oGruposImpuestosItems.giiNumero            = _vista.intGiiNumero;
            oGruposImpuestosItems.tivCodigo            = _vista.cmbTivCodigo.SelectedValue.ToString();
            oGruposImpuestosItems.giiPorcentaje        = _vista.decGiiPorcentaje;
            oGruposImpuestosItems.giiVigenciaDesde     = _vista.datGiiVigenciaDesde;
            oGruposImpuestosItems.giiVigenciaHasta     = _vista.datGiiVigenciaHasta;
            oGruposImpuestosItems.giiImporteMinimo     = _vista.decGiiImporteMinimo;
            oGruposImpuestosItems.giiImporteFijo       = _vista.decGiiImporteFijo;
            oGruposImpuestosItems.giiImporteBaseMinimo = _vista.decGiiImporteBaseMinimo;
            oGruposImpuestosItems.cptNumero            = _vista.logCptConcepto;
            oGruposImpuestosItems.gciCodigo            = _vista.cmbGciGrupo.SelectedValue.ToString();

            if (int.Parse(_vista.cmbPrsLocalidad.SelectedValue.ToString()) > 0)
            {
                oGruposImpuestosItems.locNumero = int.Parse(_vista.cmbPrsLocalidad.SelectedValue.ToString());
                oGruposImpuestosItems.prvCodigo = _vista.cmbPrsProvincia.SelectedValue.ToString();
                oGruposImpuestosItems.paiCodigo = "ARG";
            }

            if (_vista.intGiiNumero == 0)
            {
                logResultado = oGruposImpuestosItemsBus.GruposImpuestosItemsAdd(oGruposImpuestosItems);
                Console.WriteLine("El numero de grupo creado " + logResultado);
                return(logResultado);
            }
            else
            {
                logResultado = (oGruposImpuestosItemsBus.GruposImpuestosItemsUpdate(oGruposImpuestosItems)) ? oGruposImpuestosItems.giiNumero : 0;
                return(logResultado);
            }
        }
Ejemplo n.º 8
0
 public bool GruposImpuestosItemsUpdate(GruposImpuestosItems oGruposImpuestosItems)
 {
     try
     {
         Conexion         oConexion = new Conexion();
         OracleConnection cn        = oConexion.getConexion();
         cn.Open();
         ds  = new DataSet();
         sql = "update Grupos_Impuestos_Items SET " +
               "TIV_CODIGO='" + oGruposImpuestosItems.tivCodigo + "'," +
               "GII_PORCENTAJE='" + oGruposImpuestosItems.giiPorcentaje + "'," +
               "GII_VIGENCIA_DESDE=TO_DATE('" + oGruposImpuestosItems.giiVigenciaDesde + "', 'DD/MM/YYYY HH24:MI:SS'), " +
               "GII_VIGENCIA_HASTA=TO_DATE('" + oGruposImpuestosItems.giiVigenciaHasta + "', 'DD/MM/YYYY HH24:MI:SS'), " +
               "GII_IMPORTE_MINIMO='" + oGruposImpuestosItems.giiImporteMinimo + "'," +
               "GII_IMPORTE_FIJO='" + oGruposImpuestosItems.giiImporteFijo + "'," +
               "GII_IMPORTE_BASE_MINIMO='" + oGruposImpuestosItems.giiImporteBaseMinimo + "'," +
               "PAI_CODIGO='" + oGruposImpuestosItems.paiCodigo + "', " +
               "PRV_CODIGO='" + oGruposImpuestosItems.prvCodigo + "'," +
               "LOC_NUMERO='" + oGruposImpuestosItems.locNumero + "'," +
               "CPT_NUMERO='" + oGruposImpuestosItems.cptNumero + "'," +
               "GCI_CODIGO='" + oGruposImpuestosItems.gciCodigo + "' " +
               "WHERE GII_NUMERO='" + oGruposImpuestosItems.giiNumero + "' ";
         Console.WriteLine("sql");
         Console.WriteLine("sql  " + sql);
         Console.WriteLine("sql");
         cmd      = new OracleCommand(sql, cn);
         adapter  = new OracleDataAdapter(cmd);
         response = cmd.ExecuteNonQuery();
         cn.Close();
         return(response > 0);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 9
0
        public bool GruposImpuestosItemsUpdate(GruposImpuestosItems oGruposImpuestosItems)
        {
            GruposImpuestosItemsImpl oGruposImpuestosItemsImpl = new GruposImpuestosItemsImpl();

            return(oGruposImpuestosItemsImpl.GruposImpuestosItemsUpdate(oGruposImpuestosItems));
        }
Ejemplo n.º 10
0
        public long GruposImpuestosItemsAdd(GruposImpuestosItems oGruposImpuestosItems)
        {
            GruposImpuestosItemsImpl oGruposImpuestosItemsImpl = new GruposImpuestosItemsImpl();

            return(oGruposImpuestosItemsImpl.GruposImpuestosItemsAdd(oGruposImpuestosItems));
        }