Пример #1
0
        public IActionResult Save(cms_channel dto, int sub_channel)
        {
            dto.channel_href  = dto.channel_href ?? "";
            dto.channel_image = dto.channel_image ?? "";

            if (dto.link_type == 2)
            {
                if (sub_channel > 0)
                {
                    dto.channel_href = $"/channel/{sub_channel}";
                }
            }
            if (dto.id == 0)
            {
                dto.insert_id   = RequestHelper.AdminInfo().Id;
                dto.insert_time = DateTime.Now;
                dto             = _channelApp.Insert(dto);
            }
            else
            {
                _channelApp.Update(dto);
            }
            ChannelManagerCache.AddChannel(dto);
            return(Success("保存成功"));
        }
Пример #2
0
        public IActionResult Save(cms_channel dto)
        {
            dto.channel_href  = dto.channel_href ?? "";
            dto.channel_image = dto.channel_image ?? "";
            if (dto.id == 0)
            {
                dto.insert_id   = RequestHelper.AdminInfo().Id;
                dto.insert_time = DateTime.Now;
                _channelApp.Insert(dto);
            }
            else
            {
                _channelApp.Update(dto);
            }

            return(Success("保存成功"));
        }