Exemplo n.º 1
0
        public void ReadAll()
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();

            this.Datos = DALC.ExecuteStoredProcedure("READALL_VehRecolector_CON_MUNICIPIO", parametros);
        }
Exemplo n.º 2
0
        public void ReadAll_con_Municipio()
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();

            this.Datos = DALC.ExecuteStoredProcedure("READALL_GEOCERCA_CON_MUNICIPIO ", parametros);
        }
Exemplo n.º 3
0
        public void ReadAllForProcess()
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();

            this.Datos = DALC.ExecuteStoredProcedure("READALL_VehRecolector_For_PROCESSMASSIVE", parametros);
        }
Exemplo n.º 4
0
        public void ReadAll_con_Municipio_y_Geocerca()
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();

            this.Datos = DALC.ExecuteStoredProcedure("READALL_Ruta_Geo_Municipio ", parametros);
        }
Exemplo n.º 5
0
        public eeResultLogin Login(string NameUser, string Pass, string CorreoUser, string UserIP, string UserIP2, ref bool IsMismIP)
        {
            bool          UsuarioFinalizoSesionAnterior    = false;
            int           IdSesionPorFinalizarFechaUsuario = -1;
            eeResultLogin Res = eeResultLogin.UserNoExiste;

            string SQL = "READ_USER_LOGIN";
            //"SELECT * FROM TBL_BUS_Usuario WHERE UserNameLogin = '******' AND Password = '" + Pass +¿
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();
            SqlParameter  param      = new SqlParameter("@NameUser", NameUser);

            parametros.Add(param);
            string PassEncripted = Security.Seguridad.EncriptarPass(Pass);

            param = new SqlParameter("@Password", PassEncripted);
            parametros.Add(param);
            this.Datos = DALC.ExecuteStoredProcedure("USER_READ_LOGIN", parametros);
            if (this.Datos.Rows.Count == 0)
            {
                return(Res);
            }

            this.Id              = this.Datos.Rows[0]["Id"].ToString();
            this.NombreLargo     = this.Datos.Rows[0]["NombreLargo"].ToString();
            this.H2QAccess       = bool.Parse(this.Datos.Rows[0]["H2QAccess"].ToString());
            this.MunicipioAccess = bool.Parse(this.Datos.Rows[0]["MunicipioAccess"].ToString());
            this.UCivilAccess    = bool.Parse(this.Datos.Rows[0]["UCivilAccess"].ToString());

            this.ReadById();
            Res  = eeResultLogin.LoginExitoMismaIP;
            DALC = null;
            return(Res);
        }
Exemplo n.º 6
0
        public void ReadAll()
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();

            this.Datos = DALC.ExecuteStoredProcedure("READALL_GEOCERCA ", parametros);
        }
Exemplo n.º 7
0
 public void Read(string Id)
 {
     DALCSQLServer DALC = this.GetCommonDalc();
     ArrayList parametros = new ArrayList();
     SqlParameter sqlParameter1 = new SqlParameter("@Id", Id);
     parametros.Add(sqlParameter1);
     this.Datos = DALC.ExecuteStoredProcedure("READ_CAMION", parametros);
 }
Exemplo n.º 8
0
        public void Buscar(double IdClienteMunicipio)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdClienteMunicipio", IdClienteMunicipio);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READALL_Solicitud", parametros);
        }
Exemplo n.º 9
0
        public void ReadAll_Geocerca_del_Municipio(string IdClienteMunicipio)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdClienteMunicipio", IdClienteMunicipio);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READALL_GEOCERCA_BY_IDMUNICIPIO", parametros);
        }
Exemplo n.º 10
0
        internal void ReadByNombreUserMunic()
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@NombreUserMunic", this.User.UserNameLogin);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READ_CLIENTEMUNIC_BY_NOMBREUSUARIO", parametros);
        }
Exemplo n.º 11
0
        public void ReadAllByMunicipio(string IdMunicipio)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdClienteMunicipio", IdMunicipio);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READ_RUTA_BY_CLIENTE", parametros);
        }
