Example #1
0
        //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);
        }
Example #2
0
        public static List <Ubicacion> GetUbicacionListForSearch(string whereSql)
        {
            if (string.IsNullOrEmpty(whereSql))
            {
                whereSql = "1 = 1";
            }

            List <Ubicacion>      theList    = new List <Ubicacion>();
            Ubicacion             theUser    = null;
            UbicacionTableAdapter theAdapter = new UbicacionTableAdapter();

            try
            {
                UbicacionDS.UbicacionDataTable table = theAdapter.GetUbicacionForSearch(whereSql);

                if (table != null && table.Rows.Count > 0)
                {
                    foreach (UbicacionDS.UbicacionRow row in table.Rows)
                    {
                        theUser = FillUbicacionRecord(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);
        }