private void button9_Click(object sender, EventArgs e) { if (act_table == 1) // обработка таблицы "Билет" { Form4 f = new Form4(); if (f.ShowDialog() == DialogResult.OK) { // добавление данных в таблицу "Билеты" Add_Bilet(f.textBox1.Text, f.textBox2.Text, Convert.ToDateTime(f.dateTimePicker1.Text), f.textBox4.Text, f.textBox5.Text, f.checkBox1.Checked); Get_Bilets(); } } else if (act_table == 2) // обработка таблицы "Маршрут" { Form5 f = new Form5(); if (f.ShowDialog() == DialogResult.OK) { // добавление данных в таблицу "Маршрут" Add_Marshrut(f.textBox1.Text, f.textBox2.Text, f.textBox3.Text, f.textBox4.Text, Convert.ToDouble(f.textBox5.Text), Convert.ToDouble(f.textBox6.Text), f.dateTimePicker1.Value, f.dateTimePicker2.Value); Get_Marshruts(); } } else if (act_table == 3) // обработка таблицы "Автобус" { Form6 f = new Form6(); if (f.ShowDialog() == DialogResult.OK) { // добавление данных в таблицу "Автобус" Add_Avtobus(f.textBox1.Text, f.textBox2.Text, f.textBox3.Text, f.textBox4.Text); Get_Avtobus(); } } else if (act_table == 4) // обработка таблицы "Водитель" { Form7 f = new Form7(); if (f.ShowDialog() == DialogResult.OK) { // добавление данных в таблицу "Водитель" Add_Voditel(f.textBox1.Text, Convert.ToString(f.dateTimePicker1.Value), f.textBox2.Text); Get_Voditel(); } } else if (act_table == 5) // обрабатываем таблицу "Диспетчер" { Form8 f = new Form8(); if (f.ShowDialog() == DialogResult.OK) { // добавление данных в таблицу "Диспетчер" Add_Dispetcher(f.textBox1.Text, Convert.ToString(f.dateTimePicker1.Value), f.textBox2.Text); Get_Dispetcher(); } } }
private void button8_Click(object sender, EventArgs e) { Form8 frm8 = new Form8(); //实例化一个子窗口 frm8.TopLevel = false; //设置子窗口不显示为顶级窗口 frm8.Dock = DockStyle.Fill; //填充 this.panel1.Controls.Clear(); //清空Panel里面的控件 this.panel1.Controls.Add(frm8); //加入控件 frm8.Show(); //让窗体显示 }
private void button1_Click(object sender, EventArgs e) { //string printbill = "Thoi gian: " + DateTime.UtcNow + Constants.endline + fDrinklist.sanPhamBuill + Constants.endline + "So tien tich luy: " + fDrinklist.sum + "->Diem tich luy: " + Constants.endline + fDrinklist.sumMoney; ////Helper.CreateFolder(Form3.textBox1); //var arrayPrintBill = new List<string> //{ // printbill, //}; //var path = Helper.writeonfile("091232323", "leee", arrayPrintBill); //Helper.writetext(path, arrayPrintBill); string username = tbUsername.Text; string password = tbpassword.Text; bool a = Helper.Checkstaff(username, password); if (a == true) { string loichao1 = "You are now login as staff "; staffname = Helper.Checkstaffname(username, password); MessageBox.Show(loichao1 + "\nWelcome " + staffname); string textt = Helper.readtext("quanlynhanvien.txt"); List <string> newstaffname = new List <string> { textt + "\n" + staffname + ":\n Bat dau lam viec: " + DateTime.Now + "\n Ket thuc:" }; Helper.writetext("quanlynhanvien.txt", newstaffname); Form6 f = new Form6(); this.Hide(); f.ShowDialog(); } else { if (username == "ticklabcoffee" && password == "ticklabcoffee") { string loichao2 = "You are now login as admin "; MessageBox.Show(loichao2 + "\nWelcome ticklabcoffee"); Form8 f = new Form8(); this.Hide(); f.ShowDialog(); } else { MessageBox.Show("I am sorry, your username and password are incorrect"); } } }
private void button1_Click(object sender, EventArgs e) { if (Form14.d == 1) { if (radioButton3.Checked == true) { Form8 form = new Form8(); form.Show(); this.Hide(); } else if (radioButton2.Checked == true) { Form12 form = new Form12(); form.Show(); this.Hide(); } else if (radioButton1.Checked == true) { Form13 form = new Form13(); form.Show(); this.Hide(); } } else if (Form14.d == 2) { if (radioButton3.Checked == true) { Form15 form = new Form15(); form.Show(); this.Hide(); } else if (radioButton2.Checked == true) { Form16 form = new Form16(); form.Show(); this.Hide(); } else if (radioButton1.Checked == true) { Form17 form = new Form17(); form.Show(); this.Hide(); } } }
private void thốngKêToolStripMenuItem_Click(object sender, EventArgs e) { bool tf = true; Form4 f = new Form4(); f.setLabel1("Mã chuyến bay "); f.setButton("Thống kê"); string Mystring = ""; while (f.ShowDialog() == DialogResult.OK) { if (f.getTB1() == "") { MessageBox.Show("Chưa điền đủ thông tin", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning); continue; } Mystring = f.getTB1(); if (check_flight_exist(obj, Mystring) == false) { MessageBox.Show("Mã chuyến bay không tồn tại", "Title", MessageBoxButtons.OK, MessageBoxIcon.Warning); tf = false; f.Close(); break; } f.Close(); break; } if (tf == false) { return; } string str = ""; passengerinfo_of_flight(obj, Mystring); using (StreamReader sr = File.OpenText("output1.txt")) { str = sr.ReadLine(); } Form8 ff = new Form8(Mystring, str); ff.Show(); }
private void button1_Click(object sender, EventArgs e) { String Login = textBox1.Text; String Pass = textBox2.Text; DB db = new DB(); DataTable table = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(); SqlCommand command = new SqlCommand("Select * from Workers where Login = @UL AND Password = @UP", db.GetConnection()); command.Parameters.Add("@UL", SqlDbType.VarChar).Value = Login; command.Parameters.Add("@UP", SqlDbType.VarChar).Value = Pass; adapter.SelectCommand = command; adapter.Fill(table); ClientSession.UserName = textBox1.Text; if (table.Rows.Count > 0) { ClientSession.iduser = table.Rows[0][0].ToString(); string accessgroup = table.Rows[0][9].ToString(); if (accessgroup == "1") { Form8 form8 = new Form8(); form8.Show(); Hide(); } else { Form1 form1 = new Form1(); form1.Show(); Hide(); } } else { MessageBox.Show("Введен неверный логин или пароль"); } }
private void button1_Click(object sender, EventArgs e) { //string text; //List<string> tendangnhap = new List<string> {"\n"+ textBox1.Text+"\n" }; //List<string> matkhau = new List<string> { "\n" + textBox2.Text + "\n" }; //List<string> ten = new List<string> { "\n" + textBox3.Text + "\n" }; // text = Helper.readtext("staff.txt"); // List<string> text = new List<string> { Helper.readtext("staff.txt") }; string tendangnhap = "\n" + textBox1.Text + "\n"; string matkhau = textBox2.Text + "\n"; string ten = textBox3.Text; string text = Helper.readtext("staff.txt"); List <string> giatri = new List <string> { text + tendangnhap + matkhau + ten }; Helper.writetext("staff.txt", giatri); //Helper.writetext("staff.txt", matkhau); //Helper.writetext("staff.txt", ten); this.Hide(); Form8 f = new Form8(); f.ShowDialog(); }
private void ViewAttend_Click(object sender, EventArgs e) { Form8 fm = new Form8(); fm.Show(); }
private void button17_Click(object sender, EventArgs e) { Form8 f8 = new Form8(); f8.Show(); }
private void button2_Click(object sender, EventArgs e) { Form8 fm = new Form8(); fm.Show(); }
private void button1_Click(object sender, EventArgs e) { if (sexual.SelectedIndex == 0 && st.SelectedIndex == 0) { Form2 form2 = new Form2(); this.Hide(); form2.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 1) { Form3 form3 = new Form3(); this.Hide(); form3.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 2) { Form4 form4 = new Form4(); this.Hide(); form4.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 3) { Form5 form5 = new Form5(); this.Hide(); form5.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 4) { Form6 form6 = new Form6(); this.Hide(); form6.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 5) { Form7 form7 = new Form7(); this.Hide(); form7.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 6) { Form8 form8 = new Form8(); this.Hide(); form8.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 7) { Form9 form9 = new Form9(); this.Hide(); form9.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 8) { Form10 form10 = new Form10(); this.Hide(); form10.Show(); } if (sexual.SelectedIndex == 0 && st.SelectedIndex == 9) { Form11 form11 = new Form11(); this.Hide(); form11.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 0) { Form12 form12 = new Form12(); this.Hide(); form12.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 1) { Form13 form13 = new Form13(); this.Hide(); form13.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 2) { Form14 form14 = new Form14(); this.Hide(); form14.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 3) { Form15 form15 = new Form15(); this.Hide(); form15.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 4) { Form16 form16 = new Form16(); this.Hide(); form16.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 5) { Form17 form17 = new Form17(); this.Hide(); form17.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 6) { Form18 form18 = new Form18(); this.Hide(); form18.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 7) { Form19 form19 = new Form19(); this.Hide(); form19.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 8) { Form20 form20 = new Form20(); this.Hide(); form20.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 9) { Form21 form21 = new Form21(); this.Hide(); form21.Show(); } if (sexual.SelectedIndex == 1 && st.SelectedIndex == 10) { Form22 form22 = new Form22(); this.Hide(); form22.Show(); } }
private void openform8() { Form8 f8 = new Form8(); Application.Run(f8); }
private void searchEmployeeButton_Click(object sender, EventArgs e) { Form8 form8 = new Form8(); form8.ShowDialog(); if (form8.answer) { dataView.AllowUserToAddRows = false; dataView.ReadOnly = true; addSalaryButton.Enabled = false; ShowEmployeeSalary.Enabled = false; query = "SELECT * from Pracownicy WHERE "; if (form8.employeeID != 0) { query = query + "nr_pracownika=" + form8.employeeID + " AND "; } if (form8.oddzialID != 0) { query = query + "nr_oddzialu=" + form8.oddzialID + " AND "; } if (form8.name != "") { query = query + "Imie='" + form8.name + "' AND "; } if (form8.surname != "") { query = query + "Nazwisko='" + form8.surname + "' AND "; } if (form8.numberPESEL != "") { query = query + "PESEL='" + form8.numberPESEL + "' AND "; } if (form8.birthDate != "") { query = query + "Data_urodzenia=date '" + form8.birthDate + "' AND "; } if (form8.jobTitle != "") { query = query + "Nr_stanowiska=(SELECT nr_stanowiska from Stanowiska WHERE Nazwa='" + form8.jobTitle + "') AND "; } query = query.Substring(0, query.Length - 5); if (form8.employeeID == 0 && form8.oddzialID == 0 && form8.name == "" && form8.surname == "" && form8.numberPESEL == "" && form8.birthDate == "" && form8.jobTitle == "") { query = "SELECT * from Pracownicy"; } Console.WriteLine(query); try { using (connection = new OracleConnection(connectionString)) { dataAdapter = new OracleDataAdapter(query, connection); dataTable = new DataTable(); dataAdapter.Fill(dataTable); dataView.DataSource = dataTable; } } catch (Oracle.DataAccess.Client.OracleException oe) { MessageBox.Show("Nie udało sie znależć takiego pracownika"); return; } } }
private void аксессуарыЛодкиToolStripMenuItem_Click(object sender, EventArgs e) { Form8 f8 = new Form8(); f8.ShowDialog(); }
private void thresHoldToolStripMenuItem_Click(object sender, EventArgs e) { Form8 invert = new Form8(); invert.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { string password = SecurePasswordHasher.Hash(txtpass.Text); string html = string.Empty; string url = @"https://localhost:8080/searchu?username="******"C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/rootCA.pem"; //X509Certificate cert = new X509Certificate2(Certificate,"cert112",); //X509Certificate cert = new X509Certificate(); //cert.Import() //request.ClientCertificates.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(Certificate))); // if everything else fails System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; // request.ClientCertificates.Add(new X509Certificate("C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/server.crt","cert112")); // The path to the certificate. //string Certificate = "C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/rootCA.pem"; // Load the certificate into an X509Certificate object. // X509Certificate cert = new X509Certificate(); /*string file="C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/rootCA.pem"; // Contains name of certificate file * X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine); * store.Open(OpenFlags.ReadWrite); * store.Add(new X509Certificate2(X509Certificate2.CreateFromCertFile(file))); * store.Close();*/ //X509Certificate2 Cert = new X509Certificate2(); //string file = "C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/certificate.pkcs12"; // Contains name of certificate file //Cert.Import(file, "123", X509KeyStorageFlags.PersistKeySet); //request.ClientCertificates.Add(Cert); /*string file = "C:/Users/Dragos/source/repos/WindowsFormsApp1/node/security/rootCA.pem"; * X509Certificate2 mycert = new X509Certificate2(); * mycert.Import(file, "cert112", X509KeyStorageFlags.PersistKeySet); * request.ClientCertificates.Add(mycert);*/ request.AutomaticDecompression = DecompressionMethods.GZip; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream)) { html = reader.ReadToEnd(); } Console.WriteLine(html); if (html == "Baza de date offline") { MessageBox.Show("Baza de date offline"); } else { try { //Console.WriteLine(html); var resultscan = JsonConvert.DeserializeObject <List <RootObject> >(html); try { obj = resultscan[0]; bool vf; Console.WriteLine(obj.password); vf = SecurePasswordHasher.Verify(txtpass.Text, obj.password); if (vf) { name = obj.username; if (obj.admin == 1) { using (Form5 f5 = new Form5()) { this.Hide(); f5.ShowDialog(this); this.Close(); } } else if (obj.admin == 0) { using (Form8 f8 = new Form8()) { this.Hide(); f8.ShowDialog(this); this.Close(); } /* * AppCointainer container = new AppCointainer(); * container.Tabs.Add( * new TitleBarTab(container) * { * Content = new Form6 * { * Text= "New Tab" * } * } * ); * * container.SelectedTabIndex = 0; * this.Hide(); * TitleBarTabsApplicationContext applicationContext = new TitleBarTabsApplicationContext(); * applicationContext.Start(container); */ } else { using (Form4 f4 = new Form4()) { this.Hide(); f4.ShowDialog(this); this.Close(); } } } else { MessageBox.Show("Nume de utilizator sau parola incorecta."); } } // catch { MessageBox.Show("Nume de utilizator sau parola incorecta."); } } catch { MessageBox.Show("A cazut serverul."); } } } catch { MessageBox.Show("A cazut serverul"); } // RootObject obj= JsonConvert.DeserializeObject<RootObject>(html); }
private void button26_Click(object sender, EventArgs e) { Form8 form8 = new Form8(); form8.Show(); }
private void button8_Click(object sender, EventArgs e) { var error8Form = new Form8(); error8Form.Show(); }