public SimDevice SetUpInsertDataForCase18() { // Sim var sim = new Sim { Msisdn = "02017911000", Imsi = "440103213100000", IccId = "8981100005819480000", SimGroup = _simGroup, Password = "******", UserName = "******" }; var device = new AdDevice { DeviceName = "Device1", Imei = "352555093320000", ManageNumber = "DeviceManager1", Type = "DeviceType1", Lte = _lte, DeviceGroup = _deviceGroup, Domain = _domain }; var simDevice = new SimDevice { Sim = sim, Device = device, Nw2IpAddressPool = "Nw2Address", StartDay = DateTime.Now.AddHours(-6.00), AuthPeriod = 1 }; _mainDbContext.AddRange(sim, device, simDevice); _mainDbContext.SaveChanges(); return(simDevice); }
////////////////////////////// //// Setup methods private SimDevice SetUpInsertDataForCase13() { // Device var device = new AdDevice { DeviceName = "Device1", Imei = "352555093320000", ManageNumber = "DeviceManager1", Type = "DeviceType1", Lte = _lte, DeviceGroup = _deviceGroup, Domain = _domain }; _mainDbContext.Device.Add(device); // Sim var sim = new Sim { Msisdn = "02017911000", Imsi = "440103213100000", IccId = "8981100005819480000", SimGroup = _simGroup, Password = "******", UserName = "******" }; _mainDbContext.Sim.Add(sim); // authentication var simDevice = new SimDevice { Sim = sim, Device = device, Nw2IpAddressPool = "Nw2Address", StartDay = DateTime.Now.AddHours(-6.00), EndDay = DateTime.Now.AddHours(6.00), AuthPeriod = 1 }; var simDeviceAuthenticationStateDone = new SimDeviceAuthenticationStateDone { SimDevice = simDevice, TimeLimit = DateTime.Now.AddHours(-1.00) }; _mainDbContext.SimDevice.Add(simDevice); _mainDbContext.SimDeviceAuthenticationStateDone.Add(simDeviceAuthenticationStateDone); _mainDbContext.SaveChanges(); return(simDevice); }
private SimDeviceAuthenticationResponse CreateSimDeviceAuthenticationResponse(SimDeviceAuthenticationStateDone simDeviceAuthenticationStateDone, SimDevice simDevice, List <string> canLogonUsers) { var simDeviceAuthenticationResponse = new SimDeviceAuthenticationResponse { AuthId = simDeviceAuthenticationStateDone.Id.ToString(), CanLogonUsers = canLogonUsers, AssignDeviceIpAddress = simDevice.Nw2IpAddressPool }; // AdDevice がある場合 AdDeviceSettingOfflineWindowsSignIn を設置します 逆にない場合 設置しない AdDevice adDevice = _authenticationRepository.GetAdDevice(simDevice.Device.Id); if (adDevice != null && adDevice.AdDeviceSettingOfflineWindowsSignIn != null) { simDeviceAuthenticationResponse.SimDeviceConfigureDictionary = new Dictionary <string, string> { { "windows_signIn_cache_days", adDevice.AdDeviceSettingOfflineWindowsSignIn.WindowsSignInListCacheDays.ToString() } }; } return(simDeviceAuthenticationResponse); }