Esempio n. 1
0
        public override List <T> RetrieveAll <T>()
        {
            var      lstResult = SqlDao.ExecuteQueryProcedure(_mapper.GetRetrieveByallStatement());
            var      dic       = new List <Dictionary <string, object> >();
            List <T> list      = new List <T>();

            if (lstResult.Count > 0)
            {
                for (int i = 0; i < lstResult.Count; i++)
                {
                    dic.Add(lstResult[i]);
                }

                var objs = _mapper.BuildObjects(dic);

                for (int i = 0; i < lstResult.Count; i++)
                {
                    list.Add((T)Convert.ChangeType(objs[i], typeof(T)));
                }

                return(list);
            }

            return(default(List <T>));
        }
Esempio n. 2
0
        public override List <T> RetrieveAll <T>()
        {
            var lstRoles  = new List <T>();
            var lstResult = dao.ExecuteQueryProcedure(_mapper.GetRetriveAllStatement());

            if (lstResult.Count > 0)
            {
                var objs = _mapper.BuildObjects(lstResult);
                foreach (var c in objs)
                {
                    lstRoles.Add((T)Convert.ChangeType(c, typeof(T)));
                }
            }

            return(lstRoles);
        }
Esempio n. 3
0
        public List <T> RetrieveBySucursal <T>(BaseEntity entity)
        {
            var lstHorarios = new List <T>();

            var lstResult = dao.ExecuteQueryProcedure(mapper.GetRetriveBySucursalStatement(entity));
            var dic       = new Dictionary <string, object>();

            if (lstResult.Count > 0)
            {
                var objs = mapper.BuildObjects(lstResult);
                foreach (var c in objs)
                {
                    lstHorarios.Add((T)Convert.ChangeType(c, typeof(T)));
                }
            }

            return(lstHorarios);
        }