private void AddUnitEmployee(string personId)
 {
     foreach (var selectedUnit in SelectedUnits)
     {
         //Assumes that assigning physicians to their respective facilities are on the same date/time
         //as their registration to the system
         var newUnitEmployee = new UnitEmployee
         {
             WorkUnitId   = selectedUnit.WorkUnitId,
             EmployeeId   = personId,
             DateAssigned = DateTime.Now
         };
         _unitEmployeeService.AddUnitEmployee(newUnitEmployee);
     }
 }
示例#2
0
        public void AddUnitEmployeeTest()
        {
            var serv = new UnitEmployeeService(new MVCHContext());

            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000001",
                EmployeeId   = "PER-000031",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000002",
                EmployeeId   = "PER-000032",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000003",
                EmployeeId   = "PER-000033",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000004",
                EmployeeId   = "PER-000034",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000005",
                EmployeeId   = "PER-000035",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000006",
                EmployeeId   = "PER-000036",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000007",
                EmployeeId   = "PER-000037",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000008",
                EmployeeId   = "PER-000038",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000009",
                EmployeeId   = "PER-000039",
                DateAssigned = DateTime.Now
            });
            serv.AddUnitEmployee(new UnitEmployee
            {
                WorkUnitId   = "WKS-000010",
                EmployeeId   = "PER-000040",
                DateAssigned = DateTime.Now
            });
        }