source/Repid.Core/Service/Basic/BasicRoleService.cs

(完整代码) 1KB

// <autogenerated>
//   This file was generated by T4 code generator ServiceText.tt.
//   Any changes made to this file manually will be lost next time the file is regenerated.
// </autogenerated>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Repid.Core.Aop;
using Repid.Entity.Basic;

namespace Repid.Core.Service.Basic
{
    public partial class BasicRoleService : OrderService<BasicRole>
    {
        public List<BasicRole> Grid(int rows, int page, out int count)
        {
            return db.BasicRole.Pager(rows, page, out count).ToList();
        }

        public ServiceResult EnableOrDisable(string id, bool bit)
        {
            BasicRole entity = db.BasicRole.Get(id);

            if (entity != null)
            {
                if (entity.IsEnabled != bit)
                {
                    entity.IsEnabled = bit;

                    db.BasicRole.Modified(entity);

                    return SaveAndResult(bit ? "启用成功!" : "禁用成功!");
                }
                else
                {
                    return FailureResult(bit ? "已经是启用状态!" : "已经是禁用状态!");
                }
            }

            return FailureResult();
        }
    }
}

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

AI 解读 AI

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

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