예제 #1
0
        /* Método que obtiene todas las opciones / subopciones asignadas a un usuario determinado. */
        //public DsOpcion GetOpcionesMenuByUsuarioID(int usuarioID, bool esReporte)
        //{
        //    DsOpcion ds = new DsOpcion();
        //    SqlParameter pUsuarioID = new SqlParameter("@UsuarioID", Utiles.BaseDatos.IntToSql(usuarioID));
        //    SqlParameter pEsReporte = new SqlParameter("@EsReporte", (esReporte));

        //    Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "OpcionesMenuByUsuarioID", pUsuarioID, pEsReporte);
        //    return ds;
        //}

        /* Método que obtiene todas las opciones / subopciones asignadas a un usuario determinado. */
        public DsOpcion GetOpcionesMenuByUsuarioID(int usuarioID, bool esReporte)
        {
            DsOpcion ds      = new DsOpcion();
            DsOpcion dsResul = new DsOpcion();
            //SqlParameter pUsuarioID = new SqlParameter("@UsuarioID", Utiles.BaseDatos.IntToSql(usuarioID));
            SqlParameter pEsReporte = new SqlParameter("@EsReporte", (esReporte));

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.OpcionesMenu.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "OpcionesMenuByUsuarioID", pEsReporte);
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.OpcionesMenu.ToString(), ds);
            }
            else
            {
                ds = (DsOpcion)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.OpcionesMenu.ToString());
            }

            DsOpcion.DatosRow[] dr = (DsOpcion.DatosRow[])ds.Datos.Select("UsuarioID =" + usuarioID, "Descripcion");
            foreach (DsOpcion.DatosRow copyRow in dr)
            {
                dsResul.Datos.ImportRow(copyRow);
            }

            dr = null;
            return(dsResul);
        }
예제 #2
0
        public int GetAgrupacionDeLocalidad(int LocalidadID, int CodigoPostalID)
        {
            DsAgrupacionesDeLocalidades ds = new DsAgrupacionesDeLocalidades();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.AgrupacionesDeLocalidad.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "AgrupacionesDeLocalidadesALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.AgrupacionesDeLocalidad.ToString(), ds);
            }
            else
            {
                ds = (DsAgrupacionesDeLocalidades)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.AgrupacionesDeLocalidad.ToString());
            }


            DsAgrupacionesDeLocalidades.DatosRow dr = (DsAgrupacionesDeLocalidades.DatosRow)ds.Datos.Select("LocalidadID = " + LocalidadID + " AND (CodigoPostalID = " + CodigoPostalID + " OR CodigoPostalID = 0)").FirstOrDefault();
            if (dr != null && dr.LocalidadID > 0)
            {
                return(dr.CodigoPostalAgrupacionID);
            }
            else
            {
                return(0);
            }
        }
예제 #3
0
        public DsLocalidades GetLocalidadesDataSet()
        {
            DsLocalidades ds = new DsLocalidades();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Localidad.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "LocalidadesALL");
                try
                {
                    CacheDataManager.SetCacheValue(SisPack.CacheObjetos.Localidad.ToString(), ds);
                }
                catch (Exception)
                {
                }
            }
            else
            {
                try
                {
                    ds = (DsLocalidades)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Localidad.ToString());
                }
                catch (Exception)
                {
                }
            }
            return(ds);
        }
예제 #4
0
		public DsEstadosClientes GetEstadosClientesDataSet()
		{
			DsEstadosClientes ds = new DsEstadosClientes();
			if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.EstadoCliente.ToString()) == null)
			{
				Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "EstadosClientesALL");   
				CacheDataManager.SetCacheValue(SisPack.CacheObjetos.EstadoCliente.ToString(), ds);
			}
			else
				ds = (DsEstadosClientes) CacheDataManager.GetCacheValue(SisPack.CacheObjetos.EstadoCliente.ToString());
			
			return ds;
		}