Exemplo n.º 12
0
        public bool Read(string sIdSolicitud)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdSolicitud", sIdSolicitud);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READ_Solicitud", parametros);
            return(this.Datos.Rows.Count != 0);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Método que lee los usuarios activos y disponibles del sistema para los accesos
        /// a una Carpeta (si va -1 implica carpeta nueva)
        /// </summary>
        /// <param name="IdCarpeta"></param>
        public void ReadAllUsuariosActivosDisponiblesParaCarpeta(int IdCarpeta)
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();
            SqlParameter  param      = null;

            param = new SqlParameter("@IdCarpeta", IdCarpeta);
            parametros.Add(param);
            this.Datos = DALC.ExecuteStoredProcedure("READ_ALL_USUARIOS_DISP_PARA_CARPETA", parametros);
        }
Exemplo n.º 14
0
        internal void ReadByIdUsuario(string IdUsuario)
        {
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();
            SqlParameter  param      = new SqlParameter("@IdUsuario", IdUsuario);

            parametros.Add(param);
            this.Datos = DALC.ExecuteStoredProcedure("READ_PERSONA_BY_IDUSUARIO", parametros);
            if (this.Datos.Rows.Count == 1)
            {
                this.DREntity.ItemArray = this.Datos.Rows[0].ItemArray;
            }
        }
Exemplo n.º 15
0
        private bool ExisteRegistroFleetupDelDia(DateTime fechaComparacionCiclo, DALCSQLServer commonDalc)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@fechaComparacionCicloINI", fechaComparacionCiclo);

            parametros.Add(sqlParameter1);
            SqlParameter sqlParameter2 = new SqlParameter("@fechaComparacionCicloFIN", fechaComparacionCiclo.AddDays(1));

            parametros.Add(sqlParameter2);
            DataTable DT  = DALC.ExecuteStoredProcedure("EXIST_FleetUpRecordVehPasoGeoCerca_DELDIA", parametros);
            bool      res = (DT.Rows.Count != 0);

            return(res);
        }
Exemplo n.º 16
0
        public void ReadAll(string sIdCamion, DateTime FechaDesde, DateTime FechaHasta)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdCamion", double.Parse(sIdCamion));

            parametros.Add(sqlParameter1);
            SqlParameter sqlParameter2 = new SqlParameter("@FechaDesde", FechaDesde);

            parametros.Add(sqlParameter2);
            SqlParameter sqlParameter3 = new SqlParameter("@FechaHasta", FechaHasta);

            parametros.Add(sqlParameter3);
            this.Datos = DALC.ExecuteStoredProcedure("READALL_FleetUpRecordVehPasoGeoCerca", parametros);
        }
Exemplo n.º 17
0
        public double ReadByIdSolicitud(string sIdSolicitud)
        {
            double        res           = 0;
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdSolicitud", sIdSolicitud);

            parametros.Add(sqlParameter1);
            this.Datos = DALC.ExecuteStoredProcedure("READ_OT_BY_IDSOLICITUD", parametros);
            if (this.Datos.Rows.Count > 0)
            {
                res = double.Parse(this.Datos.Rows[0]["Id"].ToString());
            }
            return(res);
        }
