private void SelectPermission(object sender, EventArgs e) { if (!loadingyafool && (sender as ComboBox).SelectedIndex != -1) { cfg.SetKey("Permission" + (sender as ComboBox).Name.Replace("comboBox", ""), (sender as ComboBox).SelectedIndex.ToString()); MessageBox.Show("ההרשאה שונתה בהצלחה.", "הרשאות", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button15_Click(object sender, EventArgs e) { MaskedTextBox[] texts = { maskedTextBox1, maskedTextBox2, maskedTextBox3, maskedTextBox4, maskedTextBox5 }; CheckBox[] checks = { checkBox1, checkBox2, checkBox3, checkBox4, checkBox5 }; ComboBox[] cb = { comboBox4, comboBox5, comboBox6, comboBox7, comboBox8 }; int total = 0; for (int i = 0; i < texts.Length; i++) { texts[i].Text = Classes.App.IntBase(Convert.ToInt32(texts[i].Text), 3); total += Convert.ToInt32(texts[i].Text); } bool flag = false; for (int i = 0; i < 5 && !flag; i++) { if (cb[i].SelectedIndex == -1 && checks[i].Checked) { flag = true; } } if (flag) { Classes.App.Error("לא בחרת אפשרות לכל שורות האחוזים המאופשרות."); } else { if (total == 100) { Classes.INI cal = new Classes.INI(AppFile.GetFile(AppFile.CALCULATION)); for (int i = 0; i < 5; i++) { cal.SetKey("Slot" + (i + 1), checks[i].Checked ? (texts[i].Text + ";" + calcode[cb[i].SelectedIndex]) : "None"); } MessageBox.Show("החישוב לציונים יורכב מהאחוזים שציינת.\r\nבנוסף החישוב נשמר בהצלחה.", "הנפקת תעודות", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Classes.App.Error("עליך להרכיב 100 אחוזים."); } } }
private void button1_Click(object sender, EventArgs e) { Classes.INI cfg = new Classes.INI(AppFile.GetFile(AppFile.CONFIG)); cfg.SetKey("Off", checkBox1.Checked ? textBox1.Text : "?"); }