Пример #1
0
        public ActionResult DeleteLanguage(string id, string version)
        {
            var request = new LanguageViewModel { Id = id.ToGuidOrDefault(), Version = version.ToIntOrDefault() };
            var success = GetCommand<DeleteLanguageCommand>().ExecuteCommand(request);
            if (success)
            {
                if (!request.Id.HasDefaultValue())
                {
                    Messages.AddSuccess(RootGlobalization.DeleteLanguage_DeletedSuccessfully_Message);
                }
            }

            return WireJson(success);
        }
        public ActionResult SaveLanguage(LanguageViewModel model)
        {
            var success = false;
            LanguageViewModel response = null;
            if (ModelState.IsValid)
            {
                response = GetCommand<SaveLanguageCommand>().ExecuteCommand(model);
                if (response != null)
                {
                    if (model.Id.HasDefaultValue())
                    {
                        Messages.AddSuccess(RootGlobalization.CreateLanguage_CreatedSuccessfully_Message);
                    }

                    success = true;
                }
            }

            return WireJson(success, response);
        }