Exemplo n.º 1
0
        private static AcreDelegacion ConvertToDelegacion(DataRow dr)
        {
            AcreDelegacion d = new AcreDelegacion();

            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"]);
            }
            return(d);
        }
Exemplo n.º 2
0
        public static List <AcreDelegacion> getDelegaciones(int eventoId)
        {
            List <AcreDelegacion> ld = new List <AcreDelegacion>();
            DBTransaction         db = new DBTransaction();
            DataTable             dt = db.GetDataView(string.Format("[acre].[vDelegaciones] where EventoId = {0}", eventoId));

            foreach (DataRow dr in dt.Rows)
            {
                AcreDelegacion d = ConvertToDelegacion(dr);
                ld.Add(d);
            }
            return(ld);
        }