Ejemplo n.º 1
0
        /// <summary>
        /// 更改门店职员副表信息
        /// </summary>
        /// <param name="staffL">门店职员副表信息</param>
        public void EditEntry(ESSChannelStaff_L staffL)
        {
            ISession session = NHSessionProvider.GetCurrentSession();

            session.SaveOrUpdate(staffL);
            session.Flush();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 门店职员副表 --新增
        /// </summary>
        /// <param name="vo"></param>
        /// <returns></returns>
        public Response EntrySave(ChannelStaffLVO vo)
        {
            ESSChannelStaff_L staffL = AutoMapper.Mapper.Map <ESSChannelStaff_L>(vo);

            if (staffL != null)
            {
                Dao.SaveEntry(staffL);
                return(new Response
                {
                    Result = 1
                });
            }
            else
            {
                return(new Response
                {
                    Errcode = ExceptionHelper.DBNOTEXISTS,
                    Errmsg = "参数不合法。",
                    Result = null
                });
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 门店职员 --编辑
        /// </summary>
        /// <param name="vo"></param>
        /// <returns></returns>
        public Response Edit(ChannelStaffVO vo)
        {
            ESSChannelStaff staff = AutoMapper.Mapper.Map <ESSChannelStaff>(vo);

            var item = Dao.Detail(staff.FID);

            //NHSessionProvider.GetCurrentSession().Merge(staff);
            //NHSessionProvider.GetCurrentSession().Clear();
            if (item != null)
            {
                item.FCHANNELID  = staff.FCHANNELID;
                item.FCREATEDATE = DateTime.Now.ToLocalTime();
                item.FMODIFYDATE = DateTime.Now.ToLocalTime();
                item.FMOBILE     = staff.FMOBILE; //修改电话号码
                //item.KHNAME = staff.KHNAME;    //修改用户名称
                item.AREA     = staff.AREA;       //用户地区
                item.BIRTHDAY = staff.BIRTHDAY;   //用户生日
                item.FQQ      = staff.FQQ;        //用户QQ
                item.FTELE    = staff.FTELE;      //用户办公电话
                item.FWECHAT  = staff.FWECHAT;    //用户微信
                item.GENDER   = staff.GENDER;     //性别
                if (string.IsNullOrWhiteSpace(item.PASSWORD))
                {
                    //生成默认密码
                    byte[] saltBytes = BouncyCastleHashing.CreateSalt();
                    var    encrypt   = BouncyCastleHashing.EncryptionPassword(USER_DEFAULT_PWD, saltBytes);

                    item.SALT     = Convert.ToBase64String(saltBytes);
                    item.PASSWORD = encrypt;
                }
                else
                {
                    item.SALT     = item.SALT;
                    item.PASSWORD = item.PASSWORD;
                }
                Dao.Edit(item);
                ESSChannelStaff_L staffL = AutoMapper.Mapper.Map <ESSChannelStaff_L>(vo.ChannelStaffLVOs);
                staffL.FPKID = staff.FID;
                staffL.FNAME = staff.KHNAME;
                if (vo.FCHANNELID == 27)
                {
                    staffL.FNAME = "微信注册用户";
                }
                Dao.EditEntry(staffL);
                //EntryEdit(vo.ChannelStaffLVOs);
                //if (!string.IsNullOrWhiteSpace(staff.KHNAME))
                //{
                //    var data = new
                //    {
                //        memberPhone = staff.FMOBILE,
                //        name = staff.KHNAME
                //    };
                //    A3Service.UpdateCustomerInfo(data);
                //}
                //if (!string.IsNullOrWhiteSpace(staff.GENDER))
                //{
                //    var data = new
                //    {
                //        memberPhone = staff.FMOBILE,
                //        gender = staff.GENDER
                //    };
                //    A3Service.UpdateCustomerInfo(data);
                //}
                //if (!string.IsNullOrWhiteSpace(staff.BIRTHDAY))
                //{
                //    var data = new
                //    {
                //        memberPhone = staff.FMOBILE,
                //        birthday = staff.BIRTHDAY
                //    };
                //    A3Service.UpdateCustomerInfo(data);
                //}
                //if (!string.IsNullOrWhiteSpace(staff.AREA))
                //{
                //    var data = new
                //    {
                //        memberPhone = staff.FMOBILE,
                //        area = staff.AREA
                //    };
                //    A3Service.UpdateCustomerInfo(data);
                //}
                //if (!string.IsNullOrWhiteSpace(staff.KHTEL))
                //{
                //    var data = new
                //    {
                //        memberPhone = staff.FMOBILE,
                //        workPhone = staff.KHTEL
                //    };
                //    A3Service.UpdateCustomerInfo(data);
                //}
                return(new Response
                {
                    Result = 1
                });
            }
            else
            {
                return(new Response
                {
                    Errcode = ExceptionHelper.UNKNOWN,
                    Errmsg = "职员不存在"
                });
            }
        }