Пример #1
0
        public ActionResult ShowMenuLang(int id)
        {
            ManageMenuLangModel model = new ManageMenuLangModel();

            try
            {
                model.MenuId    = id;
                model.Languages = LanguagesProvider.GetListLanguages();
                model.MenuInfo  = _accessRoleStore.GetMenuDetail(id);
            }
            catch (Exception ex)
            {
                this.AddNotification("Failed to get data because: " + ex.ToString(), NotificationType.ERROR);
                PartialView("_Detail", model);
            }
            return(PartialView("_Detail", model));
        }
Пример #2
0
        public ActionResult UpdateLang()
        {
            ManageMenuLangModel model = new ManageMenuLangModel();
            var id      = Utils.ConvertToInt32(Request["Id"]);
            var groupId = Utils.ConvertToInt32(Request["MenuId"]);

            if (groupId == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (id > 0)
            {
                model.IsUpdate = true;
            }

            try
            {
                model.Languages = LanguagesProvider.GetListLanguages();
                model.MenuId    = groupId;

                //Begin db transaction
                var info = _accessRoleStore.GetLangDetail(id);

                if (info != null)
                {
                    model.MenuId   = groupId;
                    model.Id       = info.Id;
                    model.LangCode = info.LangCode;
                    model.Title    = info.Title;
                }
            }
            catch (Exception ex)
            {
                this.AddNotification(NotifSettings.Error_SystemBusy, NotificationType.ERROR);

                logger.Error("Failed for Show UpdateLang form request: " + ex.ToString());
            }

            return(PartialView("../Menu/_UpdateLang", model));
        }