예제 #1
0
        public static List <DomainsBE> RetriveDominiosFromDB()
        {
            DomainsBE        item;
            List <DomainsBE> list = new List <DomainsBE>();
            var connectionString  = Common.GetCnn(Common.CnnStringNameMeucci).ConnectionString;

            using (SqlConnection cnn = new SqlConnection(connectionString))
                using (SqlCommand cmd = new SqlCommand("SELECT d.DOM_NOMBRE,d.dom_id FROM dbo.dominio d WHERE d.anulado = 0 AND d.pai_id = 1", cnn)
                {
                    CommandType = System.Data.CommandType.Text
                })
                {
                    cnn.Open();



                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            item = new DomainsBE();


                            //cue_nombre sar_nombre car_nombre usuariowindows dominio
                            item.DomainId = Convert.ToInt32(reader["dom_id"]);
                            item.Domain   = reader["DOM_NOMBRE"].ToString();
                            list.Add(item);
                        }
                    }

                    return(list);
                }
        }
예제 #2
0
        public static List <DomainsBE> RetriveDominiosFromDB()
        {
            DomainsBE        item;
            List <DomainsBE> list = new List <DomainsBE>();
            var connectionString  = CommonHelpers.GetCnn(CommonHelpers.cnnStringName_Amazon).ConnectionString;

            using (SqlConnection cnn = new SqlConnection(connectionString))

                using (SqlCommand cmd = new SqlCommand("[dbo].[Users_g]", cnn))

                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cnn.Open();



                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            item = new DomainsBE();

                            item.DomainId = Convert.ToInt32(reader["DomainId"]);
                            item.Domain   = reader["Domain"].ToString();
                            list.Add(item);
                        }
                    }

                    return(list);
                }
        }