Exemplo n.º 18
0
        public bool ReadCKOfUser(string ClientQueryString, ref string CK1, ref string CK2, ref string IdUser)
        {
            bool   Result = false;
            string Token  = "";

            char[]   split   = { char.Parse("=") };
            string[] arreglo = ClientQueryString.Trim().Replace("%3d", "=").Split(split);
            if (arreglo[0] == "s")
            {
                Token = arreglo[1];
            }
            //string SQL = "SELECT * FROM TBL_BUS_SesionHistory " +
            //    " WHERE Token = '" + Token + "' AND ";
            //DALCSQLServer DALC = GetCommonDalc();
            //SQL += "  FinalizaUsuario IS NULL ";

            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();
            SqlParameter  param      = null;

            param = new SqlParameter("@Token", Token);
            parametros.Add(param);
            this.Datos = DALC.ExecuteStoredProcedure("READ_CKOfUser", parametros);

            //DataTable DT = new DataTable();
            //DT = DALC.ExecuteSQLDirect(SQL);
            // if (DT.Rows.Count > 0)
            DataTable DT = new DataTable();

            DT = this.Datos;
            if (DT.Rows.Count > 0)
            {
                CK1     = DT.Rows[0]["CK1"].ToString();
                CK2     = DT.Rows[0]["CK2"].ToString();
                IdUser  = DT.Rows[0]["IdUsuario"].ToString();
                this.Id = IdUser;   //Se transmite el IdUser
                this.ReadById();    //Se lee el registro del Usuario
                Result = true;
            }
            return(Result);
        }
Exemplo n.º 19
0
        public void Buscar(string IdClienteMunicipio, DateTime dtDesde, DateTime dtHasta, string sIdRuta, string sIdCamion)
        {
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter1 = new SqlParameter("@IdClienteMunicipio", IdClienteMunicipio);

            parametros.Add(sqlParameter1);
            SqlParameter sqlParameter2 = new SqlParameter("@FechaDesde", dtDesde);

            parametros.Add(sqlParameter2);
            SqlParameter sqlParameter3 = new SqlParameter("@FechaHasta", dtHasta);

            parametros.Add(sqlParameter3);
            SqlParameter sqlParameter4 = null;

            if (sIdRuta == "-1")
            {
                sqlParameter4 = new SqlParameter("@IdRuta", DBNull.Value);
            }
            else
            {
                sqlParameter4 = new SqlParameter("@IdRuta", sIdRuta);
            }
            parametros.Add(sqlParameter4);

            SqlParameter sqlParameter5 = null;

            if (sIdCamion == "-1")
            {
                sqlParameter5 = new SqlParameter("@IdCamion", DBNull.Value);
            }
            else
            {
                sqlParameter5 = new SqlParameter("@IdCamion", sIdCamion);
            }
            parametros.Add(sqlParameter5);
            this.Datos = DALC.ExecuteStoredProcedure("READALL_OTs", parametros);
        }
Exemplo n.º 20
0
        public bool ReadById()
        {
            bool          Res        = false;
            DALCSQLServer DALC       = this.GetCommonDalc();
            ArrayList     parametros = new ArrayList();
            SqlParameter  param      = null;

            if (Id != null)
            {
                param = new SqlParameter("@Id", Id);
            }
            else
            {
                param = new SqlParameter("@Id", DREntity["Id"]);
            }
            parametros.Add(param);
            this.Datos = DALC.ExecuteStoredProcedure("USER_READ_BY_ID", parametros);
            if (this.Datos.Rows.Count > 0)
            {
                this.Id                 = this.Datos.Rows[0]["Id"].ToString();
                this.UserNameLogin      = this.Datos.Rows[0]["UserNameLogin"].ToString();
                this.NombreLargo        = this.Datos.Rows[0]["NombreLargo"].ToString();
                this.DREntity.ItemArray = this.Datos.Rows[0].ItemArray;
                this.Persona            = new Persona(this);
                this.Persona.ReadByIdUsuario(this.Id);

                ////Se leen las vigencias.
                //this.UsrVigencia.ReadVigenciasUsuario(this.Id);

                //this.Cliente.Id = this.Datos.Rows[0]["IdCliente"].ToString();
                //this.Cliente.Read();

                Res = true;
            }
            DALC = null;
            return(Res);
        }
Exemplo n.º 21
0
 /// <summary>
 /// Este método es responsable de leer y generar una tabla con los Roles como
 /// columnas y las Acciones como filas. Luego también en las celdas se identifica
 /// si está o no relacionado el par.
 /// </summary>
 public void ReadCartesianoRolesAcciones()
 {
     DALCSQLServer DALC = this.GetCommonDalc();
     ArrayList parametros = new ArrayList();
     this.Datos = DALC.ExecuteStoredProcedure("READ_ALL_RELA_ROL_SECACCION", parametros);
 }
