Beispiel #1
0
        public static List <Data_PushBBVA.NotificationType> NotificationType()
        {
            List <Data_PushBBVA.NotificationType> Type = new List <Data_PushBBVA.NotificationType>();

            string sql = @"SELECT * FROM NotificationType";

            using (SqlConnection conn = new SqlConnection(connectionString: conex))
            {
                try
                {
                    SqlCommand command = new SqlCommand(sql, conn);

                    conn.Open();

                    SqlDataAdapter daAdaptador = new SqlDataAdapter(command);
                    DataSet        dtDatos     = new DataSet();
                    daAdaptador.Fill(dtDatos);

                    foreach (DataRow _dr in dtDatos.Tables[0].Rows)
                    {
                        Data_PushBBVA.NotificationType types = new Data_PushBBVA.NotificationType();
                        types.idNotificationType = int.Parse(_dr["idNotificationType"].ToString());
                        types.description        = _dr["description"].ToString();
                        types.text = _dr["text"].ToString();
                        Type.Add(types);
                    }

                    return(Type);
                }
                catch (Exception ex)
                {
                    return(Type);
                }
            }
        }
Beispiel #2
0
        public static List<Data_PushBBVA.NotificationType> NotificationType()
        {
            List<Data_PushBBVA.NotificationType> Type = new List<Data_PushBBVA.NotificationType>();

            string sql = @"SELECT * FROM NotificationType";

            using (SqlConnection conn = new SqlConnection(connectionString: conex))
            {
                try
                {
                    SqlCommand command = new SqlCommand(sql, conn);

                    conn.Open();

                    SqlDataAdapter daAdaptador = new SqlDataAdapter(command);
                    DataSet dtDatos = new DataSet();
                    daAdaptador.Fill(dtDatos);

                    foreach (DataRow _dr in dtDatos.Tables[0].Rows)
                    {
                        Data_PushBBVA.NotificationType types = new Data_PushBBVA.NotificationType();
                        types.idNotificationType = int.Parse(_dr["idNotificationType"].ToString());
                        types.description = _dr["description"].ToString();
                        types.text = _dr["text"].ToString();
                        Type.Add(types);
                    }

                    return Type;

                }
                catch (Exception ex)
                {

                    return Type;
                }

            }
        }