コード例 #1
0
ファイル: HRService.cs プロジェクト: kejto/HRApp
 public bool InsertEmployee(EmployeeSalary employeeSalary)
 {
     using (var db = new HRServiceContext())
     {
         db.Employees.Add(MapToEmployee(employeeSalary));
         db.SaveChanges();
         return true;
     }
 }
コード例 #2
0
ファイル: HRService.cs プロジェクト: kejto/HRApp
 private Employee MapToEmployee(EmployeeSalary employeeSalary)
 {
     return new Employee
     {
         EmployeeId = employeeSalary.EmployeeId,
         EmailAddress = employeeSalary.EmailAddress,
         FirstName = employeeSalary.FirstName,
         LastName = employeeSalary.LastName,
         SupervisorId = employeeSalary.SupervisorId,
         Salary = new Salary { SalaryValue = employeeSalary.Salary }
     };
 }
コード例 #3
0
ファイル: TestBaseSetup.cs プロジェクト: kejto/HRApp
        public virtual void TestSetup()
        {
            Service = new HRService();
            FakeEmployeeSalary = new EmployeeSalary()
            {
                EmailAddress = "*****@*****.**",
                EmployeeId = 1,
                FirstName = "asd",
                LastName = "asd",
                SupervisorId = null,
                Salary = 2000
            };

            FakeEmployee = new Employee()
            {
                EmailAddress = "*****@*****.**",
                EmployeeId = 1,
                FirstName = "asd",
                LastName = "asd",
                SupervisorId = null
            };

            FakeEmployeeList = new List<EmployeeSalary>
                                   {
                                       FakeEmployeeSalary,
                                       new EmployeeSalary()
                                           {
                                               EmailAddress = "*****@*****.**",
                                               EmployeeId = 2,
                                               FirstName = "asd1",
                                               LastName = "asd1",
                                               SupervisorId = 1,
                                               Salary = 3000
                                           }
                                   };

            FakeSalary = new Salary() { EmployeeId = 1, SalaryValue = 2000 };
            FakeSalary = new Salary() { EmployeeId = 2, SalaryValue = 3000 };
        }
コード例 #4
0
ファイル: HRService.cs プロジェクト: kejto/HRApp
 public bool CallInsertEmployee(EmployeeSalary product)
 {
     return _client.InsertEmployee(product);
 }