Exemplo n.º 22
0
        private string GetTokenActivo()
        {
            string        res           = "";
            DALCSQLServer DALC          = this.GetCommonDalc();
            ArrayList     parametros    = new ArrayList();
            SqlParameter  sqlParameter5 = new SqlParameter("@FechaActual", DateTime.Now);

            parametros.Add(sqlParameter5);
            DataTable DT = DALC.ExecuteStoredProcedure("READ_FLEETUP_TOKEN_ACTIVO", parametros);

            if (DT.Rows.Count == 0)
            {
                string acctId  = ConfigurationManager.AppSettings["fleetup_acctId"].ToString();  // "21563";
                string secret  = ConfigurationManager.AppSettings["fleetup_secret"].ToString();  //"ibi2d5eqabmbxptutvnt803ba54f1u77";
                string api_key = ConfigurationManager.AppSettings["fleetup_api_key"].ToString(); //"u6KbPUKA2w1mzUvg0b2cn5A37wsg8Ecn8iKKGQhL";

                string urlGetToken = "https://api.fleetup.net/token?acctId={0}&secret={1}";
                string contentJSON = "";
                try
                {
                    //https://api.fleetup.net/token?acctId=21563&secret=ibi2d5eqabmbxptutvnt803ba54f1u77
                    urlGetToken = string.Format(urlGetToken, acctId, secret);
                    HttpWebRequest http = (HttpWebRequest)WebRequest.Create(urlGetToken);
                    http.Method = "GET";
                    http.Headers.Add("x-api-key", api_key);
                    WebResponse  response = http.GetResponse();
                    Stream       stream   = response.GetResponseStream();
                    StreamReader sr       = new StreamReader(stream);
                    contentJSON = sr.ReadToEnd();
                    var    details = JObject.Parse(contentJSON);
                    string token   = details["token"].ToString();

                    parametros = new ArrayList();
                    SqlParameter sqlParameter1 = new SqlParameter("@TokenString", token);
                    parametros.Add(sqlParameter1);
                    SqlParameter sqlParameter2 = new SqlParameter("@FechaObtencion", DateTime.Now);
                    parametros.Add(sqlParameter2);
                    SqlParameter sqlParameter3 = new SqlParameter("@FechaExpiracion", DateTime.Now.Add(new TimeSpan(1, 0, 0)));
                    parametros.Add(sqlParameter3);
                    SqlParameter sqlParameter4 = new SqlParameter("@contentJSON", contentJSON);
                    parametros.Add(sqlParameter4);
                    double IdToken = DALC.ExecuteSQLScalar("INS_FLEETUP_TOKEN", parametros);

                    parametros = new ArrayList();
                    SqlParameter sqlParameter6 = new SqlParameter("@FechaActual", DateTime.Now);
                    parametros.Add(sqlParameter6);
                    DT = DALC.ExecuteStoredProcedure("READ_FLEETUP_TOKEN_ACTIVO", parametros);
                    if (DT.Rows.Count != 0)
                    {
                        res = DT.Rows[0]["TokenString"].ToString();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                res = DT.Rows[0]["TokenString"].ToString();
            }
            return(res);
        }
Exemplo n.º 23
0
 /// <summary>
 /// Este método es responsable de leer y generar una tabla con los Roles como
 /// columnas y las Personas como filas. Luego también en las celdas se
 /// identifica si está o no relacionado el par.
 /// </summary>
 public void ReadCartesianoRolesPersonas()
 {
     DALCSQLServer DALC = this.GetCommonDalc();
     ArrayList parametros = new ArrayList();
     this.Datos = DALC.ExecuteStoredProcedure("READ_ALL_RELA_ROL_PERSONA", parametros);
 }