public bool Login(UserInfo userInfo,string password)
        {
            bool isSuccess = false;

            if (userInfo != null&&userInfo.Password ==password)
            {
                LoginUserInfo loginUser = new LoginUserInfo();

                loginUser.UserCode = userInfo.UserCode;
                loginUser.UserName = userInfo.UserName;
                loginUser.UserId = userInfo.UserId;
                loginUser.CreateDate = userInfo.CreatedDate;
                loginUser.Department = GetDepartmentByDepartmetCode(userInfo.DepartmentCode);
                loginUser.RoleList = GetRoleListByUserId(userInfo.UserId);
                loginUser.MenuInfos = GetMenuListByUserId(userInfo.UserId);

                LoginUser = loginUser;

                isSuccess = true;

            }

            return isSuccess;
        }
 private UserInfo GetModel()
 {
     UserInfo userInfo = new UserInfo();
     userInfo.UserCode = txtUserID.Text.Trim();
     userInfo.UserName = txtUserName.Text.Trim();
     userInfo.Password = GetDefaultPassword();
     userInfo.CreatedDate = DateTime.Now;
     userInfo.TelPhone = txtTle.Text.Trim();
     userInfo.MobilePhone = txtMoblie.Text.Trim();
     userInfo.EMail = txtMail.Text.Trim();
     return userInfo;
 }