SourceCode/RFrameGenerate.BLL/AgentApplyManage.cs

(开头部分) 4KB

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

using RFrameGenerate.Common;
using RFrameGenerate.Model;
using RFramework.SQLServer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using RFramework.SQLQuery;
namespace RFrameGenerate.BLL
{
    public class AgentApplyManage
    {
        /// <summary>
        /// 代理商申请列表(分页)
        /// </summary>
        /// <param name="gridModel"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static List<T_BAS_OpenAgentsApply> GetPageList(GridModel gridModel, string userId)
        {
            using (var query = Factory.CreateT_BAS_OpenAgentsApply())
            {
                Expression<Func<T_BAS_OpenAgentsApply, bool>> condition = m => m.UserID.SqlLike(userId);
                return query.GetPageList(gridModel, condition, true, null, DAL.Enums.OrderMethods.Default, RFramework.SQLServer.Enums.LockType.Default);
            }
        }
        /// <summary>
        /// 保存代理商申请
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public static Result Save(T_BAS_OpenAgentsApply entity)
        {
            using (var tran=new SqlRTransaction())
            {
                var query_merchant=Factory.CreateT_BAS_Merchants(tran);
                var query_openAgentsApply = Factory.CreateT_BAS_OpenAgentsApply(tran);
                var isExist = query_merchant.IsExist(a => a.UserID == entity.UserID, isFilterMerchant: false);
                if (isExist) return new Result(false, "该代理商ID已存在,请重新输入!");
                if (entity.OpenAgentsApplyGuid == null || entity.OpenAgentsApplyGuid == Guid.Empty)
                {
                    entity.OpenAgentsApplyGuid = Guid.NewGuid();
                    entity.FatherMerchantGuid = CurrentManage.MerchantGuid;
                    entity.ApplyState = DictionaryConst.AgentApplyState.Audit;
                    entity.ApplyDate = DateTime.Now;
                    entity.Password = entity.Password;
                    query_openAgentsApply.Add(entity);
                }
                else
                {
                    query_openAgentsApply.Update(a => new Object[] { 
                        a.StoreTitle==entity.StoreTitle,
                        a.Address==entity.Address,
                        a.ApplyState == DictionaryConst.AgentApplyState.Audit,
                        a.Contact==entity.Contact,
                        a.Telephone==entity.Telephone,
                        a.Remark==entity.Remark
                    }, a => a.OpenAgentsApplyGuid == entity.OpenAgentsApplyGuid);
                }
后面还有 42 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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