Пример #1
0
        public static List <Familia> GetFamiliaListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <Familia>      theList    = new List <Familia>();
            Familia             theUser    = null;
            FamiliaTableAdapter theAdapter = new FamiliaTableAdapter();

            try
            {
                FamiliaDS.FamiliaDataTable table = theAdapter.GetFamiliaForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (FamiliaDS.FamiliaRow row in table.Rows)
                    {
                        theUser = FillUserRecord(row);
                        theList.Add(theUser);
                    }
                }
            }
            catch (Exception q)
            {
                log.Error("el error ocurrio mientras obtenia la lista de la familia de la base de datos", q);
                return(null);
            }
            return(theList);
        }