Beispiel #1
0
        /// <summary>
        /// 上传图片信息
        /// </summary>
        /// <returns></returns>
        /// <author>谢锐 2014-2-5 02:26</author>
        public ActionResult UploadImageInfo()
        {
            ResultSet resultSet = new ResultSet();

            HttpPostedFileBase fileData = Request.Files[0];

            string ImageUrl = "";

            resultSet.Result = _upload.UploadImage(fileData, out ImageUrl);

            if (resultSet.Result)
            {
                resultSet.data = ImageUrl;
            }

            return Json(resultSet);
        }
Beispiel #2
0
        public ActionResult AddAuthoritiesClassfyInfo(AuthoritiesClassfyModel model)
        {
            ResultSet resultSet = new ResultSet();
            resultSet.Result = false;

            try
            {
                var authoritiesClassfyModel = new SettingsAuthorityClassify();

                authoritiesClassfyModel.Name = model.Name;

                _settingsService.InsertAuthorityClassify(authoritiesClassfyModel);

                resultSet.Result = true;
                resultSet.msg = "添加成功";
            }
            catch
            {
                resultSet.msg = "添加失败";
            }
            return Json(resultSet);
        }
Beispiel #3
0
        /// <summary>
        /// 更新一条菜单信息
        /// </summary>
        /// <param name="model">菜单信息</param>
        /// <returns>成功信息</returns>
        /// <author>谢锐 2014-3-15 00:24</author>
        public ActionResult UpdateSiteMenuInfo(SiteMenuModel model)
        {
            ResultSet resultSet = new ResultSet();

            try
            {

                var settingsSiteMenu = _settingsService.GetSiteMenuById(model.Id);

                settingsSiteMenu.Id = model.Id;
                settingsSiteMenu.Name = model.Name;
                settingsSiteMenu.ParentId = model.ParentId;
                settingsSiteMenu.SrcUrl = model.SrcUrl;
                settingsSiteMenu.ImageUrl = model.ImageUrl;
                settingsSiteMenu.Content = model.Content;

                _settingsService.UpdateSiteMenu(settingsSiteMenu);

                resultSet.Result = true;
                resultSet.msg = "成功执行";
            }
            catch
            {
                resultSet.Result = false;
                resultSet.msg = "执行失败";
            }

            return Json(resultSet);
        }
Beispiel #4
0
        /// <summary>
        /// 删除相应的菜单选项
        /// </summary>
        /// <param name="id">菜单Id</param>
        /// <returns>成功信息</returns>
        /// <author>谢锐 2014-2-11 18:26</author>
        public ActionResult DeleteMenu(long id)
        {
            ResultSet resultSet = new ResultSet();
            resultSet.Result = false;

            try
            {
                var ids = new List<long>();

                ids.Add(id);

                _settingsService.DeleteSiteMenuByIds(ids);

                resultSet.Result = true;
                resultSet.msg = "删除成功";
            }
            catch
            {
                resultSet.msg = "删除失败";
            }

            return Json(resultSet);
        }
Beispiel #5
0
        public ActionResult AddSiteMenuInfo(SiteMenuModel model)
        {
            ResultSet resultSet = new ResultSet();
            resultSet.Result = false;

            try
            {
                var siteMenuModel = new SettingsSiteMenu();

                siteMenuModel.SrcUrl = model.SrcUrl;
                siteMenuModel.Name = model.Name;
                siteMenuModel.ParentId = model.ParentId;
                siteMenuModel.ImageUrl = model.ImageUrl;
                siteMenuModel.Content = model.Content;

                _settingsService.InsertSiteMenu(siteMenuModel);

                resultSet.Result = true;
                resultSet.msg = "添加成功";
            }
            catch
            {
                resultSet.msg = "添加失败";
            }
            return Json(resultSet);
        }