Exemple #1
0
        public static Familia GetFamiliaById(int IdModulo)
        {
            FamiliaTableAdapter localAdapter = new FamiliaTableAdapter();

            if (IdModulo <= 0)
            {
                return(null);
            }

            Familia theFamilia = null;

            try
            {
                FamiliaDS.FamiliaDataTable table = localAdapter.GetFamiliaById(IdModulo);

                if (table != null && table.Rows.Count > 0)
                {
                    FamiliaDS.FamiliaRow row = table[0];
                    theFamilia = FillUserRecord(row);
                }
            }
            catch (Exception q)
            {
                log.Error("Un error ocurrio mientras obtenia la familia de la base de dato", q);
                return(null);
            }

            return(theFamilia);
        }
Exemple #2
0
        private static Familia FillUserRecord(FamiliaDS.FamiliaRow row)
        {
            Familia theNewRecord = new Familia(
                row.familiaId,
                row.IsdescripcionNull() ? "" : row.descripcion,
                row.IsimagenIdNull() ? 0 : row.imagenId);

            return(theNewRecord);
        }