Exemple #1
0
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <param name="p_MemberNo">会员编号</param>
        /// <returns></returns>
        public static BGRBMember GetMember(string p_MemberNo)
        {
            BGRBMember m_Instance = null;

            m_Instance = GetMember(p_MemberNo, null);
            return(m_Instance);
        }
Exemple #2
0
        /// <summary>
        /// 通过登录代码和登录密码获取会员
        /// </summary>
        /// <param name="p_LoginCode">登录代码(会员卡号、会员编号、手机号)</param>
        /// <param name="p_Password">登录密码</param>
        /// <param name="p_MemberLoginType">登录方式</param>
        /// <returns>会员对象(匹配成功返回实例,失败返回null)</returns>
        private static BGRBMember GetMemberByLoginCodeAndPassword(string p_LoginCode, string p_Password, MemberLoginType p_MemberLoginType)
        {
            BGRBMember m_MemberResult = null;
            IBMemberFinder <BGRBMember, GR_Member> m_MemberFinder = BGRBMember.CreateMemberFinder();

            switch (p_MemberLoginType)
            {
            case MemberLoginType.Card:
                m_MemberResult = m_MemberFinder.GetMemberByCardNoAndPassword(p_LoginCode, p_Password);
                break;

            case MemberLoginType.Mobile:
                m_MemberResult = m_MemberFinder.GetMemberByMobileAndPassword(p_LoginCode, p_Password);
                break;

            case MemberLoginType.MemberNo:
                m_MemberResult = m_MemberFinder.GetMemberByMemberNoAndPassword(p_LoginCode, p_Password);
                break;

            default:
                break;
            }

            return(m_MemberResult);
        }
Exemple #3
0
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <returns></returns>
        public static BGRBMember CreateMember()
        {
            BGRBMember m_Instance = null;

            m_Instance = CreateMember(null);
            return(m_Instance);
        }
Exemple #4
0
        /// <summary>
        /// 修改 会员 添加兑换礼品明细
        /// </summary>
        /// <param name="p_Member">会员</param>
        /// <param name="p_ExchangeGivingTransDetail">礼品明细</param>

        public void UpdateExchangeGivingGood(BGRBMember p_Member, BGRExchangeGivingTransDetail p_ExchangeGivingTransDetail, BGRExchangeGiving m_ExchangeGiving)
        {
            DefaultDBTransactionManagement m_TransactionManagement = new DefaultDBTransactionManagement();

            m_TransactionManagement.AddTransaction(m_ExchangeGiving);
            m_TransactionManagement.AddTransaction(p_Member);
            m_TransactionManagement.AddTransaction(p_ExchangeGivingTransDetail);
            m_TransactionManagement.TransactionSave();
        }
Exemple #5
0
        public static BGRBMember BasicRegisterMember(string p_MemberName, string p_Mobile, string p_Email, string p_Sex, string p_Area, string p_RegisterType, bool p_IsTransaction, ref string p_ResultMsg)
        {
            BGRBMemberFinder m_MemberFinder = null;
            IDBManagement    m_DBManagement = new ERPDBManagement();

            #region 判断手机是否已经存在

            m_MemberFinder = BGRBMemberFinder.GetInstance(m_DBManagement);
            if (m_MemberFinder.ExistMemberMobile(p_Mobile))
            {
                p_ResultMsg = "此手机用户已经存在!";
                return(null);
            }

            #endregion

            #region 会员注册信息填充

            BGRBMemberType m_MemberType = BGRBMemberType.GetMemberType("V0", m_DBManagement);
            BGRBMember     m_Member     = BGRBMember.CreateMember(m_DBManagement);
            m_Member.Mobile         = p_Mobile;
            m_Member.MemberType     = m_MemberType.Code;
            m_Member.MemberTypeName = m_MemberType.Name;
            m_Member.Name           = p_MemberName;
            m_Member.Email          = p_Email;
            m_Member.Sex            = p_Sex;
            m_Member.Area           = p_Area;
            m_Member.Password       = p_Mobile;
            m_Member.RegisterType   = p_RegisterType;
            m_Member.InfoSourceCode = "01";
            m_Member.RegisterTime   = DateTime.Now;
            m_Member.LastLoginTime  = DateTime.Now;
            //c_TypeOrStatusFactory = ShowInfoSourceFactory.GetInstance();
            //c_Member.InfoSourceName = GetStateName(m_TempMember.InfoSourceCode);
            m_Member.RegisterSourceCode = "GRWEB";
            //c_TypeOrStatusFactory = ShowChannelSourceFactory.GetInstance();
            //c_Member.RegisterSourceName = GetStateName(m_TempMember.RegisterSourceCode);

            #endregion

            #region 数据源保存

            ReturnInfo m_MemberReturnInfo = null;
            if (p_IsTransaction)
            {
                m_MemberReturnInfo = m_Member.AddBusinessModel(false);
            }
            else
            {
                m_MemberReturnInfo = m_Member.AddBusinessModel(true);
            }

            #endregion

            return(m_Member);
        }
