Esempio n. 1
0
        protected void btnGetEmployee_Click(object sender, EventArgs e)
        {
            EmployeeService.IEmployeeService client = new EmployeeService.EmployeeServiceClient();

            EmployeeService.EmployeeRequest request = new EmployeeService.EmployeeRequest("sqfqsfsqdf", Convert.ToInt32(txtID.Text));

            EmployeeService.EmployeeInfo employeeInfo = client.GetEmployeeInfo(request);
            txtName.Text        = employeeInfo.Name;
            txtGender.Text      = employeeInfo.Gender;
            txtDateOfBirth.Text = employeeInfo.DOB.ToShortDateString();

            if (employeeInfo.Type == EmployeeService.EmployeeType.FullTimeEmployee)
            {
                txtAnnualSalary.Text   = employeeInfo.AnnualSalary.ToString();
                trAnnualSalary.Visible = true;
                trHourlPay.Visible     = false;
                trHoursWorked.Visible  = false;
            }
            else
            {
                txtHourlyPay.Text      = employeeInfo.HourlyPay.ToString();
                txtHoursWorked.Text    = employeeInfo.HoursWorked.ToString();
                trAnnualSalary.Visible = false;
                trHourlPay.Visible     = true;
                trHoursWorked.Visible  = true;
            }
            ddlEmployeeType.SelectedValue = ((int)employeeInfo.Type).ToString();
            lblMessage.Text = "Employee retrieved";
        }