Ejemplo n.º 1
0
        private ClarifiModel PopulateData(string fileName)
        {
            ClarifiModel model = null;

            using (StreamReader r = new StreamReader(fileName))
            {
                string json = r.ReadToEnd();
                model = JsonConvert.DeserializeObject <ClarifiModel>(json);
                model.RoomsData.ForEach(room => room.UpdateNameIfAccessible());
            }
            return(model);
        }
Ejemplo n.º 2
0
        private void SaveEPSMappingResult(string fileName, ClarifiModel epsSupplierData, List <RoomMappingResult> roomMappingResults)
        {
            List <EpsMappedRooms> epsMappedRoomView = new List <EpsMappedRooms>();

            foreach (var epsRoom in epsSupplierData.RoomsData)
            {
                var roomsMappedToEpsRoom = roomMappingResults.FindAll(r => r.MostMatchedRoomId == epsRoom.SupplierRoomId);
                if (roomsMappedToEpsRoom != null)
                {
                    epsMappedRoomView.Add(new EpsMappedRooms()
                    {
                        EpsRoomId   = epsRoom.SupplierRoomId,
                        EpsRoomName = epsRoom.Name,
                        MappedRooms = GetMappedRooms(epsRoom, roomsMappedToEpsRoom)
                    });
                }
            }

            string json = JsonConvert.SerializeObject(epsMappedRoomView);

            System.IO.File.WriteAllText(Directory.GetCurrentDirectory() + "\\Output\\" + fileName, json);
        }