示例#1
0
        //create
        public ActionResult Create() {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
                return Content("Access denied");

            var model = new AppVersion();

            return View(model);
        }
示例#2
0
        public ActionResult Create(AppVersion model, bool continueEditing) {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
                return Content("Access denied");

            if (ModelState.IsValid) {
                var appVersion = model;
                appVersion.CreateON = DateTime.Now;

                _appVersionService.Insert(appVersion);

                //activity log
                //_activityLogService.InsertActivity("AddNewAppVersion", _localizationService.GetResource("ActivityLog.AddNewAppVersion"), appVersion.Name);

                SuccessNotification(_localizationService.GetResource("Admin.Catalog.Attributes.AppVersions.Added"));
                return continueEditing ? RedirectToAction("Edit", new { id = appVersion.Id }) : RedirectToAction("List");
            }

            //If we got this far, something failed, redisplay form
            return View(model);
        }
示例#3
0
        public ActionResult Edit(AppVersion model, bool continueEditing) {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManagePlugins))
                return Content("Access denied");

            var appVersion = _appVersionService.GetById(model.Id);
            if (appVersion == null)
                //No product attribute found with the specified id
                return RedirectToAction("List");

            if (ModelState.IsValid) {
                appVersion = model;

                _appVersionService.Update(appVersion);


                //activity log
               // _activityLogService.InsertActivity("EditAppVersion", _localizationService.GetResource("ActivityLog.EditAppVersion"), appVersion.Name);

                SuccessNotification(_localizationService.GetResource("Admin.AppVersions.Updated"));
                return continueEditing ? RedirectToAction("Edit", appVersion.Id) : RedirectToAction("List");
            }

            //If we got this far, something failed, redisplay form
            return View(model);
        }
示例#4
0
        /// <summary>
        /// Deletes a appVersion
        /// </summary>
        /// <param name="appVersion">AppVersion</param>
        public virtual void Delete(AppVersion appVersion) {
            if (appVersion == null)
                throw new ArgumentNullException("appVersion");

            _appVersionRepository.Delete(appVersion);

            _signals.Trigger(APPVERSION_PATTERN_KEY);

        }