protected void saveEmployee(object sender, EventArgs e) { EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); EmployeeService.Employee employee = new EmployeeService.Employee(); employee.Id = Convert.ToInt32(txtId.Text); employee.Name = txtName.Text; employee.Gender = txtGender.Text; employee.DateOfBirth = Convert.ToDateTime(txtDateOfBirth.Text); client.SaveEmployee(employee); }
protected void btnSave_Click(object sender, EventArgs e) { EmployeeService.Employee employee = new EmployeeService.Employee(); employee.Id = Convert.ToInt32(txtID.Text); employee.Name = txtName.Text; EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient(); client.SaveEmployee(employee); lblMessage.Text = "Employee saved"; }
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"; }