private void button2_Click(object sender, EventArgs e) { this.Hide(); Form8 f8 = new Form8(username1); f8.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { Form8 a = new Form8(); this.Hide(); a.ShowDialog(); }
private void button6_Click(object sender, EventArgs e) { Form8 f8 = new Form8(); f8.ShowDialog(); this.Close(); }
private void btn_login_Click(object sender, EventArgs e) { connection.Open(); OleDbCommand command = new OleDbCommand(); command.Connection = connection; command.CommandText = "select * from UserInfo where Usernamee='" + txt_username.Text + "' and Passwordd='" + txt_password.Text + "'"; OleDbDataReader reader = command.ExecuteReader(); int count = 0; while (reader.Read()) { count++; } if (count == 1) { this.Hide(); Form8 f8 = new Form8(txt_username.Text); f8.ShowDialog(); } else if (count > 1) { MessageBox.Show("Duplicate Username and Password"); } else { MessageBox.Show("Wrong Username or Password"); } connection.Close(); }
private void button1_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Railway reservation system;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False"); con.Open(); SqlCommand cmd = new SqlCommand("validateID", con); cmd.CommandType = CommandType.StoredProcedure; int y = Convert.ToInt32(textBox2.Text); cmd.Parameters.Add(new SqlParameter("@ID", y)); cmd.Parameters.Add(new SqlParameter("@nm", textBox1.Text)); SqlParameter myParam = cmd.Parameters.Add("@@ok", SqlDbType.Int); myParam.Direction = ParameterDirection.Output; SqlDataReader read = cmd.ExecuteReader(); read.Close(); if (cmd.Parameters["@@ok"].Value.ToString() == "") { label9.Text = "The username or ID is invalide please enter a valid one."; } else { Form8 f = new Form8(); this.Hide(); f.ShowDialog(); this.Close(); } }
private void btnviewstudents_Click(object sender, EventArgs e) { var view = new Form8(); view.ShowDialog(); view.ShowInTaskbar = false; }
private void 奖学金认定ToolStripMenuItem_Click(object sender, EventArgs e) { this.Visible = false; Form8 f4 = new Form8(); f4.ShowDialog(); this.Visible = true; }
private void button1_Click(object sender, EventArgs e) { { //database billing admin4.Connect(); admin4.admin2 = new MySqlCommand("Insert into billing(StudentID, Name, Total, RemainingBalance, Monthly, TypeofPayment) value(@sn, @Name, @Total, @RemainingBalance, @Monthly, @TypeofPayment)", admin4.adminn); admin4.admin2.Parameters.Add(new MySqlParameter("sn", StudentID)); admin4.admin2.Parameters.Add(new MySqlParameter("Name", label4.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("Total", button3.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("RemainingBalance", label13.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("Monthly", textBox3.Text)); string payment = ""; if (radioButton1.Checked) { payment = radioButton1.Text; } else if (radioButton2.Checked) { payment = radioButton2.Text; } admin4.admin2.Parameters.Add(new MySqlParameter("TypeofPayment", payment)); admin4.admin2.ExecuteNonQuery(); admin4.Disconnect(); } //Name use1 = label4.Text; //remaining balance use2 = label13.Text; //AMTpay use3 = textBox1.Text; //AMTtoPAY use7 = textBox4.Text; //schoo year use4 = label16.Text; //date use5 = dateTimePicker1.Text; //change use6 = button4.Text; //total amount use8 = button3.Text; this.Hide(); Form8 Form8 = new Form8(); Form8.ShowDialog(); }
private void addCashierSaleToolStripMenuItem_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); Form8 saleform = new Form8(); saleform.employee = this.user; if (saleform.ShowDialog() == DialogResult.OK) { db.dataGrid(dt, "sales"); dataGridView1.DataSource = dt; int rowCount = ((DataTable)this.dataGridView1.DataSource).Rows.Count; dataGridView1.Rows[rowCount - 1].Selected = true; dataGridView1.FirstDisplayedScrollingRowIndex = rowCount - 1; } }
private void button1_Click(object sender, EventArgs e) { List<Person> p = new PersonAction().query(); String str = null; for (int i = 0; i < p.Count();i ++) { str += "挂号业务ID:" + p[i].Id + "\n" + "姓名:" + p[i].Name + "\n" + "年龄:" + p[i].Age + "\n" + "症状:" + p[i].Desc + "\n" + "诊疗方法和建议: " + p[i].Medicine + "\n\n\n" ; } Form myForm = new Form8(str); myForm.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { { //update admin4.Connect(); admin4.admin2 = new MySqlCommand("update billing set StudentID=@StudentID, Name=@Name, RemainingBalance=@RemainingBalace, Monthly=@Monthly where ID=@ID", admin4.adminn); admin4.admin2.Parameters.Add(new MySqlParameter("ID", label15.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("StudentID", label4.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("Name", label5.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("RemainingBalance", label20.Text)); admin4.admin2.Parameters.Add(new MySqlParameter("Monthly", label10.Text)); admin4.admin2.ExecuteNonQuery(); admin4.Disconnect(); LoadTable1(); } //Name user1 = label5.Text; //remaining balance user2 = label7.Text; //AMTpay user3 = textBox2.Text; //AMTtoPAY user4 = textBox3.Text; //change user5 = label18.Text; //School year user6 = label18.Text; //date user7 = dateTimePicker1.Text; this.Hide(); Form8 Form8 = new Form8(); Form8.ShowDialog(); }
private void button6_Click(object sender, EventArgs e) { if (radioButton1.Checked) { Form8 f8 = new Form8("приход", 1); f8.ShowDialog(); dataGridView1.Refresh(); dataGridView2.Refresh(); this.test1TableAdapter1.FillBy1(this.northwindDataSet31.test1, 1); test2BindingSource.ResetBindings(false); this.test2TableAdapter.Fill(this.northwindDataSet31.test2); } if (radioButton2.Checked) { Form8 f8 = new Form8("рассход", 2); f8.ShowDialog(); dataGridView1.Refresh(); dataGridView2.Refresh(); this.test1TableAdapter1.FillBy1(this.northwindDataSet31.test1, 2); test2BindingSource.ResetBindings(false); this.test2TableAdapter.Fill(this.northwindDataSet31.test2); } }
private void txt_confirm_Click(object sender, EventArgs e) { try { connection.Open(); string q; int i, flag = 0; int.TryParse(txt_ticket.Text, out i); OleDbCommand command = new OleDbCommand(); command.Connection = connection; if (ticket_type == "GrandStand") { if (i <= 2) { command.CommandText = "update Venue_Capacity set Grand_Stand=Grand_Stand-" + i + " where MatchNo=" + matchNo + ""; flag = 1; } else { MessageBox.Show("Wrong Input!!"); } } else if (ticket_type == "Business") { if (i <= 4) { command.CommandText = "update Venue_Capacity set Business_Class=Business_Class-" + i + " where MatchNo=" + matchNo + ""; flag = 1; } else { MessageBox.Show("Wrong Input!!"); } } else if (ticket_type == "Lawn") { if (i <= 2) { command.CommandText = "update Venue_Capacity set Lawn=Lawn-" + i + " where MatchNo=" + matchNo + ""; flag = 1; } else { MessageBox.Show("Wrong Input!!"); } } else if (ticket_type == "Economy") { if (i <= 5) { command.CommandText = "update Venue_Capacity set Economy_Class=Economy_Class-" + i + " where MatchNo=" + matchNo + ""; flag = 1; } else { MessageBox.Show("Wrong Input!!"); } } if (flag == 1) { command.ExecuteNonQuery(); q = "insert into Booking (Usernamee,No_of_ticketss,MatchNo,Team11,Team22,Venuee,Credit_Card_Idd,Ticket_type) values('" + username1 + "'," + i + "," + matchNo + ",'" + team1 + "','" + team2 + "','" + venue + "','" + txt_cred_card.Text + "','" + ticket_type + "')"; command.CommandText = q; command.ExecuteNonQuery(); } else { MessageBox.Show("Wrong Input!!"); } connection.Close(); this.Hide(); Form8 f8 = new Form8(username1); f8.ShowDialog(); } catch (Exception ex) { MessageBox.Show("Error " + ex); } }
//登录按键响应事件 private void ButtonLogin_Click(object sender, EventArgs e) { //新建ClassSqlConnect类,调用重构的ViewCount方法返回从数据库中查询的结果 ClassSqlConnect log = new ClassSqlConnect(); SqlDataReader reader = log.ViewCount(ComboxUserName.Text.ToString(),TxtPassword.Text.ToString()); if (reader.Read())//判断有数据,说明登录成功 { /*保存账号信息,将这部分信息保存在数据库(XML)中更好*/ ComboxUserName.Items.Add(ComboxUserName.Text.ToString()); Form nfm; //提取用户名信息 string UName = reader[1].ToString(); MessageBox.Show("欢迎你,"+ UName); //提取权限信息并选择应打开的界面 switch((int)reader[2]) { case 0: nfm = new Form2();//系统管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 1: nfm = new Form7();//人事经理管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 2: nfm = new Form3();//人事员工管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 3: nfm = new Form8();//财务经理管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 4: nfm = new Form4();//财务员工管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 5: nfm = new Form9();//销售经理管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 6: nfm = new Form6();//销售员工管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 7: nfm = new Form10();//仓库经理管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; case 8: nfm = new Form5();//仓库员工管理界面 this.Hide(); if (nfm.ShowDialog() == DialogResult.OK) { this.Show(); } break; default: MessageBox.Show("你没有登录权限," + UName,"没有权限"); ComboxUserName.Text = ""; TxtPassword.Text = ""; break; } } else { MessageBox.Show("用户名或密码错误!","错误"); TxtPassword.Text = ""; } //调用自定义的Close方法关闭sql连接 log.Close(); }
private void button1_Click(object sender, EventArgs e) { int flag = 0; int ff = 0; int fff = 0; string str = "否"; Random ro = new Random(); int[] iResult = new int[100]; int iUp = 999999; int iDown = 100000; for (int i = 1; i <= f; i++) { iResult[i] = ro.Next(iDown, iUp); } uid.ConnectionString = global.constr; string a = "update 排片信息 set 剩余票数=剩余票数-" + f.ToString() + " where 电影名称='" + movie_name + "' and 放映厅='" + comboBox2.Text + "' and 场次='" + comboBox1.Text + "'"; SqlCommand cmd1 = new SqlCommand(a, uid); try { uid.Open(); if (f == 0) { MessageBox.Show("还没买票!"); } else { cmd1.ExecuteNonQuery(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { uid.Close(); } for (int i = 0; i < 11; i++) { v[i] = new int[11]; } for (int i = 0; i < tabPage1.Controls.Count; i++) { if (tabPage1.Controls[i].BackColor == Color.Red) { string b = tabPage1.Controls[i].Text.Substring(0, 1); string c = tabPage1.Controls[i].Text.Substring(2, 1); tabPage1.Controls[i].Enabled = false; int bb = int.Parse(b); int cc = int.Parse(c); v[bb][cc] = 1; } } if (f != 0) { this.Visible = true; Form f8 = new Form8(); f8.ShowDialog(); DateTime dt = DateTime.Today; for (int i = 0; i < 11; i++) { for (int j = 0; j < 11; j++) { if (u[i][j] != v[i][j]) { ff++; string b = "insert into 购票座位号 values('" + textBox5.Text + "','" + comboBox2.Text + "', '" + comboBox1.Text + "', '" + dt + "', '" + (i).ToString() + "', '" + (j).ToString() + "','" + (iResult[ff]).ToString() + "') "; SqlCommand cmd = new SqlCommand(b, uid); try { uid.Open(); if (cmd.ExecuteNonQuery() > 0) { flag = 1; MessageBox.Show(" 第" + (ff).ToString() + " 张票\r\n 取票密码:" + (iResult[ff]).ToString() + "\r\n 放 映 厅 :" + comboBox2.Text + "\r\n 场 次:" + comboBox1.Text); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { uid.Close(); } } } } for (int i = 0; i < 11; i++) { for (int j = 0; j < 11; j++) { if (u[i][j] != v[i][j]) { fff++; string c = "insert into 订单 values('" + iResult[fff].ToString() + "','" + global.userID + "','" + str + "') "; SqlCommand cmd2 = new SqlCommand(c, uid); try { uid.Open(); if (cmd2.ExecuteNonQuery() > 0) { } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { uid.Close(); } } } } button1.Enabled = false; } }
//调用系统参数窗体 private void button4_Click(object sender, EventArgs e) { Form8 formck = new Form8(); formck.ShowDialog(); }