コード例 #1
0
        public static List <Delegacion> getDelegaciones(int eventoId)
        {
            List <Delegacion> ld = new List <Delegacion>();
            DBTransaction     db = new DBTransaction();
            DataTable         dt = db.GetDataView(string.Format("[acre].[vDelegaciones] where EventoId = {0}", eventoId));

            foreach (DataRow dr in dt.Rows)
            {
                Delegacion d = ConvertToDelegacion(dr);
                ld.Add(d);
            }
            return(ld);
        }
コード例 #2
0
        private static Delegacion ConvertToDelegacion(DataRow dr)
        {
            Delegacion d = new Delegacion();

            if (dr != null)
            {
                d.DelegacionId = Convert.ToInt32(dr["DelegacionId"]);
                d.Nombre       = Convert.ToString(dr["Nombre"]);
                d.NombreCorto  = Convert.ToString(dr["NombreCorto"]);
                d.EventoId     = Convert.ToInt32(dr["EventoId"]);
                d.Tipo         = Convert.ToBoolean(dr["Tipo"]);
            }
            return(d);
        }