public void Init() { UserDA _staDA = new UserDA(); if (null != _UserORList) _UserORList.Clear(); else _UserORList = new ObservableCollection<UserOR>(); var vList = _staDA.selectAllDate(); foreach (UserOR obj in vList) { _UserORList.Add(obj); } }
public bool Login(string userid, string password,out string errorMsg) { try { UserOR mUser = new UserDA().Login(userid, password); if (mUser != null) { errorMsg = "登录成功!"; GlobalData.UserName = mUser.Username; return true; } else { errorMsg = "用户名或密码错误!"; } } catch (Exception ex) { errorMsg = ex.Message; } return false; }