private void renkAlToolStripMenuItem_Click(object sender, EventArgs e) { Form2 renkformu = new Form2(); renkformu.ShowDialog(); }
// botao log private void button1_Click(object sender, EventArgs e) { Form2 testelog = new Form2(); testelog.ShowDialog(); }
private void buscar_Click(object sender, EventArgs e) { Form2 obj = new Form2(); obj.ShowDialog(); }
private void button1_Click_2(object sender, EventArgs e) { Form2 f2 = new Form2(); f2.ShowDialog(); }
private void button25_Click(object sender, EventArgs e) { Form2 formTest = new Form2(this); formTest.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { textBox6.Clear(); f2.ShowDialog(); this.textBox1.Text = f2.textBox1.Text; this.textBox2.Text = f2.dateTimePicker1.Text; this.textBox3.Text = f2.textBox2.Text; int chis = Convert.ToInt16(f2.textBox2.Text); string mes = ""; if (f2.comboBox2.Text == "Месяцев") { switch (chis) // подбор падежей { case 1: case 21: case 31: case 41: case 51: case 61: case 71: case 81: case 91: mes = "Месяц"; break; case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: case 62: case 63: case 64: case 72: case 73: case 74: case 82: case 83: case 84: case 92: case 93: case 94: mes = "Месяца"; break; default: mes = "Месяцев"; break; } } else if (f2.comboBox2.Text == "Лет") { switch (chis) // подбор падежей { case 1: case 21: case 31: case 41: case 51: case 61: case 71: case 81: case 91: mes = "Год"; break; case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: case 62: case 63: case 64: case 72: case 73: case 74: case 82: case 83: case 84: case 92: case 93: case 94: mes = "Года"; break; default: mes = "Лет"; break; } } textBox7.Text = mes; this.textBox4.Text = f2.comboBox1.Text; this.textBox5.Text = f2.comboBox3.Text; int sum = Convert.ToInt32(textBox1.Text); var vid = textBox4.Text; int num = Convert.ToInt32(textBox3.Text); string valut = textBox5.Text; if (vid == "Аннуитетный") { Ann(); } else if (vid == "Дифференцированный") { Diff(); } if (f2.textBox1.Text == "1") { textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox7.Clear(); textBox6.Clear(); } f2.textBox1.Clear(); f2.textBox2.Clear(); }
private void калибровкаToolStripMenuItem_Click(object sender, EventArgs e) => f2.ShowDialog();
private void FindNumbersToolStripMenuItem_Click(object sender, EventArgs e) { Form2 form2 = new Form2(); form2.ShowDialog(); }
static void Main() { //Important: Tls 1.0 is no longer supported! Please use the next line of code for compatibilty settings or select the most recent .NET Framework for this project! ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; //Sets the maximum number of concurrent connections allowed by a ServicePoint object. ServicePointManager.DefaultConnectionLimit = 10; var baseURI = @"https://sageb7.d-velop.cloud//"; //basic http client with base uri and default headers Cookies = new CookieContainer(); HttpClientHandler handler = new HttpClientHandler(); handler.CookieContainer = Cookies; Client = new HttpClient(handler); Client.BaseAddress = new Uri(baseURI); Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MEDIA_TYPE_HAL_JSON)); Client.DefaultRequestHeaders.Add("Origin", baseURI); //api key of a valid d.3one account. If not available use basic authentication with username and password as described below // var apiKey = <apiKey>; //id of the repository. In instance tp-dev.d-velop.cloud use: "44330b47-508c-58bd-9109-cedd2c31e418" //sagebaeurer: var repoId = @"67b49a02-4e84-5701-8aa5-0805bd7fc9ec"; var repoId = @"26044701-ef54-4347-b7bf-3e7ed477613a"; //using apiKey authentication is recommended! In this case call replace placeholders for username with empty string "" and password with the apiKey //to authenticate with user credentials and base authentication: replace placeholders for username and password //var apiKey = AuthenticateBasic(baseURI, "<empty or username>", "kJsCtBtEsrx5teQ3JiUg7mqYzCp1pRcAa2hSIW0ozgqyZdi0V0FhlQgPatAh+7UteD2SvSJR3KiRDNZ0yF7oogFgcZkSX6+rD4hBxmltzng=&_z_A0V5ayCRJ8vFCcqHo-d0n6vglZkcADkhzeOu3BE5xohC0XlB3aGLkJ5AXEChCcadfk_1jt0pSfhME1_TyoMHI9IE0WhAQ").Result; // sagebaeurer: string apiKey = "tPVIXp31F/d4jXbtoiw29U5wIkdmT5iq/VVYQswgTlO+2NOdHPnginWW7vlDt0aBR/L/qOgPS55vhIc0Wb8BfuY3Zw7PIs2D2xfe4Rt9PxE=&_z_A0V5ayCQp3VhDD9r6HqVyJ7sE4VNPab_wxYQjyS_0sjeNWNWYIAk4C8emixW-bUjV27U5R24Gy2sDoih0DCU74hiSZ1p9"; //test-dbar10: string apiKey = "Iv2uojEVFi25c5dBRbzv205zoS8u/V4UlEboTvUzHdByNDkkKKoh/TiBYUQKuXd/n+Y9qK9dcFoUXTywOu+pGrrLYG9GEaHNoM/Tx451PBk=&_z_A0V5ayCRqVfPqk0Owd2NZdAbpPuodbDIhgLaYuianesLWypqrxEQ3VYrxzrwv_hzrdYe-YqJMVAzQC5pB0gvDrL1F22EK"; //******************************************************************* //for all further api calls use the returned key as Bearer-Token! //******************************************************************* // Requirement: Use current web browser version for the browser control //https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)#browser-emulation //Install ChromiumWebbrowser //https://www.codeproject.com/Articles/881315/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 frmIE = new Form1(); Form2 frmChrome = new Form2(); var sessionId = Authenticate(baseURI, apiKey); byte[] authData = System.Text.UnicodeEncoding.UTF8.GetBytes("user:"******"Authorization: Basic " + Convert.ToBase64String(authData) + "\r\nOrigin: " + baseURI + "\r\n"; //string redirect = HttpUtility.UrlEncode("/dms/r/" + repoId + "/sr/?" + "properties=" + HttpUtility.UrlEncode("{\"23\":[\"1\"]}") + "&propertysort=property_last_modified_date&ascending=false&showdetails=false"); string redirect = HttpUtility.UrlEncode("/dms/r/" + repoId + "/sr"); frmIE.Navigate(baseURI + "/identityprovider/login?basic=true&redirect=" + redirect, authHeader); frmIE.Show(); sessionId = Authenticate(baseURI, apiKey); //redirect = HttpUtility.UrlEncode("/dms/r/" + repoId + "/sr/?" + "properties=" + HttpUtility.UrlEncode("{\"23\":[\"1\"]}") + "&propertysort=property_last_modified_date&ascending=false&showdetails=false"); redirect = HttpUtility.UrlEncode("/dms/r/" + repoId + "/sr"); frmChrome.Navigate(baseURI + "/identityprovider/login?basic=true&redirect=" + redirect, sessionId); frmChrome.ShowDialog(); //Application.Run(); }
private void button1_Click(object sender, EventArgs e) { if (button1.Text == "Dodaj") { Form2 form2 = new Form2(eventAggregator, treeView1.SelectedNode.Text); form2.ShowDialog(); } else if (button1.Text == "Zmień") { string firstName = dataGridView1.Rows[0].Cells[0].Value.ToString(); string lastName = dataGridView1.Rows[0].Cells[1].Value.ToString(); string addres = dataGridView1.Rows[0].Cells[2].Value.ToString(); Person personToRemove = null; bool fromTutors = false; List <Person> Tutors = DataBase.getTutors(); foreach (Person person in Tutors) { if (person.getAddres() == addres && person.getFirstName() == firstName && person.getLastName() == lastName) { option = "Wykładowca"; personToRemove = person; fromTutors = true; } } List <Person> Students = DataBase.getStudents(); foreach (Person person in Students) { if (person.getAddres() == addres && person.getFirstName() == firstName && person.getLastName() == lastName) { option = "Student"; personToRemove = person; } } if (fromTutors) { DataBase.removeTutor(personToRemove); } else { DataBase.removeStudent(personToRemove); } dataGridView1.ReadOnly = false; button1.Text = "Zapisz"; } else if (button1.Text == "Zapisz") { string firstName = dataGridView1.Rows[0].Cells[0].Value.ToString(); string lastName = dataGridView1.Rows[0].Cells[1].Value.ToString(); string addres = dataGridView1.Rows[0].Cells[2].Value.ToString(); Person person = new Person(firstName, lastName, addres); if (option == "Student") { DataBase.addStudent(person); } else if (option == "Wykładowca") { DataBase.addTutor(person); } eventAggregator.RaiseNotification <ModifyUserNotification>(new ModifyUserNotification(person)); dataGridView1.ReadOnly = true; button1.Text = "Zmień"; } }
private void Button1_Click(object sender, EventArgs e) { if ((textBox3.Text == "") || (textBox4.Text == "") || (textBox1.Text == "") || (textBox2.Text == "")) { MessageBox.Show("Одно или несколько полей не заполнены"); } else if (textBox1.Text != textBox2.Text) { MessageBox.Show("Пароли не совпадают"); } else { Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("type", "api"); data.Add("action", "reg"); data.Add("nick", textBox4.Text); data.Add("pass", Service.md5(textBox1.Text)); data.Add("email", textBox3.Text); string answer; string json = JsonConvert.SerializeObject(data, Formatting.Indented); try { answer = Service.SendRequestAndGetAnswer(json); } catch { MessageBox.Show("Ошибка соединения с сервером\n Повторите позже", "Botinok.fun", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int ans = int.Parse(answer); string text = ""; if (ans >= 0) { MessageBox.Show("Пользователь успешно зарегистрирован"); Hide(); Form2 hf = new Form2(); hf.ShowDialog(); Close(); } else if (ans == -2) { text = "Некорректный email"; } else if (ans == -3) { text = "Некорректный ник"; } else if (ans == -4) { text = "Пользователь с указанным email уже существует"; } else if (ans == -5) { text = "Пользователь с указанным ником уже существует"; } else { text = "Ошибка сервера\n Повторите позже"; } if (text != "") { MessageBox.Show(text, "Botinok.fun", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void button1_Click(object sender, EventArgs e) { Form2 fm = new Form2(); DialogResult dialogResult2 = fm.ShowDialog(); }
public Form1( ) { InitializeComponent(); form2.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { Form2 form = new Form2(); form.ShowDialog(); }
private void ucBtnExt2_BtnClick(object sender, EventArgs e) { Form2 form2 = new Form2(); form2.ShowDialog(); }
private void Button2_Click(object sender, EventArgs e) { Form2 frmMarcas = new Form2(); frmMarcas.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { readmbr(); SafeFileHandle handle = CreateFile( lpFileName: @"\\.\" + textBox3.Text + ":", dwDesiredAccess: FileAccess.Read, dwShareMode: FileShare.ReadWrite, lpSecurityAttributes: IntPtr.Zero, dwCreationDisposition: System.IO.FileMode.OpenOrCreate, dwFlagsAndAttributes: FileAttributes.Normal, hTemplateFile: IntPtr.Zero); using (FileStream disk = new FileStream(handle, FileAccess.Read)) { mbrData = new byte[512]; disk.Read(mbrData, 0, 512); } handle = CreateFile( lpFileName: @"\\.\" + textBox3.Text + ":", dwDesiredAccess: FileAccess.Write, dwShareMode: FileShare.ReadWrite, lpSecurityAttributes: IntPtr.Zero, dwCreationDisposition: System.IO.FileMode.OpenOrCreate, dwFlagsAndAttributes: FileAttributes.Normal, hTemplateFile: IntPtr.Zero); string oldpassword = magik(textBox1.Text); int error_num = 0; for (int j = 0; j < oldpassword.Length; j++) { if (buffer0sector[384 + j] != (byte)oldpassword[j]) { error_num++; textBox1.SelectAll(); textBox1.Focus(); } } if (error_num == 0) { Hide(); Form Form2 = new Form2(); Form2.ShowDialog(); Close(); } else { MessageBox.Show("Старый пароль введён неверно!"); check--; label3.Text = "осталось попыток: " + check; } if (check == 0) { Close(); } }