コード例 #1
0
ファイル: Client.cs プロジェクト: tian1ll1/WPF_Examples
        static void Main()
        {
            // Create a proxy with given client endpoint configuration
            PersonnelDataServiceClient client = new PersonnelDataServiceClient();

            // Call the AddEmployee service operation.
            Employee newEmployee = new Employee();
            newEmployee.dateHired = new DateTime(2004, 6, 10);
            newEmployee.salary = 100;
            newEmployee.person = new Person();
            newEmployee.person.FirstName = "Foo";
            newEmployee.person.LastName = "Barman";
            newEmployee.person.Age = 21;
            client.AddEmployee(newEmployee);

            // Verify if employee was added by doing a search by first name.
            Employee employee = client.GetEmployee("Foo");
            Console.WriteLine("GetEmployee(Foo) : {0}", (employee == null ? "not found" : "found"));

            client.Close();

            Console.WriteLine();
            Console.WriteLine("Press <ENTER> to terminate client.");
            Console.ReadLine();
        }
コード例 #2
0
ファイル: Service.cs プロジェクト: tian1ll1/WPF_Examples
 public void AddEmployee(Employee employee)
 {
     employees.Add(employee.person.firstName, employee);
 }
コード例 #3
0
 public void AddEmployee(Microsoft.Samples.DCSurrogate.Employee employee)
 {
     base.Channel.AddEmployee(employee);
 }