예제 #5
0
        private DsDestinosFlete GetDestinosFletesDataSet()
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinosFleteALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString(), ds);
            }
            else
            {
                ds = (DsDestinosFlete)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString());
            }
            return(ds);
        }
        /*#region Consultar
         * /// <summary>
         * /// Método para consultar los datos de un método de valorizacion de tarifario.
         * /// </summary>
         * /// <returns>Retorna un booleano indicando si la valorizacion de tarifario existe.</returns>
         * public bool Consultar()
         * {
         *      //Revisar estos metodos, porque es probable que no se necesiten
         *
         *      DsValorizacionesTarifario ds = this.GetValorizacionesTarifarioDataSet();
         *      if (ds==null)
         *              return false;
         *
         *      DsValorizacionesTarifario.DatosRow[] drs =  (DsValorizacionesTarifario.DatosRow[]) ds.Datos.Select("ValorizacionTarifarioID = "+this.ValorizacionTarifarioID + " and UnidadNegocioID = "+this.UnidadNegocioID);
         *      if (drs == null)
         *              return false;
         *
         *      Cargar(drs[0]);
         *
         *      return true;
         * }
         #endregion
         *
         #region Cargar
         * /// <summary>
         * /// Método que carga los datos del DataRow leídos de la base de datos
         * /// en las properties de la clase.
         * /// </summary>
         * /// <param name="dr">Recibe como parámetro el DataRow con los datos leídos de la Base de Datos.</param>
         * public void Cargar(DataRow dr)
         * {
         *      //this.ValorizacionTarifarioDescrip = ((DsValorizacionesTarifario.DatosRow)dr).ValorizacionTarifarioDescrip;
         *      //this.UnidadNegocioID = ((DsValorizacionesTarifario.DatosRow)dr).UnidadNegocioID;
         *      this.Baja= ((DsValorizacionesTarifario.DatosRow)dr).Baja;
         * }
         #endregion
         */
        #region  GetValorizacionesTarifarioDataSet
        public DsValorizacionesTarifario GetValorizacionesTarifarioDataSet()
        {
            DsValorizacionesTarifario ds = new DsValorizacionesTarifario();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ValorizacionTarifarioUNegocio.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ValorizacionesTarifarioUNegocioALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ValorizacionTarifarioUNegocio.ToString(), ds);
            }
            else
            {
                ds = (DsValorizacionesTarifario)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ValorizacionTarifarioUNegocio.ToString());
            }
            return(ds);
        }
예제 #7
0
        /// <summary>
        /// Método para llenar el dataset de bases de cálculo.
        /// Invoca al stored procedure BasesCalculosALL.
        /// </summary>
        /// <returns>Retorna el dataset de bases de cálculo</returns>
        public DsBasesCalculos GetBasesCalculosDataSet()
        {
            DsBasesCalculos ds = new DsBasesCalculos();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.BaseCalculo.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "BasesCalculosALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.BaseCalculo.ToString(), ds);
            }
            else
            {
                ds = (DsBasesCalculos)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.BaseCalculo.ToString());
            }

            return(ds);
        }
예제 #8
0
        public DsAgenciaParada GetAgenciasParadasDataSet()
        {
            DsAgenciaParada ds = new DsAgenciaParada();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.AgenciaParadasALL.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ParadasALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.AgenciaParadasALL.ToString(), ds);
            }
            else
            {
                ds = (DsAgenciaParada)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.AgenciaParadasALL.ToString());
            }

            return(ds);
        }
예제 #9
0
        public DsCondicionesPago GetCondicionesPagoDataSet()
        {
            DsCondicionesPago ds = new DsCondicionesPago();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.CondicionPago.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "CondicionesPagoALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.CondicionPago.ToString(), ds);
            }
            else
            {
                ds = (DsCondicionesPago)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.CondicionPago.ToString());
            }

            return(ds);
        }
예제 #10
0
        public DsTiposOrigenesDestinos GetTiposOrigenesDataSet()
        {
            DsTiposOrigenesDestinos ds = new DsTiposOrigenesDestinos();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.TipoOrigenDestino.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "TipoOrigenDestinoAll");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.TipoOrigenDestino.ToString(), ds);
            }
            else
            {
                ds = (DsTiposOrigenesDestinos)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.TipoOrigenDestino.ToString());
            }

            return(ds);
        }
예제 #11
0
        /// <summary>
        /// Método que retorna un dataset completo con los topes de tarifario.
        /// </summary>
        /// <returns>Retorna un dataset del tipo DsTarifariosFleteTopes</returns>
        public DsTarifariosFleteTope GetTopesDataSet()
        {
            DsTarifariosFleteTope ds = new DsTarifariosFleteTope();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Tope.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "TopesALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.Tope.ToString(), ds);
            }
            else
            {
                ds = (DsTarifariosFleteTope)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Tope.ToString());
            }

            return(ds);
        }
예제 #12
0
        public DsConfiguracionCamposGuia GetConfiguracionCampoGuiaDataSet()
        {
            DsConfiguracionCamposGuia ds = new DsConfiguracionCamposGuia();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ConfiguracionCampoGuia.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ConfiguracionCampoGuiaALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ConfiguracionCampoGuia.ToString(), ds);
            }
            else
            {
                ds = (DsConfiguracionCamposGuia)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ConfiguracionCampoGuia.ToString());
            }

            return(ds);
        }
        /// <summary>
        /// Método para llenar el dataset de tipos de entidades comisión.
        /// Invoca al stored procedure TiposEntidadesComisionesALL.
        /// </summary>
        /// <returns>Retorna el dataset de tipos de entidades comisión</returns>
        public DsTiposEntidadesComisiones GetTiposEntidadesComisionesDataSet()
        {
            DsTiposEntidadesComisiones ds = new DsTiposEntidadesComisiones();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.TipoEntidadComision.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "TiposEntidadesComisionesALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.TipoEntidadComision.ToString(), ds);
            }
            else
            {
                ds = (DsTiposEntidadesComisiones)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.TipoEntidadComision.ToString());
            }

            return(ds);
        }
