Ejemplo n.º 1
0
        public string Profile(int id, int mode)
        {
            UserView view = new UserView();
            Validator validator = new Validator();
            // Validate the user input here.
            if (!validator.Make(new string[] { id + "", mode + "" },
                new string[] { "required", "required" },
                new string[] { "userId", "mode" }))
            {
                return view.Error(validator.GetDetail());
            }

            return userRepo.Exists(id, mode) ?
                view.Show(userRepo.CurrentUser) :
                view.Error();
        }