Ejemplo n.º 1
0
        public ResUsers ListUsers(ReqListUsers userdetails)
        {
            ResUsers ResUsers = new ResUsers {
                users = new List <ResUser>()
            };

            try
            {
                if (UtilityClass.IsNull(userdetails._id))
                {
                    return(ResUsers);
                }

                /*var dbuser = new MongoHelper<user>();
                 * var objUser = dbuser.Collection.Find(Query.EQ("_id", ObjectId.Parse(userdetails._id))).FirstOrDefault();
                 * if (objUser != null && objUser.canApproveUsers)
                 * {
                 *  var objUsers = dbuser.Collection.FindAll().ToList();
                 *  foreach (var user in objUsers)
                 *      if (!user.canApproveUsers)
                 *          ResUsers.users.Add(new ResUser
                 *          {
                 *              _id = user._id.ToString(),
                 *              name = user.name,
                 *              email = user.email,
                 *              phNo = user.phNo,
                 *              createdAt = UtilityClass.GetTime(user.createdAt),
                 *              isApproved = user.isApproved,
                 *              approvedAt = UtilityClass.GetTime(user.approvedAt),
                 *              approvedBy = user.approvedBy.ToString(),
                 *              canApproveUsers = user.canApproveUsers,
                 *              password=user.password,
                 *              projectIDs=new List<string>()
                 *          });
                 *
                 * }*/

                //TODO write a query to fetch list of users from database and put it in ResUsers List
            }
            catch (Exception e)
            {
                Logger.Log(userdetails._id, "UserServices", "ListUsers", e.Message);
            }
            return(ResUsers);
        }
 public ResUsers ListUsers(ReqListUsers userdetails)
 {
     return(UserServices.ListUsers(userdetails));
 }