private float mAddAnimTime;//增加动画持续时间 void Awake() { mAddAnimTime = 6f; UserInfoBean userInfo = DataStorageManage.getUserInfoDSHandle().getData(0); if (userInfo != null) { mCurrentPoint = userInfo.puzzlesPoint; } }
// Use this for initialization void Start() { UserInfoMgr.instance.InitData(); UserInfoBean uib = UserInfoMgr.instance.GetDataById(1); Debug.Log(uib.Name); UserInfoMgr.instance.Test(); }
UserInfoDAO uid = new UserInfoDAO(); //数据层 /// <summary> /// 用户登录 /// </summary> /// <param name="uib"></param> /// <returns></returns> public bool GetLogin(UserInfoBean uib) { DataTable dt = uid.GetLogin(uib); if (dt.Rows.Count > 0) { return(true); } return(false); }
public frm_Sign(UserInfoBean UIf) { InitializeComponent(); UnitDt = UnitInfoBll.Instance.GetAll().ToList(); LoadComboBoxEdit(UnitDt); this.btnSignUp.Text = "提交"; this.Text = "用户信息编辑"; this.txtUsername.Text = UIf.UserName; this.txtPsd1.Text = UIf.Password; this.txtPsd2.Text = UIf.Password; AthParse(UIf.UserAthrty); UnitParse(UIf.UserUnit); UserInfoBean = UIf; }
void rIBtnEdit_ButtonClick(object sender, ButtonPressedEventArgs e) { try { DataRow dr = this.gridView.GetDataRow(this.gridView.FocusedRowHandle); UserInfoBean UIf = UserInfoBll.Instance.GetUserBy(dr[0].ToString()); frm_Sign signupForm = new frm_Sign(UIf); if (signupForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BeginInit(); } } catch (Exception ex) { XtraMessageBox.Show("编辑数据失败!", "错误"); } }
/// <summary> /// 添加普通员工 /// </summary> /// <param name="uib"></param> /// <returns></returns> public int AddUser(UserInfoBean uib) { int count = 0; try { SqlParameter[] sp = { para = new SqlParameter("@LoginName", uib.LoginName), para = new SqlParameter("@LoginPass", uib.LoginPass), para = new SqlParameter("@UserName", uib.UserName), para = new SqlParameter("@Remark", uib.Remark) }; count = sh.RunSql("AddUser", sp); } catch (Exception ex) { throw ex; } return(count); }
/// <summary> /// 登录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnLogin_Click(object sender, EventArgs e) { if (!MysqlEasy.IsCanConnected(MysqlEasy.ConnectionString)) { XtraMessageBox.Show("数据库连接失败,请检查配置是否正确", "提示"); return; } if (textUsername.Text == "" || textPsd.Text == "") { XtraMessageBox.Show("用户名和密码不能为空!", "提示"); if (textUsername.Text == "") { textUsername.Focus(); } if (textUsername.Text != "" && textPsd.Text == "") { textPsd.Focus(); } return; } try { var userName = textUsername.Text; var password = textPsd.Text; UserInfoBean uiblogin = UserInfoBll.Instance.GetLogin(new UserInfoBean { UserName = userName, Password = UserInfoBll.Instance.encryptPWD(password) }); if (uiblogin != null) { if (uiblogin.Status == "0")//在审核状态 { XtraMessageBox.Show("该用户正在审核中,请联系管理员!", "提示"); return; } else if (uiblogin.Status == "2") { XtraMessageBox.Show("该用户未通过审核,请联系管理员!", "提示"); return; } else { SystemInfo.CurrentUserInfo = uiblogin; this.DialogResult = DialogResult.OK; StartDAS(); } } else { XtraMessageBox.Show("用户名或密码错误!", "提示"); return; } } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "错误"); } }
public UserInfoBean GetLogin(UserInfoBean uif) { UserInfoBean obj = UserInfoDal.Instance.GetAll().ToList().Find(n => (n.UserName == uif.UserName && n.Password == uif.Password)); return(obj); }
public int Update(UserInfoBean model) { return(UserInfoDal.Instance.Update(model)); }
public int Add(UserInfoBean model) { return(UserInfoDal.Instance.Insert(model)); }
private void btnSignUp_Click(object sender, EventArgs e) { if (txtUsername.Text == "" || txtPsd1.Text == "" || txtPsd2.Text == "") { XtraMessageBox.Show("用户名和密码不能为空!", "提示"); if (txtUsername.Text == "") { txtUsername.Focus(); } if (txtUsername.Text != "" && txtPsd1.Text == "") { txtPsd1.Focus(); } if (txtUsername.Text != "" && txtPsd1.Text == "" && txtPsd2.Text == "") { txtPsd2.Focus(); } return; } if (txtPsd1.Text != txtPsd2.Text) { XtraMessageBox.Show("两次输入密码不一致!", "提示"); return; } string userAuthStr = ""; for (int i = 0; i < cbeUnit.Properties.Items.Count; i++) { if (cbeAuth.Properties.Items[i].CheckState == CheckState.Checked) { userAuthStr += cbeAuth.Properties.Items[i].Value.ToString() + ";"; } } if (userAuthStr == string.Empty) { XtraMessageBox.Show("申请权限不能为空!", "提示"); cbeAuth.Focus(); return; } if (cbeUnit.Text == "") { XtraMessageBox.Show("用户单位不能为空!", "提示"); if (cbeUnit.Text == "") { cbeUnit.Focus(); } return; } try { if (this.btnSignUp.Text == "注册") { UserInfoBean usermodel = new UserInfoBean(); usermodel.UserName = txtUsername.Text; usermodel.Password = UserInfoBll.Instance.encryptPWD(txtPsd1.Text); usermodel.UserAthrty = userAuthStr; usermodel.UserUnit = UnitDt.Find(n => n.UnitName == cbeUnit.Text).UnitCode; usermodel.Status = UserDicCls.UserDictionary[UserStatus.Examining]; if (UserInfoBll.Instance.GetUserBy(usermodel.UserName) != null) { XtraMessageBox.Show("该用户已被使用", "提示"); return; } else { UserInfoBll.Instance.Add(usermodel); XtraMessageBox.Show("用户注册成功,请等待审核", "提示"); this.Close(); } } else { UserInfoBean usermodel = new UserInfoBean(); usermodel.UserName = txtUsername.Text; if (txtPsd1.Text != UserInfoBean.Password) { usermodel.Password = UserInfoBll.Instance.encryptPWD(txtPsd1.Text); } else { usermodel.Password = txtPsd1.Text; } usermodel.UserAthrty = userAuthStr; usermodel.UserUnit = UnitDt.Find(n => n.UnitName == cbeUnit.Text).UnitCode; usermodel.Status = UserDicCls.UserDictionary[UserStatus.Examining]; UserInfoBll.Instance.UpdateWhatWhere(new { password = usermodel.Password, userunit = usermodel.UserUnit, userathrty = usermodel.UserAthrty, status = usermodel.Status }, new { username = usermodel.UserName }); XtraMessageBox.Show("用户信息修改成功!", "提示"); this.Close(); } this.DialogResult = System.Windows.Forms.DialogResult.OK; } catch (Exception ex) { if (this.btnSignUp.Text == "注册") { XtraMessageBox.Show("用户注册失败,请联系管理员", "错误"); } else { XtraMessageBox.Show("用户信息修改失败,请联系管理员", "错误"); } this.DialogResult = System.Windows.Forms.DialogResult.No; } }
private void HandleBuyCoin(Notification notify) { UserInfoBean userInfoBean = (UserInfoBean)notify.Object; RefreshCoin(userInfoBean.Coin); }
protected override void Init() { userInfoBean = new UserInfoBean(); }