static void Main(string[] args) { filecreation.serialize(); filecreation.filecreate(); PrintAlphabets.alpha(); PrintAlphabets.WriteAlpha(); first: StartPage.Welcome(); int response = Convert.ToInt32(Console.ReadLine()); if (response == 1) { Attentance.attend1(); } if (response == 2) { Teachers t1 = new Teachers(); t1.teacherdata(); } if (response == 3) { Marks.mark(); Console.ReadLine(); } if (response == 4) { Console.WriteLine("Staffs Login"); Console.WriteLine("\n Enter your User Id"); var response1 = Console.ReadLine(); Console.WriteLine("Enter your Password"); var response2 = Console.ReadLine(); Console.WriteLine("to you want to filter salary, If yes press 100"); var response100 = Convert.ToInt32(Console.ReadLine()); if (response100 == 100) { Teachers.FilterSalary(); Console.ReadLine(); } if (response1 == "ashwin" && response2 == "pass" || response1 == "kumar" && response2 == "pass1" || response1 == "admin" && response2 == "admin") { //Teachers t1 = new Teachers(); Teachers.TeacherPersonaldata(); Console.ReadLine(); } else { Console.WriteLine("Invalid User"); Console.ReadLine(); } } Console.WriteLine("PRESS 'YES' IF YOU WANT TO CONTINUE"); var yes = Console.ReadLine(); if (yes == "YES" || yes == "yes") { goto first; } }
private void listViewMarks_SelectedIndexChanged(object sender, EventArgs e) { if (listViewMarks.SelectedItems.Count == 1) { Marks marks = listViewMarks.SelectedItems[0].Tag as Marks; comboBoxStudents.SelectedIndex = comboBoxStudents.FindString(marks.id_student.ToString()); comboBoxSubjects.SelectedIndex = comboBoxSubjects.FindString(marks.id_subject.ToString()); textBoxMark.Text = marks.mark.ToString(); } }
private void buttonAdd_Click(object sender, EventArgs e) { if (comboBoxStudents.SelectedItem != null && comboBoxSubjects.SelectedItem != null && textBoxMark.Text != "") { Marks marks = new Marks(); marks.id_student = Convert.ToInt32(comboBoxStudents.SelectedItem.ToString().Split(':')[0]); marks.id_subject = Convert.ToInt32(comboBoxSubjects.SelectedItem.ToString().Split(':')[0]); marks.mark = Convert.ToInt32(textBoxMark.Text); Program.DB.Marks.Add(marks); Program.DB.SaveChanges(); ShowMarks(); } }
private void buttonEdit_Click(object sender, EventArgs e) { if (listViewMarks.SelectedItems.Count == 1) { if (comboBoxStudents.SelectedItem != null && comboBoxSubjects.SelectedItem != null && textBoxMark.Text != "") { Marks marks = listViewMarks.SelectedItems[0].Tag as Marks; marks.id_student = Convert.ToInt32(comboBoxStudents.SelectedItem.ToString().Split(':')[0]); marks.id_subject = Convert.ToInt32(comboBoxSubjects.SelectedItem.ToString().Split(':')[0]); marks.mark = Convert.ToInt32(textBoxMark.Text); Program.DB.SaveChanges(); ShowMarks(); } } }
private void buttonDel_Click(object sender, EventArgs e) { try { if (listViewMarks.SelectedItems.Count == 1) { Marks marks = listViewMarks.SelectedItems[0].Tag as Marks; Program.DB.Marks.Remove(marks); Program.DB.SaveChanges(); ShowMarks(); } } catch { MessageBox.Show("Поле используется!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }