Exemple #1
0
        // GET: Login
        public ActionResult Index(string uid = "")
        {
            UIUserInfo uiUserInfo = null;

            if (string.IsNullOrEmpty(uid))
            {
                return(View(uiUserInfo));
            }

            var result = UserInfoBo.GetUserInfoByUID(uid.ConvertToPlainLong());

            if (result.IsSuccess)
            {
                BizUserInfo bizUserInfo = result.Target as BizUserInfo;
                if (bizUserInfo == null || bizUserInfo.UserInfoID == 0)
                {
                    return(View(uiUserInfo));
                }
                uiUserInfo           = new UIUserInfo();
                uiUserInfo.UserEmail = bizUserInfo.UserEmail;
                uiUserInfo.UserName  = bizUserInfo.UserName;
                uiUserInfo.LoginName = bizUserInfo.UserLoginName;
            }
            return(View(uiUserInfo));
        }
Exemple #2
0
        public ActionResult ModifyPasswordIndex()
        {
            UIUserInfo uiUserInfo = null;

            if (!UILoginHelper.CheckUserLogin(HttpContext))
            {
                return(View(uiUserInfo));
            }

            var result = UserInfoBo.GetUserInfoByLoginNameOrEmail(UILoginHelper.GetUIUserLoginNameOrEmail(HttpContext));

            if (result.IsSuccess)
            {
                var bizUserInfo = result.Target as BizUserInfo;
                if (bizUserInfo == null || bizUserInfo.UserInfoID == 0)
                {
                    return(View(uiUserInfo));
                }
                uiUserInfo                 = new UIUserInfo();
                uiUserInfo.UserEmail       = bizUserInfo.UserEmail;
                uiUserInfo.UserName        = bizUserInfo.UserName;
                uiUserInfo.LoginName       = bizUserInfo.UserLoginName;
                uiUserInfo.Phone           = bizUserInfo.UserPhone;
                uiUserInfo.LoginName       = bizUserInfo.UserLoginName;
                uiUserInfo.QQ              = bizUserInfo.UserQQ;
                uiUserInfo.UserInfoComment = bizUserInfo.UserInfoComment;
                uiUserInfo.UserImagURL     = bizUserInfo.UserImagURL;
            }
            return(View(uiUserInfo));
        }
Exemple #3
0
        public ActionResult RegisterUser(UIUserInfo uiUserInfo)
        {
            var bizUserInfo = new BizUserInfo();

            bizUserInfo.UserEmail       = uiUserInfo.UserEmail;
            bizUserInfo.UserLoginName   = uiUserInfo.UserEmail;
            bizUserInfo.UserName        = uiUserInfo.UserName;
            bizUserInfo.UserPassword    = uiUserInfo.Password;
            bizUserInfo.UserPhone       = uiUserInfo.Phone;
            bizUserInfo.UserQQ          = uiUserInfo.QQ;
            bizUserInfo.UserInfoComment = uiUserInfo.UserInfoComment;
            string token = (uiUserInfo.UserEmail + uiUserInfo.UserName).ConvertToCiphertext();

            bizUserInfo.ActivateAccountToken = token;
            bizUserInfo.AccountStatus        = 0;
            var result = UserInfoBo.RegisterUser(bizUserInfo);

            if (result.IsSuccess)
            {
                var       activateAccountEmailContent = BizConfigurationInfo.LoadByKey(Conts.ActivateAccountEmailContentKey).ConfigurationValue;
                EmailInfo activateAccountEmail        = new EmailInfo();
                activateAccountEmail.Receiver = uiUserInfo.UserEmail;
                activateAccountEmail.Subject  = "激活WebBookmark账号";
                activateAccountEmail.Body     = string.Format(activateAccountEmailContent, token, token);
                activateAccountEmail.Send();
            }
            return(Json(result));
        }
Exemple #4
0
        public ActionResult UserLogin(UIUserInfo uiUserInfo)
        {
            string logionName = string.IsNullOrEmpty(uiUserInfo.LoginName) ? uiUserInfo.UserEmail : uiUserInfo.LoginName;
            var    rsp        = UserInfoBo.UserLogin(logionName, uiUserInfo.Password);

            if (rsp.IsSuccess)
            {
                UILoginHelper.WriteUserInfo(rsp.ResultID, logionName, uiUserInfo.Password, HttpContext);
            }
            return(Json(rsp));
        }
Exemple #5
0
    /// <summary>
    /// <para>name : Init</para>
    /// <para>describe : 유저 정보 HUD를 생성하고, parent 밑에 붙입니다. parent가 null값일 시, Active가 꺼진 상태가 됩니다.</para>
    /// <para>tag : [email protected]</para>
    /// </summary>
    public void Init(Transform parent)
    {
        if (m_uiUserInfo == null || m_uiUserInfo.CheckUIUserInfoExists == false)
        {
            m_uiUserInfo = new UIUserInfo(Instantiate(AssetBundleEx.Load <GameObject>(USERINFO_PATH)) as GameObject);
        }

        m_uiUserInfo.Init(parent);

        InitUIDogLevelUp();
    }
