//public static List<Acceso> GetAccesoById(int usuarioId, int moduloId) //{ // List<Acceso> theList = new List<Acceso>(); // Acceso theUser = null; // AccesosTableAdapter theAdapter = new AccesosTableAdapter(); // try // { // AccesoDS.AccesosDataTable table = theAdapter.GetAccesoById(usuarioId, moduloId); // if (table != null && table.Rows.Count > 0) // { // foreach (AccesoDS.AccesosRow row in table.Rows) // { // theUser = FillUserRecord(row); // theList.Add(theUser); // } // } // } // catch (Exception q) // { // log.Error("el error ocurrio mientras obtenia la lista del Area de la base de datos", q); // return null; // } // return theList; //} public static Ubicacion GetUbicaionById(Ubicacion objAcceso) { UbicacionTableAdapter localAdapter = new UbicacionTableAdapter(); if (objAcceso.UsuarioId <= 0) { return(null); } Ubicacion theUser = null; try { UbicacionDS.UbicacionDataTable table = localAdapter.GetUbicacionById(objAcceso.UsuarioId); if (table != null && table.Rows.Count > 0) { UbicacionDS.UbicacionRow row = table[0]; theUser = FillUbicacionRecord(row); } } catch (Exception q) { log.Error("Un error ocurrio mientras obtenia el Area de la base de dato", q); return(null); } return(theUser); }
private static Ubicacion FillUbicacionRecord(UbicacionDS.UbicacionRow row) { Ubicacion theNewRecord = new Ubicacion( row.ubicacionId, row.usuarioId, row.descripcion, row.latitud, row.longitud); return(theNewRecord); }