Ejemplo n.º 1
0
        /// <summary>
        /// 保存版块
        /// </summary>
        /// <param name="name"></param>
        /// <param name="desc"></param>
        /// <param name="mainId"></param>
        /// <param name="topic">完成后是否跳转到发帖页面</param>
        /// <returns></returns>
        public ActionResult SaveSection(string name, string desc, int mainId, int topic)
        {
            SubSection model = new SubSection();

            model.Sectionid          = mainId;
            model.SubSectionName     = name;
            model.SectionDescription = desc;
            model.TenantId           = CurrentTenant.TenantId;
            model.CreateTime         = DateTime.Now;
            model.Creater            = CurrentUser.UserId;
            if (Request.Files != null && Request.Files.Count > 0 &&
                Request.Files[0] != null && Request.Files[0].ContentLength > 0)
            {
                var filepath = SaveFile(Request.Files[0]);
                model.FrontImage = filepath;
            }

            _bbsService.AddSubSection(model);
            #region 积分
            BusinessCommon.Integration.IntegrationManager.Instence.FireIntegrationEvent(IntegrationEvents.CreateSection,
                                                                                        CurrentUser.UserId, CurrentTenant.TenantId);
            #endregion
            if (topic == 1)
            {
                return(RedirectToAction("CreateTopic"));
            }
            return(RedirectToAction("SectionIndex", new { sectId = model.SubSectionId }));
            //return Json(new { result = 1, msg = RetechWing.LanguageResources.Common.SaveSuccess }, JsonRequestBehavior.DenyGet);
        }