Exemple #6
0
    /// <summary>
    /// <para>name : AddExtraUserInfo</para>
    /// <para>describe : 메인 재화 HUD와 별개로, 따로 표시와 업데이트가 가능한 재화 HUD를 생성하고, parent 밑에 붙입니다.
    ///                      (주의!) 이 HUD 오브젝트는 리턴받은 UIUserInfo로 따로 관리해주세요. UserInfo.Instance로 관리되지 않습니다!
    /// <para>tag : [email protected]</para>
    /// </summary>
    public UIUserInfo AddExtraUserInfo(Transform parent, bool isUser = true)
    {
        UIUserInfo uiUserInfo = null;

        #region Instantiate
        uiUserInfo = new UIUserInfo(Instantiate(AssetBundleEx.Load <GameObject>(USERINFO_PATH)) as GameObject);
        #endregion

        #region InitUserInfo
        uiUserInfo.Init(parent);
        uiUserInfo.UpdateInfo(isUser);
        #endregion

        return(uiUserInfo);
    }
    public UIUser(Transform _trans, int _type)
    {
        trans = _trans;
        obj   = _trans.gameObject;

        handsRoot  = trans.Find("handsPoker");
        lastRoot   = trans.Find("lastPoker");
        posType    = (PokerPosType)_type;
        handsPoker = new PokerListManage(handsRoot, posType);
        lastPoker  = new PokerListManage(lastRoot, posType);
        info       = new UIUserInfo(trans.Find("info"));
        time       = trans.Find("time");
        txt_time   = time.Find("Text").GetComponent <Text> ();
        time.gameObject.SetActive(false);
        txt_time.text = "";
    }
Exemple #8
0
        public ActionResult ShowBookmarkComment(long bookmarkID)
        {
            var lstBookmarkComment = BizBookmarkComment.LoadByBookmarkInfoID(bookmarkID);

            var loginUserInfo = BizUserInfo.LoadByUserInfoID(UILoginHelper.GetUIDFromHttpContext(HttpContext));

            UIUserInfo uiLoginUserInfo = new UIUserInfo()
            {
                UserName    = loginUserInfo.UserName,
                UserInfoID  = loginUserInfo.UserInfoID,
                UserImagURL = loginUserInfo.UserImagURL,
                UserEmail   = loginUserInfo.UserEmail,
            };

            var lstUserID   = lstBookmarkComment.Select(model => model.CriticsUserID).Distinct().ToList();
            var dicUserInfo = UserInfoBo.GetListByUIDList(lstUserID).ToDictionary(model => model.UserInfoID, model => model);

            IEnumerable <UICommentInfo> lstComment = new List <UICommentInfo>();

            lstComment = lstBookmarkComment.Select(model => new UICommentInfo()
            {
                BookmarkUserID  = model.BookmarkUserID,
                CommentContent  = model.CommentContent,
                CommentTitle    = model.CommentTitle,
                CommentID       = model.BookmarkCommentID,
                CreateTime      = model.CreateTime,
                CriticsUserID   = model.CriticsUserID,
                InfoID          = model.BookmarkInfoID,
                InfoType        = UICommentType.Bookmark,
                CriticsUserInfo = dicUserInfo.ContainsKey(model.CriticsUserID) ?  new UIUserInfo()
                {
                    UserName    = dicUserInfo[model.CriticsUserID].UserName,
                    UserEmail   = dicUserInfo[model.CriticsUserID].UserEmail,
                    UserImagURL = dicUserInfo[model.CriticsUserID].UserImagURL,
                    UserInfoID  = dicUserInfo[model.CriticsUserID].UserInfoID,
                }:new UIUserInfo(),
            });


            return(PartialView("ShowBookmarkComment", Tuple.Create <IEnumerable <UICommentInfo>, UIUserInfo>(lstComment, uiLoginUserInfo)));
        }
Exemple #9
0
        private BizResultInfo SaveUserToDB(String loginEmail, UIUserInfo uiUserInfo)
        {
            var result = UserInfoBo.GetUserInfoByLoginNameOrEmail(loginEmail);

            if (result.IsSuccess)
            {
                var userInfo = result.Target as BizUserInfo;
                userInfo.UserEmail       = uiUserInfo.UserEmail;
                userInfo.UserInfoComment = uiUserInfo.UserInfoComment;
                userInfo.UserName        = uiUserInfo.UserName;
                userInfo.UserQQ          = uiUserInfo.QQ;
                userInfo.UserPhone       = uiUserInfo.Phone;
                userInfo.UserLoginName   = uiUserInfo.LoginName;
                userInfo.Save();
                result.IsSuccess      = true;
                result.SuccessMessage = "保存成功了耶,你可以去别的地方玩了。";
            }
            else
            {
                result.IsSuccess    = false;
                result.ErrorMessage = "没找到登陆信息呀呀呀!";
            }
            return(result);
        }
Exemple #10
0
        public ActionResult SaveUserInfo(UIUserInfo uiUserInfo)
        {
            var loginEmail = UILoginHelper.GetUIUserLoginNameOrEmail(HttpContext);

            return(Json(SaveUserToDB(loginEmail, uiUserInfo)));
        }