protected void getEmployee(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.Employee employee = client.GetEmployee(Convert.ToInt32(txtId.Text)); txtName.Text = employee.Name; txtGender.Text = employee.Gender; txtDateOfBirth.Text = employee.DateOfBirth.ToShortDateString(); Label4.Text = "Employee retrieved"; }
protected void btnGetEmployee_Click(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.Employee employee = client.GetEmployee(Convert.ToInt32(txtID.Text)); txtName.Text = employee.Name; lblMessage.Text = "Employee retrieved"; }
protected void btnGetEmployee_Click(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.EmployeeEntity employee = client.GetEmployee(Convert.ToInt32(txtID.Text)); if (employee == null) { lblMessage.Text = "Employee does not exist"; } else { txtName.Text = employee.Name; txtGender.Text = employee.Gender; txtDateOfBirth.Text = employee.DateOfBirth.ToShortDateString(); lblMessage.Text = "Employee retrieved"; } }
protected void btnGetEmployee_Click(object sender, EventArgs e) { EmployeeService.IEmployeeService client = new EmployeeService.EmployeeServiceClient(); EmployeeService.EmployeeRequest request = new EmployeeService.EmployeeRequest("AXG120ABC", Convert.ToInt32(txtID.Text)); EmployeeService.EmployeeInfo employee = client.GetEmployee(request); if (employee.Type == EmployeeService.EmployeeType.Null) { lblMessage.Text = "Employee does not exist"; } else { if (employee.Type == EmployeeService.EmployeeType.FullTimeEmployee) { txtAnnualSalary.Text = employee.AnnualSalary.ToString(); trAnnualSalary.Visible = true; trHourlPay.Visible = false; trHoursWorked.Visible = false; } else { txtHourlyPay.Text = employee.HourlyPay.ToString(); txtHoursWorked.Text = employee.HoursWorked.ToString(); trAnnualSalary.Visible = false; trHourlPay.Visible = true; trHoursWorked.Visible = true; } ddlEmployeeType.SelectedValue = ((int)employee.Type).ToString(); txtName.Text = employee.Name; txtGender.Text = employee.Gender; txtDateOfBirth.Text = employee.DOB.ToShortDateString(); lblMessage.Text = "Employee retrieved"; } }