コード例 #1
0
        protected void btnSaveEmployee_Click(object sender, EventArgs e)
        {
            EmployeeServiceHttp.EmployeeInfo employee = new EmployeeServiceHttp.EmployeeInfo();
            employee.ID     = Convert.ToInt32(tbId.Text);
            employee.Name   = tbName.Text;
            employee.DOB    = Convert.ToDateTime(tbDateOfBirth.Text);
            employee.Gender = tbGender.Text;

            EmployeeServiceHttp.IEmployeeService client = new EmployeeServiceHttp.EmployeeServiceClient();
            client.SaveEmployee(employee);

            lblMessage.Text = "Employee is Saved !!";
        }
コード例 #2
0
        protected void btnGetEemployee_Click(object sender, EventArgs e)
        {
            EmployeeServiceHttp.IEmployeeService client  = new EmployeeServiceHttp.EmployeeServiceClient();
            EmployeeServiceHttp.EmployeeRequest  request =
                new EmployeeServiceHttp.EmployeeRequest(Convert.ToInt32(tbId.Text), "XxYyZz1AaBbCc");
            EmployeeServiceHttp.EmployeeInfo employee = client.GetEmployee(request);

            tbName.Text        = employee.Name;
            tbGender.Text      = employee.Gender;
            tbDateOfBirth.Text = employee.DOB.ToShortDateString();

            lblMessage.Text = "Employee retrieved";
        }