Exemplo n.º 1
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            //EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient();
            EmployeeService.IEmployeeService client = new EmployeeService.EmployeeServiceClient();
            EmployeeService.EmployeeInfo employee = new EmployeeService.EmployeeInfo();

            int _Id = Convert.ToInt32(TxtEmployeeID.Text);
            DateTime _DateOfBirth = Convert.ToDateTime(TxtEmployeeDateOfBirth.Text.ToString());
            EmployeeService.EmployeeType _Type = ((EmployeeService.EmployeeType)Convert.ToInt32(CbxEmployeeType.SelectedValue.ToString()));

            if (((EmployeeService.EmployeeType)(Convert.ToInt32(CbxEmployeeType.SelectedValue))) == EmployeeService.EmployeeType.FullTimeEmployee)
            {
                employee.AnnualSalary = Convert.ToInt32(TxtAnnualSalary.Text.ToString());
            }
            else if(((EmployeeService.EmployeeType)Convert.ToInt32(CbxEmployeeType.SelectedValue)) == EmployeeService.EmployeeType.PartTimeEmployee)
            {
                employee.HourlyPay = Convert.ToInt32(TxtHourlyPay.Text);
                employee.HoursWorked = Convert.ToInt32(TxtHoursWorked.Text);
            }
            else
            {

            }

            employee.Id = _Id;
            employee.Name = TxtEmployeeName.Text.ToString();
            employee.DOB = _DateOfBirth;
            employee.Type = _Type;

            client.SetEmployee(employee);
        }
Exemplo n.º 2
0
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            EmployeeService.EmployeeServiceClient client = new EmployeeService.EmployeeServiceClient();
            EmployeeService.Employee employee = new EmployeeService.Employee();

            employee.Id = Convert.ToInt32(TxtEmployeeID.Text);
            employee.Name = TxtEmployeeName.Text.ToString();
            employee.DateOfBirth = Convert.ToDateTime(TxtEmployeeDateOfBirth.Text);

            client.SetEmployee(employee);
        }