Ejemplo n.º 1
0
        public static UserContract ToContract(this BASE_USER_INFO source)
        {
            if (source == null)
            {
                throw new InvalidOperationException("source is null");
            }
            return(new UserContract
            {
                Id = source.USER_INFO_ID,

                UserName = source.USER_INFO_NAME,
                NickName = source.USER_INFO_NICKNAME,
                DepId = source.DEPID,
                RoleId = source.ROLE_INFO_ID,
                CreatedDate = source.USER_INFO_CREATEDDATE ?? DateTime.MinValue,
                CreatedBy = source.USER_INFO_CREATEDBY,
                Password = source.USER_INFO_PWD,
                IsDel = source.USER_INFO_ISDEL ?? 0,
                UserInfoIssup = source.USER_INFO_ISSUP ?? 0,
                UserInfoTel = source.USER_INFO_TEL,
                UserInfoEmail = source.USER_INFO_EMAIL,
                UserInfoPhoto = source.USER_INFO_PHOTO,
                UserInfoState = source.USER_INFO_STATE
            });
        }
Ejemplo n.º 2
0
        public bool UpdateEmail(string username, string email)
        {
            BASE_USER_INFO user = _userRepository.Update(u => u.USER_INFO_NAME == username, (u) =>
            {
                u.USER_INFO_EMAIL = email;
            });

            if (user != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool UpdateTel(string username, string telphone)
        {
            BASE_USER_INFO user = _userRepository.Update(u => u.USER_INFO_NAME == username, (u) =>
            {
                u.USER_INFO_TEL = telphone;
            });

            if (user != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        public bool UpdateNickName(string username, string nickname)
        {
            BASE_USER_INFO user = _userRepository.Update(u => u.USER_INFO_NAME == username, (u) =>
            {
                u.USER_INFO_NICKNAME = nickname;
            });

            if (user != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        public bool SetStatus(Guid id, string status)
        {
            BASE_USER_INFO user = _userRepository.Update(u => u.USER_INFO_ID == id, (u) =>
            {
                u.USER_INFO_STATE = (status);
            });

            if (user != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
        public bool SetDelete(Guid id)
        {
            BASE_USER_INFO user = _userRepository.Update(u => u.USER_INFO_ID == id, (u) =>
            {
                u.USER_INFO_ISDEL = 1;
            });

            if (user != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }