Example #1
0
        public void Save(int id, string price, string capacity, string numberOfRooms, feature selectedFeature, account cont)
        {
            HotelEntities context = new HotelEntities();

            if (id == -1)
            {
                context.AddRoom(int.Parse(capacity), int.Parse(numberOfRooms), int.Parse(price), selectedFeature.id);
                context.SaveChanges();
            }
            else
            {
                context.ModifyRoom(id, int.Parse(numberOfRooms), int.Parse(price), selectedFeature.id, int.Parse(capacity));
                context.SaveChanges();
            }
            MainViewModel.Instance.ActiveScreen = new RoomsViewModel(cont);
        }