private void ModelShouldBeProjectionOfPatient(ServiceModels.Patient model, Patient patient) { model.Id.ShouldEqual(patient.Id); model.DateOfSurgery.ShouldEqual(patient.DateOfSurgery); model.DAmicoScore.ShouldEqual((patient.DAmicoScore)); model.GleasonScore.ShouldEqual(patient.GleasonScore); model.Psa.ShouldEqual(patient.Psa); model.Ptnm.ShouldEqual(patient.Ptnm); model.Tnm.ShouldEqual(patient.Tnm); model.YearOfBirth.ShouldEqual(patient.YearOfBirth); }
private static void LoadMappings(XmlNodeList Mappings) { MappingModels = new LinkedList <MappingModel>(); foreach (XmlNode mapping in Mappings) { MappingModels.Add(new MappingModel { InjectionType = mapping.Attributes["InjectionType"].Value, Name = mapping.Attributes["Name"].Value, From = ServiceModels.First(x => x.Alias.Equals(mapping.Attributes["From"].Value)), To = ServiceModels.First(x => x.Alias.Equals(mapping.Attributes["To"].Value)) }); } }
/// <summary> /// Initialization /// </summary> /// <param name="device"></param> /// <param name="deviceInfo"></param> public void Initialize(BluetoothLEDevice device, DeviceInformation deviceInfo) { // Check for valid input if (device == null) { throw new ArgumentNullException(string.Format("Dev{0}ice cannot be null.", "ARG0")); } if (deviceInfo == null) { throw new ArgumentNullException(string.Format("{0} DeviceInformation cannot be null.", "In BEDeviceVM,")); } // Initialize variables _device = device; if (_device.ConnectionStatus == BluetoothConnectionStatus.Connected) { Connected = true; } foreach (var service in _device.GattServices) { var serviceM = new BEServiceModel(); serviceM.Initialize(service, this); ServiceModels.Add(serviceM); } // Register event handlers _device.ConnectionStatusChanged += OnConnectionStatusChanged; _device.NameChanged += OnNameChanged; // _device.GattServicesChanged += OnGattervicesChanged; // Register for notifications from the device, on a separate thread // // NOTE: // This has the effect of telling the OS that we're interested in // these devices, and for it to automatically connect to them when // they are advertising. Utilities.RunFuncAsTask(RegisterNotificationsAsync); }
public bool Update(ServiceModels.JobTypeResponse obj) { throw new NotImplementedException(); }
private IActionResult AddObjectDefinitions(ServiceModels.ObjectDefinitions objectDefinitions) { IActionResult result; if (objectDefinitions == null || objectDefinitions.Items == null) result = new BadRequestResult(); else { List<Model.ObjectDefinition> items = new List<Model.ObjectDefinition>(); foreach (ServiceModels.ObjectDefinition item in objectDefinitions.Items) { Model.ObjectDefinition objectDefinition = item.ToModel(); objectDefinition.OrganisationID = User.GetOrganisationID(); items.Add(objectDefinition); } try { BusinessLogicFactory.ObjectDefinitions.SaveObjectDefinitions(items, Model.TObjectState.Add); string rootUrl = Request.GetRootUrl(); ResourcesCreated response = new ResourcesCreated(); foreach (Model.ObjectDefinition item in items) { ResourceCreated resourceCreated = new ResourceCreated(); resourceCreated.ID = StringUtils.GuidEncode(item.ObjectDefinitionID); resourceCreated.AddSelfLink(string.Concat(rootUrl, "/objecttypes/definitions/", resourceCreated.ID), false, false); response.Add(resourceCreated); } result = Request.GetObjectResult(response, System.Net.HttpStatusCode.Created); } catch (ConflictException) { result = new StatusCodeResult((int)HttpStatusCode.Conflict); } } return result; }