Exemple #6
0
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <param name="p_Entity">会员对象</param>
        /// <param name="p_DBManagement">控制器</param>
        /// <returns></returns>
        public static BGRBMember GetMember(GR_Member p_Entity, IDBManagement p_DBManagement)
        {
            BGRBMember m_Instance = null;

            if (p_Entity != null && p_DBManagement != null)
            {
                m_Instance = new BGRBMember(p_Entity, p_DBManagement);
            }
            return(m_Instance);
        }
Exemple #7
0
        /// <summary>
        /// 验证当前的登录会员的手机号码是否有效
        /// 通过则修改手机绑定状态
        /// </summary>
        /// <param name="p_LoginCode">登录代码(会员卡号、会员编号、手机号)</param>
        /// <param name="p_Password">登录密码</param>
        /// <param name="p_MemberLoginType">登录方式</param>
        /// <returns>验证是否通过(通过修改手机绑定状态)</returns>
        public static bool ValidMobile(string p_LoginCode, string p_Password, MemberLoginType p_MemberLoginType)
        {
            bool       m_Result = false;
            BGRBMember m_Member = GetMemberByLoginCodeAndPassword(p_LoginCode, p_Password, p_MemberLoginType);

            if (m_Member != null)
            {
                m_Member.IsMobileValid = true;
                m_Result = m_Member.UpdateBusinessModel(true).IsSuccess;
            }
            return(m_Result);
        }
Exemple #8
0
        /// <summary>
        /// 获取对象
        /// </summary>
        /// <param name="p_DBManagement">控制器</param>
        /// <returns></returns>
        public static BGRBMember CreateMember(IDBManagement p_DBManagement)
        {
            BGRBMember m_Instance = null;

            if (p_DBManagement == null)
            {
                p_DBManagement = new ERPDBManagement();
            }
            GR_Member m_Entity = new GR_Member();

            m_Instance = GetMember(m_Entity, p_DBManagement);
            return(m_Instance);
        }
Exemple #9
0
        /// <summary>
        /// 会员登录
        /// </summary>
        /// <param name="p_LoginCode">登录代码(会员卡号、会员编号、手机号)</param>
        /// <param name="p_Password">登录密码</param>
        /// <param name="p_MemberLoginType">登录方式</param>
        /// <returns>会员对象(成功返回实例,失败返回null)</returns>
        public static BGRBMember LoginMember(string p_LoginCode, string p_Password, MemberLoginType p_MemberLoginType)
        {
            BGRBMember m_MemberResult = null;

            m_MemberResult = GetMemberByLoginCodeAndPassword(p_LoginCode, p_Password, p_MemberLoginType);
            if (m_MemberResult != null)
            {
                m_MemberResult.LastLoginTime = DateTime.Now;
                m_MemberResult.LoginCount++;
                m_MemberResult.SaveData();
            }

            return(m_MemberResult);
        }
Exemple #10
0
        /// <summary>
        /// 获取对象根据手机号
        /// </summary>
        /// <param name="p_Mobile">手机号</param>
        /// <param name="p_DBManagement"></param>
        /// <returns></returns>
        public static BGRBMember GetMemberByMobile(string p_Mobile, IDBManagement p_DBManagement)
        {
            BGRBMember m_Instance = null;

            if (p_DBManagement == null)
            {
                p_DBManagement = new ERPDBManagement();
            }
            ObjectSet <GR_Member> m_PermissionColleciton = p_DBManagement.CurrentDBContext.CreateObjectSet <GR_Member>();
            GR_Member             m_Entity = m_PermissionColleciton.FirstOrDefault(m => m.Mobile == p_Mobile && m.State == "Y");

            if (m_Entity != null)
            {
                m_Instance = GetMember(m_Entity, p_DBManagement);
            }
            return(m_Instance);
        }
Exemple #11
0
        /// <summary>
        /// 重置用户的密码
        /// </summary>
        /// <param name="p_LoginCode">登录代码(会员卡号、会员编号、手机号)</param>
        /// <param name="p_OldPassword">旧密码</param>
        /// <param name="p_NewPassword">新密码</param>
        /// <param name="p_MemberLoginType">登录方式</param>
        /// <returns>是否重置成功</returns>
        public static bool ResetMemberPassword(string p_LoginCode, string p_OldPassword, string p_NewPassword, MemberLoginType p_MemberLoginType)
        {
            bool       m_Result = true;
            BGRBMember m_Member = GetMemberByLoginCodeAndPassword(p_LoginCode, p_OldPassword, p_MemberLoginType);

            if (m_Member != null)
            {
                m_Member.Password = p_NewPassword;
                m_Member.SaveData();
            }
            else
            {
                m_Result = false;
            }

            return(m_Result);
        }