protected override void BtnOK_Click(object sender, EventArgs e) { //验证逻辑 string strUserName = txtUserName.Text.Trim(); string strPassword = txtPassword.Text.Trim(); if (strUserName.Equals("")) { CMessageBox.ShowError("请输入用户名!", Config.DialogTitle); return; } IUserInfo objUser = DALFactory.DALFactory.UserInfo(); int iUserID = objUser.Login(strUserName, Functions.Md5_32(strPassword), out string strErrorInfo); if (iUserID <= 0) { CMessageBox.ShowError("输入的用户名或密码错误,请重新输入!", Config.DialogTitle); return; } RunVariable.CurrentUserInfo = objUser.GetModel(iUserID); if (RunVariable.CurrentUserInfo == null) { CMessageBox.ShowError(string.Format("无法找到编号为{0}的用户!", iUserID), Config.DialogTitle); return; } //保存用户名到临时文件 Manager.GetInstance().SaveUserName(strUserName); this.DialogResult = DialogResult.OK; }
/// <summary> /// 用户详细资料 /// </summary> public Tz888.Model.UserInfo GetModel(string UserName) { return(dal.GetModel(UserName)); }
/// <summary> /// 得到一个对象实体 /// </summary> public KryptonAccessController.AccessDataBase.Model.UserInfo GetModel(int UserID) { return(dal.GetModel(UserID)); }