private void btnDelete_Click(object sender, EventArgs e) { if (txtID.Text.Any() == false || txtName.Text.Any() == false) { MessageBox.Show("Enter a valid Name and ID"); return; } string name, id; name = txtName.Text; id = txtID.Text; //Employee Manag = new Employee(); Manager Manag = Manager.Instance; if (Manag.deleteEmployee(name, id) == true) { MessageBox.Show(" Done "); } else { MessageBox.Show("This employee is not found!"); } this.Visible = false; Form14 f14 = new Form14(); f14.Visible = true; }
private void btnCancel_Click(object sender, EventArgs e) { this.Visible = false; Form14 F14 = new Form14(); F14.Visible = true; }
private void btnAdd_Click(object sender, EventArgs e) { string name; string phone; string address; string position; string college; int graduationYear; int iD; string totalgrade; if (txtAddress.Text.Any() == false || txtName.Text.Any() == false || txtPhone.Text.Any() == false || txtID.Text.Any() == false || ComboxPosition.SelectedItem == null || txtCollege.Text.Any() == false || ComboxDegree.SelectedItem == null || txtYear.Text.Any() == false) { MessageBox.Show("Make sure you enter all data"); return; } name = txtName.Text; iD = int.Parse(txtID.Text); address = txtAddress.Text; phone = txtPhone.Text; college = txtCollege.Text; graduationYear = int.Parse(txtYear.Text); totalgrade = ComboxDegree.Text; position = ComboxPosition.Text; Employee emp = new Employee(name, iD, address, phone, college, graduationYear, totalgrade, position); emp.add(); MessageBox.Show("Successfully Added "); this.Visible = false; Form14 f14 = new Form14(); f14.Visible = true; }
private void BtnLogin_Click_1(object sender, EventArgs e) { if (txtID.Text.Any() == false || txtName.Text.Any() == false) { MessageBox.Show("Please enter a valid User Name and ID!"); return; } string name; int id; name = txtName.Text; id = int.Parse(txtID.Text); Registration register = new Registration(); Employee ay_7aga = register.Log_in(name, id); if (ay_7aga.Name == name && ay_7aga.ID == id) { if (ay_7aga.Position == "Manager") { this.Visible = false; Form14 f14 = new Form14(); f14.Visible = true; } else { this.Visible = false; Form3 f3 = new Form3(); f3.Visible = true; } } else { MessageBox.Show("You have Entered incorrect User Name or ID "); return; } }