private void button1_Click(object sender, EventArgs e) { ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); ServiceReference1.Employee emp = client.Search(name.Text); if (emp != null) { int eid = emp.EmployeeID; ServiceReference1.Leave leave = client.GetLeave(eid); if (leave != null) { client.DeleteLeave(eid); } bool del = client.Delete(name.Text); if (del == true) { label2.Text = "Deleted successfully"; } else { label2.Text = "Enter a valid name"; } } else { label2.Text = "Enter a valid name"; } }
public CheckStatus() { InitializeComponent(); int eid = Login.sessionId; client = new ServiceReference1.Service1Client(); ServiceReference1.Employee emp = client.GetEmployee(eid); string name = emp.Fullname; List <ServiceReference1.Leave> leave = client.GetLeavesemp(name).ToList(); if (leave != null) { dataGridView1.DataSource = leave; /*type.Text = leave.Type; * status.Text = leave.Status; * des.Text = leave.Description; * if (leave.Status == "Approve") * { * label2.Text = "Congratulations"; * } * if (leave.Status == "Decline") * { * label2.Text = "Better luck next time"; * } * else * { * label2.Text = "Internal Error"; * }*/ } else { label2.Text = "No leaves requested"; } }
private void button1_Click(object sender, EventArgs e) { ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); ServiceReference1.Employee emp = client.auth(email.Text, pwd.Text); if (emp != null) { Login.sessionId = emp.EmployeeID; client.setEmployee(emp); if (emp.Role == "Admin") { this.Hide(); Index index = new Index(); index.ShowDialog(); } if (emp.Role == "Employee") { label5.Text = emp.Fullname + "have succesfully logged in"; this.Hide(); EmployeeLeave el = new EmployeeLeave(); el.ShowDialog(); } else { label5.Text = "Enter valid credentials"; } } else { label5.Text = "Enter valid credentials"; } }
private void button1_Click(object sender, EventArgs e) { ServiceReference1.Employee emp = new ServiceReference1.Employee(); emp.Email = email.Text; emp.Fullname = name1.Text; emp.Experience = exp.Text; emp.Phone = phn.Text; emp.Qualification = qual.Text; client.Update(name.Text, emp); label2.Text = "updated successfully"; }
private void button2_Click(object sender, EventArgs e) { ServiceReference1.Employee emp = client.Search(name.Text); if (emp != null) { name1.Text = emp.Fullname; email.Text = emp.Email; qual.Text = emp.Qualification; exp.Text = emp.Experience; phn.Text = emp.Phone; } else { label2.Text = "Invalid name"; } }
private void button1_Click(object sender, EventArgs e) { ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); ServiceReference1.Employee emp = new ServiceReference1.Employee(); emp.Fullname = name.Text; emp.Email = email.Text; emp.Password = pwd.Text; emp.Phone = phn.Text; emp.Qualification = qual.Text; emp.Experience = exp.Text; emp.Role = comboBox1.Text; label5.Text = client.Register(emp).ToString(); this.Hide(); Login of = new Login(); of.ShowDialog(); }