예제 #14
0
        public DsEstadosAgencias GetEstadosAgenciasDataSet()
        {
            DsEstadosAgencias ds = new DsEstadosAgencias();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.EstadoAgencia.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "EstadosAgenciasALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.EstadoAgencia.ToString(), ds);
            }
            else
            {
                ds = (DsEstadosAgencias)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.EstadoAgencia.ToString());
            }

            return(ds);
        }
        public DsMotivosHabInhabilitacion GetMotivosHabInhabilitacionDataSet()
        {
            DsMotivosHabInhabilitacion ds = new DsMotivosHabInhabilitacion();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.MotivoHabInhabilitacion.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "MotivosHabInhabilitacionesALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.MotivoHabInhabilitacion.ToString(), ds);
            }
            else
            {
                ds = (DsMotivosHabInhabilitacion)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.MotivoHabInhabilitacion.ToString());
            }

            return(ds);
        }
예제 #16
0
        public DsModalidadesEntrega GetModalidadesEntregaDataSet()
        {
            DsModalidadesEntrega ds = new DsModalidadesEntrega();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ModalidadEntrega.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ModalidadesEntregasAll");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ModalidadEntrega.ToString(), ds);
            }
            else
            {
                ds = (DsModalidadesEntrega)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ModalidadEntrega.ToString());
            }


            return(ds);
        }
예제 #17
0
        public DsParametros GetParametrosDataSet()
        {
            DsParametros ds = new DsParametros();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ParametrosUNegocio.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ParametrosUNegocioALL");
                if (CacheDataManager.Cache != null)
                {
                    CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ParametrosUNegocio.ToString(), ds);
                }
            }
            else
            {
                ds = (DsParametros)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ParametrosUNegocio.ToString());
            }

            return(ds);
        }
예제 #18
0
        /// <summary>
        /// Método para llenar el dataset de Departamentos.
        /// Invoca al stored procedure DepartamentosALL.
        /// </summary>
        /// <returns>Retorna el dataset de Departamentos</returns>
        public DsDepartamentos GetDepartamentosDataSet()
        {
            DsDepartamentos ds = new DsDepartamentos();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Departamento.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DepartamentosALL");
                try
                {
                    CacheDataManager.SetCacheValue(SisPack.CacheObjetos.Departamento.ToString(), ds);
                }
                catch (Exception)
                {
                }
            }
            else
            {
                ds = (DsDepartamentos)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.Departamento.ToString());
            }

            return(ds);
        }
예제 #19
0
        public List <ILocalidadUVenta> LlenarLstUVenta()
        {
            LstLocalidadUVenta = new List <ILocalidadUVenta>();

            // Busco los datos
            DsLocalidadUVenta ds = new DsLocalidadUVenta();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.UnidadesVentaByLocalidad.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "UnidadesVentaByLocalidadEntregaSEL");

                // Cargo los datos
                Int32?_localidadID, _codigoPostalID, _unidadVentaID;

                foreach (DsLocalidadUVenta.DatosRow dr in ds.Datos)
                {
                    if (dr.IsLocalidadIDNull() == false)
                    {
                        _localidadID = dr.LocalidadID;
                    }
                    else
                    {
                        _localidadID = null;
                    }

                    if (dr.IsCodigoPostalIDNull() == false)
                    {
                        _codigoPostalID = dr.CodigoPostalID;
                    }
                    else
                    {
                        _codigoPostalID = null;
                    }

                    if (dr.IsUnidadVentaIDNull() == false)
                    {
                        _unidadVentaID = dr.UnidadVentaID;
                    }
                    else
                    {
                        _unidadVentaID = null;
                    }

                    LstLocalidadUVenta.Add(new LocalidadUVenta()
                    {
                        LocalidadID    = _localidadID,
                        CodigoPostalID = _codigoPostalID,
                        UnidadVentaID  = _unidadVentaID,
                    });

                    //CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UnidadesVentaByLocalidad.ToString(), ds);
                }
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UnidadesVentaByLocalidad.ToString(), LstLocalidadUVenta);
            }
            else
            {
                //ds = (DsLocalidadUVenta)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.UnidadesVentaByLocalidad.ToString());
                LstLocalidadUVenta = (List <ILocalidadUVenta>)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.UnidadesVentaByLocalidad.ToString());
            }



            return(LstLocalidadUVenta);
        }