SourceCode/RFrameGenerate.BLL/NoticeManage.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFrameGenerate.Model;
using RFrameGenerate.DAL;
using RFramework.SQLServer;
using RFrameGenerate.DAL.Enums;

namespace RFrameGenerate.BLL
{
    public class NoticeManage
    {
        public static List<T_ST_Notice> GetPageList(GridModel gridModel)
        {
            using (var query = Factory.CreateT_ST_Notice())
            {
                return query.GetPageList(gridModel,null,false,b=>b.CreateDate,OrderMethods.DESC);
            }
        }

        public static Result Save(Guid? noticeGuid, string title, string content, bool isenable)
        {
            using (var query = Factory.CreateT_ST_Notice())
            {
                if (isenable == true)
                    query.Update(a => new object[] { a.IsEnable == false }, b => b.MerchantGuid == RFrameGenerate.Common.CurrentManage.MerchantGuid);

                if (noticeGuid == null)
                {
                    query.Add(new T_ST_Notice() { IsEnable = isenable, CreateDate = DateTime.Now, Content = content, Title = title, NoticeGuid = Guid.NewGuid(), MerchantGuid = RFrameGenerate.Common.CurrentManage.MerchantGuid });
                }
                else
                {
                    query.Update(a => new object[] { a.Title == title, a.Content == content, a.IsEnable == isenable }, b => b.NoticeGuid == noticeGuid);
                }
                return new Result(true);
            }
        }
        public static Result Del(Guid noticeGuid)
        {
            using (var query = Factory.CreateT_ST_Notice())
            {
                query.Delete(a => a.NoticeGuid == noticeGuid);
                return new Result(true);
            }
        }
        public static Result EnableChange(Guid noticeGuid, bool isenable)
        {
            using (var query = Factory.CreateT_ST_Notice())
            {
                if (isenable == true)
                    query.Update(a => new object[] { a.IsEnable == false }, b => b.MerchantGuid == RFrameGenerate.Common.CurrentManage.MerchantGuid);

                query.Update(a => new object[] { a.IsEnable == isenable }, b => b.NoticeGuid == noticeGuid);
                return new Result(true);
            }
        }

        /// <summary>
后面还有 22 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。