Ejemplo n.º 1
0
        private ReturnMessage Updateuserinfo(string oldpwd, string newpwd)
        {
            UserInfor user = UserInforDAL.CurrentUser();

            if (user != null)
            {
                if (user.password == oldpwd)
                {
                    user.password = newpwd;
                }
                else
                {
                    rm.Info = "incorrect";
                    return(rm);
                }

                if (UserInforDAL.m_UserInforDAL.Update(user))
                {
                    rm.Info = "true";
                }
                else
                {
                    rm.Info = "false";
                }
            }
            return(rm);
        }
Ejemplo n.º 2
0
        public ReturnMessage Getuserinfo()
        {
            UserInfor     user = UserInforDAL.CurrentUser();
            List <object> list = new List <object>();

            if (user != null)
            {
                list.Add(user.Nickname);
                list.Add(user.Realname);
                list.Add(user.UIdentity);
                if (user.Udepartment == null)
                {
                    list.Add("-");
                }
                else
                {
                    list.Add(user.Udepartment);
                }
                list.Add(user.Ucash);
                list.Add(getdayoff(user.CreatedTime) + "天");
                list.Add(user.Uemail);
                list.Add(user.Sex);
                list.Add(user.Uselfdes);
                rm.Data = list;
            }
            return(rm);
        }
Ejemplo n.º 3
0
        private ReturnMessage Updateuserinfo(string nickname, string email, string selfdes)
        {
            UserInfor user = UserInforDAL.CurrentUser();

            if (user != null)
            {
                if (user.Nickname.Length <= 3)
                {
                    user.Nickname = nickname;
                    user.Uemail   = email;
                    user.Uselfdes = selfdes;
                }
                else
                {
                    user.Uemail   = email;
                    user.Uselfdes = selfdes;
                }

                if (UserInforDAL.m_UserInforDAL.Update(user))
                {
                    rm.Info = "true";
                }
                else
                {
                    rm.Info = "false";
                }
            }
            return(rm);
        }
Ejemplo n.º 4
0
        public ReturnMessage checklogin()
        {
            try
            {
                if (UserInforDAL.CurrentUser() != null)
                {
                    UserInfor user = UserInforDAL.CurrentUser();
                    rm.Success = true;
                    rm.Info    = user.Uavatar;
                }
                else
                {
                    rm.Info     = "no";
                    rm.Redirect = "../login.aspx";
                }
                return(rm);
            }
            catch (Exception)
            {
                rm.Info = "no";
                return(rm);

                throw;
            }
        }