private void button1_Click(object sender, EventArgs e) { string username = this.textBox1.Text; string password = this.textBox2.Text; if (checkLogin(username,password)) { UserModel userModel = new UserModel(); userModel.username = username; userModel.uid = uid; userModel.score = score; if (int.Parse(Util.getmydrawnum(uid)) > 0) { if (MessageBox.Show("有朋友给您发送了未猜的图画,是否要开始猜图?(一次只能猜测一幅画)", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK) { string drawthing = Util.getdrawthing(uid); MainForm mainForm = new MainForm(userModel, userModel, drawthing, "guess"); mainForm.Show(); this.Hide(); } else { FindPartnerForm findPartnerForm = new FindPartnerForm(userModel); findPartnerForm.Show(); this.Hide(); } } else { FindPartnerForm findPartnerForm = new FindPartnerForm(userModel); findPartnerForm.Show(); this.Hide(); } } else { MessageBox.Show("登陆失败,请再填写用户名和密码并重新登陆。"); } }
//我要给别人画 按钮:回到寻找好友的界面 private void button10_Click(object sender, EventArgs e) { this.Dispose(); FindPartnerForm findPartnerForm = new FindPartnerForm(userModel); findPartnerForm.Show(); }