예제 #1
0
        public ActionResult AdminEditStore(Guid id, int userId)
        {
            #region validate request
            if (!IsAdminRequestAuthorized())
            {
                return(RedirectToAction("NonAuthorized", "Error"));
            }
            #endregion

            var user = BaseAuthorServices.FindUsers(userId, null, null).FirstOrDefault();

            var store = _webStoreServices.FindStoreByUid(userId, id);

            if (user != null)
            {
                var token = new EditWebStorePageToken
                {
                    user          = user
                    , ownerUserId = user.userId
                    , store       = store
                    , mode        = store.id < 0 ? CommonEnums.ePageMode.insert : CommonEnums.ePageMode.edit
                    , title       = store.id < 0 ? "Create New WebStore" : "Edit " + store.name
                };

                return(View("AdminEditUserWebStore", token));
            }


            return(View("AdminEditUserWebStore", new EditWebStorePageToken {
                title = "User not found"
            }));
        }
예제 #2
0
        public ActionResult AdminUserWebStoreManage(int?userId)
        {
            if (!IsAdminRequestAuthorized())
            {
                return(RedirectToAction("NonAuthorized", "Error"));
            }

            if (userId == null)
            {
                return(Content("<2>UserId required</h2>"));
            }

            var user = BaseAuthorServices.FindUsers(userId, null, null).FirstOrDefault();

            if (user == null)
            {
                return(Content("<2>User Not found</h2>"));
            }

            return(View(user));
        }
예제 #3
0
        public ActionResult EditLfeStore()
        {
            #region validate request
            if (!IsAdminRequestAuthorized())
            {
                return(RedirectToAction("NonAuthorized", "Error"));
            }
            #endregion

            var user  = BaseAuthorServices.FindUsers(Constants.LFE_MAIN_STORE_OWNER_ID, null, null).FirstOrDefault();
            var store = _webStoreServices.FindStoreByTrackingId(Constants.LFE_MAIN_STORE_OWNER_ID, Constants.LFE_MAIN_STORE_TRACKING_ID);

            var token = new EditWebStorePageToken
            {
                user = user
                       // ReSharper disable once PossibleNullReferenceException
                , ownerUserId = user.userId
                , store       = store
                , mode        = store.id < 0 ? CommonEnums.ePageMode.insert : CommonEnums.ePageMode.edit
                , title       = store.id < 0 ? "Create New WebStore" : "Edit " + store.name
            };

            return(View("LfeMainStoreManage", token));
        }