コード例 #1
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetSetpointCO2()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Setpoints = new List <Clases.Objeto>();

            cnn = new SqlConnection(connectionAPIService);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarMantenedorSetpointsCO2;", cnn);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID_SETPOINT"].ToString();
                    objeto.Name = reader["SETPOINT_CO2"].ToString() + reader["SETPOINT_O2"].ToString();
                    Lista_Setpoints.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Setpoints);
        }
コード例 #2
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetMantenedorActividadesEmpresa()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Actividades = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.MantenedorActividadesEmpresa;", cnn);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID_ACTIVIDAD"].ToString();
                    objeto.Name = reader["NOMBRE_ACTIVIDAD"].ToString();
                    Lista_Actividades.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Actividades);
        }
コード例 #3
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetMantenedorDestinatariosCliente(int IdUsuario)
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Actividades = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand command = new SqlCommand("EXEC dbo.ConsultarDestinatarios @IdUsuario;", cnn);
                command.Parameters.Add("@IdUsuario", SqlDbType.Int).Value = IdUsuario;
                SqlDataReader reader = command.ExecuteReader();

                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID_DESTINATARIO"].ToString();
                    objeto.Name = reader["NOMBRE_EMPRESA"].ToString();
                    Lista_Actividades.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Actividades);
        }
コード例 #4
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetSetpointsTemperaturaServicioNuevo()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Setpoints = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarSetpointsTemperaturaNuevoServicioAlma;", cnn);
                SqlDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID"].ToString();
                    objeto.Name = reader["SETPOINT"].ToString() + "°C";
                    Lista_Setpoints.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Setpoints);
        }
コード例 #5
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetPaises()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Paises = new List <Clases.Objeto>();

            cnn = new SqlConnection(connectionAPIService);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarMantenedorPaises;", cnn);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID_PAIS"].ToString();
                    objeto.Name = reader["NOMBRE"].ToString();
                    Lista_Paises.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Paises);
        }
コード例 #6
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetNavierasServicioNuevo()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Navieras = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarNavierasNuevoServicioAlma;", cnn);
                SqlDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID"].ToString();
                    objeto.Name = reader["NAVIERA"].ToString();
                    Lista_Navieras.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Navieras);
        }
コード例 #7
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetCommoditiesMantenedor()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Commodities = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarCommoditiesMantenedor;", cnn);
                SqlDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["COMMODITY"].ToString();
                    objeto.Name = reader["COMMODITY"].ToString();
                    Lista_Commodities.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Commodities);
        }
コード例 #8
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetContenedoresServicioNuevo()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Lista_Contenedores = new List <Clases.Objeto>();

            cnn = new SqlConnection(connectionAPIService);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarContenedoresNuevoServicioAlma;", cnn);
                SqlDataReader reader  = command.ExecuteReader();

                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["CONTENEDOR"].ToString();
                    objeto.Name = reader["CONTENEDOR"].ToString();
                    Lista_Contenedores.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Lista_Contenedores);
        }
コード例 #9
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        public static List <Clases.Objeto> GetTiposSensores()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Tipos_Sensores = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarTipoSensores;", cnn);
                SqlDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID"].ToString();
                    objeto.Name = reader["SENSOR"].ToString();
                    objeto.Pic  = "image_sensor" + objeto.Code;
                    Tipos_Sensores.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Tipos_Sensores);
        }
コード例 #10
0
ファイル: MantenedorModels.cs プロジェクト: LiventusTI/Alma
        //---
        public static List <Clases.Objeto> GetPuertosServicioNuevo()
        {
            SqlConnection        cnn;
            List <Clases.Objeto> Tipos_Sensores = new List <Clases.Objeto>();

            cnn = new SqlConnection(AlmaTest);
            try
            {
                cnn.Open();
                SqlCommand    command = new SqlCommand("EXEC dbo.ConsultarMantenedorPuertos;", cnn);
                SqlDataReader reader  = command.ExecuteReader();
                while (reader.Read())
                {
                    Clases.Objeto objeto = new Clases.Objeto();
                    objeto.Code = reader["ID_PUERTOORIGEN"].ToString();
                    objeto.Name = reader["NOMBRE"].ToString();
                    Tipos_Sensores.Add(objeto);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                cnn.Close();
            }
            return(Tipos_Sensores);
        }