Пример #1
0
        /// <summary>
        /// 判断应用是否有三级分销功能,用户是否为分销商
        /// </summary>
        /// <param name="cuinfo"></param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO CheckDistributorUserInfo(Jinher.AMP.BTP.Deploy.CustomDTO.UserSDTO cuinfo)
        {
            base.Do();
            Stopwatch timer = new Stopwatch();

            timer.Start();
            var result = this.CheckDistributorUserInfoExt(cuinfo);

            timer.Stop();
            LogHelper.Debug(string.Format("DistributorSV.CheckDistributorUserInfo:耗时:{0}。入参:cuinfo:{1},\r\n出参:{2}", timer.ElapsedMilliseconds, JsonHelper.JsonSerializer(cuinfo), JsonHelper.JsonSerializer(result)));
            return(result);
        }
Пример #2
0
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO CheckDistributorUserInfo(Jinher.AMP.BTP.Deploy.CustomDTO.UserSDTO cuinfo)
        {
            //定义返回值
            Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.CheckDistributorUserInfo(cuinfo);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Пример #3
0
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateUser(Jinher.AMP.BTP.Deploy.CustomDTO.UserSDTO userDTO)
        {
            //定义返回值
            Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.UpdateUser(userDTO);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Пример #4
0
 /// <summary>
 /// 更新用户信息
 /// </summary>
 /// <param name="userDTO">用户信息DTO</param>
 /// <returns></returns>
 public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateUser(Jinher.AMP.BTP.Deploy.CustomDTO.UserSDTO userDTO)
 {
     base.Do();
     return(this.Command.UpdateUser(userDTO));
 }
Пример #5
0
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="userDTO">用户信息DTO</param>
        /// <returns></returns>
        public Jinher.AMP.BTP.Deploy.CustomDTO.ResultDTO UpdateUserExt(Jinher.AMP.BTP.Deploy.CustomDTO.UserSDTO userDTO)
        {
            try
            {
                //ContextSession contextSession = ContextFactory.CurrentThreadContext;
                ////CommodityUser com = CommodityUser.ObjectSet().Where(n => n.UserId == userDTO.UserId && n.AppId == userDTO.AppId).FirstOrDefault();
                //CommodityUser com = CommodityUser.ObjectSet().Where(n => n.UserId == userDTO.UserId).FirstOrDefault();
                //if (com == null)
                //{
                //    CommodityUser commodityuser = new CommodityUser();
                //    commodityuser.Id = Guid.NewGuid();
                //    commodityuser.EntityState = System.Data.EntityState.Added;
                //    commodityuser.UserName = userDTO.UserName;
                //    commodityuser.HeadPic = userDTO.PicUrl == null ? "" : userDTO.PicUrl;
                //    commodityuser.Sex = userDTO.Sex;
                //    commodityuser.Details = userDTO.Details == null ? "": userDTO.Details;
                //    commodityuser.SubTime = DateTime.Now;
                //    commodityuser.Name = "用户信息";
                //    commodityuser.SubId = userDTO.UserId;
                //    commodityuser.UserId = userDTO.UserId;
                //    commodityuser.AppId = userDTO.AppId;
                //    commodityuser.ModifiedOn = DateTime.Now;//修改时间
                //    contextSession.SaveObject(commodityuser);
                //    contextSession.SaveChanges();
                //}
                //else
                //{
                //    com.UserName = userDTO.UserName;
                //    com.HeadPic = userDTO.PicUrl;
                //    com.Sex = userDTO.Sex;
                //    com.Details = userDTO.Details;
                //    contextSession.SaveObject(com);
                //    contextSession.SaveChanges();
                //}
                CBC.Deploy.CustomDTO.ModifyDTO userModiDTO = new CBC.Deploy.CustomDTO.ModifyDTO();
                userModiDTO.ID   = userDTO.UserId;
                userModiDTO.List = new System.Collections.Generic.List <CBC.Deploy.CustomDTO.KeyValueDTO>();
                userModiDTO.List.Add(new CBC.Deploy.CustomDTO.KeyValueDTO("Name", userDTO.UserName));
                userModiDTO.List.Add(new CBC.Deploy.CustomDTO.KeyValueDTO("HeaderIcon", userDTO.PicUrl));
                userModiDTO.List.Add(new CBC.Deploy.CustomDTO.KeyValueDTO("Gender", userDTO.Sex == 0 ? "男" : "女"));
                userModiDTO.List.Add(new CBC.Deploy.CustomDTO.KeyValueDTO("Description", userDTO.Details));

                CBC.Deploy.CustomDTO.ReturnInfoDTO resultDTO = CBCSV.Instance.UpdateUserInfoByID(userModiDTO);

                if (!resultDTO.IsSuccess)
                {
                    LogHelper.Error(string.Format("更新CBC用户服务异常。userDTO:{0},错误消息:{1}", JsonHelper.JsonSerializer(userDTO), resultDTO.Message));
                    return(new ResultDTO {
                        ResultCode = 1, Message = "Error"
                    });
                }
                else
                {
                    return(new ResultDTO {
                        ResultCode = 0, Message = "Success"
                    });
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("更新CBC用户服务异常。userDTO:{0}", JsonHelper.JsonSerializer(userDTO)), ex);
                return(new ResultDTO {
                    ResultCode = 1, Message = "Error"
                });
            }
        }