using GalaSoft.MvvmLight;
using System.Collections.Generic;

namespace MWSDomain.Common.CoreLib
{
    /// <summary>
    /// 登录用户信息
    /// </summary>
    public class Loginer : ViewModelBase
    {
        private Loginer() { }
        private static Loginer _loginer = new Loginer(); //饿汉式单例

        /// <summary>
        /// 当前用户
        /// </summary>
        public static Loginer LoginerUser
        {
            get { return _loginer; }
        }

        private string _account = string.Empty;
        private string _userName = string.Empty;
        private bool _isLocked = false;
        private bool _isAdmin;

        /// <summary>
        /// 登录名
        /// </summary>
        public string Account
        {
            get { return _account; }
            set { _account = value; RaisePropertyChanged(); }
        }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get
            {
                return _userName;
            }
            set { _userName = value; RaisePropertyChanged(); }
        }

        /// <summary>
        /// 是否锁定
        /// </summary>
        public bool IsLocked
        {
            get
            {
                return _isLocked;
            }
            set { _isLocked = value; RaisePropertyChanged(); }
        }


        /// <summary>
        /// 是否属于管理员
        /// </summary>
        public bool IsAdmin
        {
            get { return _isAdmin; }
            set { _isAdmin = value; RaisePropertyChanged(); }
        }
    }
}
