SourceCode/RFrameGenerate.BLL/DistributionTypeManage.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using RFrameGenerate.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RFrameGenerate.BLL
{
public class DistributionTypeManage
{
public static List<Model.T_BAS_DistributionType> GetPageList(GridModel gridModel)
{
using (var query = Factory.CreateT_BAS_DistributionType())
{
return query.GetPageList(gridModel, orderExpression: v => v.Value, orderMethod: DAL.Enums.OrderMethods.DESC);
}
}
public static Result Save(Model.T_BAS_DistributionType type)
{
if (type == null) return new Result(false, "对象属性不能为空!");
if (string.IsNullOrEmpty(type.Name)) return new Result(false, "分销分类名称不能为空!");
if (type.Value <= 0.0m) return new Result(false, "分销分类值不能小于等于0");
using (var query = Factory.CreateT_BAS_DistributionType())
{
if (type.DistributionTypeGuid == Guid.Empty)
{
type.DistributionTypeGuid = Guid.NewGuid();
type.CreateTime = DateTime.Now;
type.MerchantGuid = Common.CurrentManage.MerchantGuid;
query.Add(type);
}
else if (query.IsExist(m => m.DistributionTypeGuid == type.DistributionTypeGuid))
{
query.Update(m => new object[] { m.Name == type.Name, m.Value == type.Value }, v => v.DistributionTypeGuid == type.DistributionTypeGuid);
}
else
{
type.DistributionTypeGuid = Guid.NewGuid();
type.CreateTime = DateTime.Now;
type.MerchantGuid = Common.CurrentManage.MerchantGuid;
query.Add(type);
}
return new Result(true);
}
}
public static Result Delete(Guid id)
{
if (id == Guid.Empty) return new Result(false, "ID不能为空!");
using (var query = Factory.CreateT_BAS_DistributionType())
{
if (!query.IsExist(m => m.DistributionTypeGuid == id)) return new Result(false, "不存在分类!");
query.Delete(m => m.DistributionTypeGuid == id);
后面还有 5 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。