예제 #1
0
        private void LoginStatus(bool Status)
        {
            string _MemberID = "0";

            if (!StringHelper.IsBlank(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID]))
            {
                _MemberID = Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID];
            }
            if (!StringHelper.IsBlank(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID]))
            {
                _MemberID = Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID];
            }
            try
            {
                String    filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ASMemberAspnetUsersMapEntity.FLD_NAME_MemberID, _MemberID, SQLMatchType.Equal);
                DataTable dt = FCCASPNETUserNameByMemberID.GetFacadeCreate().GetDT(long.Parse(_MemberID));
                if (dt.Rows.Count > 0)
                {
                    string         UserName = dt.Rows[0]["UserName"].ToString();
                    MembershipUser msUser   = Membership.GetUser(UserName);
                    msUser.IsApproved = Status;
                    Membership.UpdateUser(msUser);
                    if (Status == true)
                    {
                        msUser.UnlockUser();
                    }

                    MiscUtil.ShowMessage(lblMessage, "Status update sucessful.", false);
                }
            }
            catch (Exception ex)
            {
                MiscUtil.ShowMessage(lblMessage, "Status update unsucessful. " + ex.Message, true);
            }
        }
예제 #2
0
        private void LoadUserStatus()
        {
            string _MemberID = "0";

            if (!StringHelper.IsBlank(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID]))
            {
                _MemberID = Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID];
            }
            if (!StringHelper.IsBlank(Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID]))
            {
                _MemberID = Helper.Url.SecureUrl[UrlConstants.OVERVIEW_MEMBER_ID];
            }
            try
            {
                String    filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ASMemberAspnetUsersMapEntity.FLD_NAME_MemberID, _MemberID, SQLMatchType.Equal);
                DataTable dt = FCCASPNETUserNameByMemberID.GetFacadeCreate().GetDT(long.Parse(_MemberID));
                if (dt.Rows.Count > 0)
                {
                    string         UserName = dt.Rows[0]["UserName"].ToString();
                    MembershipUser msUser   = Membership.GetUser(UserName);
                    chkIsActiveLogin.Checked = msUser.IsApproved;
                }
            }
            catch (Exception ex)
            {
                MiscUtil.ShowMessage(lblMessage, ex.Message, true);
            }
        }
예제 #3
0
        public static MembershipUser GetASPNETUserByMemberID(Int64 memberID)
        {
            MembershipUser user = null;

            IList <ASPNETUserNameByMemberIDEntity> aSPNETUserNameByMemberIDEntityList = FCCASPNETUserNameByMemberID.GetFacadeCreate().GetIL(memberID);

            if (aSPNETUserNameByMemberIDEntityList != null && aSPNETUserNameByMemberIDEntityList.Count > 0)
            {
                user = Membership.GetUser(aSPNETUserNameByMemberIDEntityList[0].UserName);
            }

            return(user);
        }