예제 #1
0
        static void Main(string[] args)
        {
            using (var context = new AppDbContext())
            {
                ClientService     clientService     = new ClientService(context);
                RoomService       roomService       = new RoomService(context);
                SettlementService settlementService = new SettlementService(context);

                clientService.AddClient("abc", "def", 123, "jerk");
                roomService.AddRoom(123, 1, 2, 123);
                settlementService.AddSettlement(23, 25, 1, 1);

                Client client = context.Clients
                                .OrderBy(b => b.Name)
                                .First();

                Room room = context.Rooms
                            .OrderBy(b => b.PersonNumber)
                            .First();

                Settlement settlements = context.Settlements
                                         .OrderBy(b => b.SettingDate)
                                         .First();

                Console.WriteLine(client.Name);

                context.Remove(client);
                context.Remove(room);
                context.Remove(settlements);

                context.SaveChanges();
            }
        }
예제 #2
0
        public static void SendRoomService(Room room)
        {
            string[] features = room.Features.Split(',');
            switch (features.Length)
            {
            case 2:
                RoomService.CleanRoom((RoomForTwo)room);
                break;

            case 4:
                RoomService.CleanRoom((FamilyRoom)room);
                break;

            case 5:
                RoomService.CleanRoom((Suite)room);
                break;
            }
        }