Пример #1
0
        /// <summary>
        /// 创建潜在分经销商
        /// </summary>
        /// <param name="loggingSessionInfo">loggingSessionInfo</param>
        /// <param name="vip_no">vip_no</param>
        public void CreatePrepRetailTrader(LoggingSessionInfo loggingSessionInfo, string vip_no)
        {
            VipEntity       vipEntity       = new VipBLL(loggingSessionInfo).GetVipDetailByVipID(vip_no);
            RetailTraderDAO retailTraderDao = new RetailTraderDAO(loggingSessionInfo);

            if (vipEntity == null || string.IsNullOrWhiteSpace(vipEntity.Col20))
            {
                return;
            }

            /// 判断当前vip会员手机号是否存在经销记录
            var entiryList = this.QueryByEntity(new RetailTraderEntity()
            {
                RetailTraderLogin = vipEntity.Phone
            }, null);

            if (entiryList != null && entiryList.Length > 0)
            {
                return;
            }

            t_unitEntity unitEntity = new t_unitBLL(loggingSessionInfo).GetMainUnit(loggingSessionInfo.ClientID);

            int RetailTraderCode = getMaxRetailTraderCode(loggingSessionInfo.ClientID);

            RetailTraderEntity pEntity = new RetailTraderEntity();

            pEntity.RetailTraderID      = Guid.NewGuid().ToString();
            pEntity.RetailTraderType    = "MultiLevelSaler";
            pEntity.RetailTraderCode    = RetailTraderCode + 1;
            pEntity.RetailTraderName    = vipEntity.VipName;
            pEntity.RetailTraderLogin   = vipEntity.Phone;
            pEntity.RetailTraderPass    = MD5Helper.Encryption("888888");
            pEntity.SalesType           = "";
            pEntity.RetailTraderMan     = "";
            pEntity.RetailTraderPhone   = vipEntity.Phone;
            pEntity.RetailTraderAddress = "";
            pEntity.CooperateType       = "";
            pEntity.SellUserID          = "";
            pEntity.UnitID = unitEntity.unit_id;

            pEntity.MultiLevelSalerFromVipId = vip_no;
            if (!string.IsNullOrEmpty(vipEntity.Col20))
            {
                pEntity.HigheRetailTraderID = vipEntity.Col20;
            }
            pEntity.CreateTime     = DateTime.Now;;
            pEntity.CreateBy       = "sys";
            pEntity.LastUpdateBy   = "sys";
            pEntity.LastUpdateTime = DateTime.Now;
            pEntity.IsDelete       = 0;
            pEntity.CustomerId     = loggingSessionInfo.ClientID;
            pEntity.Status         = "2";
            retailTraderDao.Create(pEntity);
            this.Create2Ap(pEntity);//ap库里的RetailTraderID和商户里的RetailTraderID是一样的

            new ObjectImagesBLL(loggingSessionInfo).SaveRetailTraderHeadImg(vipEntity, pEntity);

            // todo
            CommonBLL commonBll = new CommonBLL();
            string    content   = "您的帐号:" + pEntity.RetailTraderLogin + ",密码:888888,已经在连锁掌柜注册成功,请在地址http://app.chainclouds.com/download/chengguo/下载一起发码APP,早下载早成为经销商赚钱";

            JIT.CPOS.BS.Entity.WX.SendMessageEntity messageEntity = new JIT.CPOS.BS.Entity.WX.SendMessageEntity();
            messageEntity.content = content;
            messageEntity.touser  = vipEntity.WeiXinUserId;
            messageEntity.msgtype = "text";
            WApplicationInterfaceEntity[] wApplicationInterfaceEntities = new WApplicationInterfaceBLL(loggingSessionInfo).QueryByEntity(new WApplicationInterfaceEntity {
                CustomerId = loggingSessionInfo.ClientID
            }, null);
            commonBll.SendMessage(messageEntity, wApplicationInterfaceEntities[0].AppID, wApplicationInterfaceEntities[0].AppSecret, loggingSessionInfo);
        }
Пример #2
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(RetailTraderEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }