/// <summary> /// 构造函数初始化调整操作窗口在屏幕上的位置 /// </summary> public dataCollectForm(optForm opt, createProForm1 c1, createProForm2 c2) { InitializeComponent(); this.home = opt; this.c1 = c1; this.c2 = c2; //调整位置 int w = Screen.GetWorkingArea(this).Width; int h = Screen.GetWorkingArea(this).Height; this.Left = w - this.Width; this.Top = (h - this.Height) / 2; this.refereeData.Text = "主裁判: 第一助理裁判: 第二助理裁判: 第四官员: "; this.number.Width = this.dataGridView1.Size.Width / 7; this.timeOfEvent.Width = this.dataGridView1.Size.Width / 7; this.coordinateOfReferee.Width = this.dataGridView1.Size.Width / 7; this.eventOfGame.Width = this.dataGridView1.Size.Width * 25 / 70; this.coordinateOfEvent.Width = this.dataGridView1.Size.Width / 7; this.pictureBox1.ContextMenuStrip = this.contextMenuStrip1; this.g = pictureBox1.CreateGraphics(); //不显示横向滚动条 this.HorizontalScroll.Maximum = 0; this.AutoScroll = false; this.VerticalScroll.Visible = false; this.AutoScroll = true; }
public homepage(optForm opt, string s) { InitializeComponent(); userBtn_Click(null, null); this.last = opt; this.userID = s; }
/// <summary> /// 点击登陆按钮,检查输入后,从数据库中查找用户信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void sign_Click(object sender, EventArgs e) { this.username = text_userName.Text; this.password = text_password.Text; bool isSuccess = false; //检查用户名和密码不能为空,为空者获得相应的输入焦点,并且函数return if (this.username == "" || this.username == null) { MessageBox.Show("请输入用户名!", "错误"); text_userName.Focus(); return; } if (this.password == "" || this.password == null) { MessageBox.Show("请输入密码!", "错误"); text_password.Focus(); return; } //要查询的信息 string tableName = "user_table"; string userNameCol = "user_id"; string passwordCol = "user_pwd"; //数据库中检查用户名和密码 //检查用户名和密码 开始 DBO dbo = new DBO(); dbo.Open(); isSuccess = dbo.IsAllExisted(tableName, userNameCol, "123456", passwordCol, "123456"); dbo.Close(); //检查用户名和密码 结束 //输入正确则打开主页面,不正确提示用户名或密码错误,清空密码,密码框获得焦点 if (isSuccess) { MessageBox.Show("登陆成功!", "提示"); //打开主页面 this.Hide(); optForm optform = new optForm(this.username); optform.StartPosition = FormStartPosition.CenterScreen; optform.Show(); } else { MessageBox.Show("用户名或密码错误!", "提示"); text_password.Text = ""; text_password.Focus(); } }
public createProForm1(optForm optform) { InitializeComponent(); this.lastForm = optform; this.userID = this.lastForm.get_userId(); }
public createProForm2(createProForm1 front, optForm opt) { InitializeComponent(); this.last = front; this.home = opt; }