private void AddSoba() { Soba novaSoba = new Soba(); novaSoba.Sifra = Convert.ToInt32(SifraTb.Text); novaSoba.Kapacitet = Convert.ToInt32(KapacitetTb.Text); novaSoba.Zauzetost = Convert.ToInt32(ZauzetostTb.Text); novaSoba.Tip = (TypeOfUsage)TipCb.SelectedItem; novaSoba.Pocetak = (DateTime)PocetakTb.SelectedDate; novaSoba.Kraj = (DateTime)KrajTb.SelectedDate; Sobe.Add(novaSoba); RoomController roomController = new RoomController(); RenovationPeriodController renovationPeriodController = new RenovationPeriodController(); RenovationPeriod p = new RenovationPeriod(); Room room = new Room(); room.Capacity = novaSoba.Kapacitet; room.Number = novaSoba.Sifra; room.Occupation = novaSoba.Zauzetost; room.Usage = novaSoba.Tip; if (novaSoba.Pocetak != DateTime.Today && novaSoba.Kraj != DateTime.Today) { room.Renovation = true; p.room = room; p.BeginDate = novaSoba.Pocetak; p.EndDate = novaSoba.Kraj; renovationPeriodController.ScheduleRenovation(p); } roomController.AddRoom(room); // Resetujemo polja ClearFields(); UpdateTempSoba(); }
private void button1_Click(object sender, EventArgs e) { roomController.AddRoom(new Room { Stage = int.Parse(textBox1.Text), Number = int.Parse(textBox2.Text) }); this.Close(); }
private void Ok_Click(object sender, RoutedEventArgs e) { Room room = GeneratingRoomObject(); _roomController.AddRoom(room); _parent.UpdateTable(); this.Close(); }
public virtual void MergeRooms(Room room1, Room room2) { if (room1.RoomType.Equals(room2.RoomType) && room1.Floor == room2.Floor) { double newRoomArea = room1.Area + room2.Area; List <Inventory> newInventoryList = MergedRoomsInventory(room1, room2); Room newRoom = new Room(room1.Name, room1.RoomId + 10, room1.RoomType, false, true, newRoomArea, room1.Floor, room1.RoomNumber + 10, newInventoryList); _roomController.RemoveRoom(room1); _roomController.RemoveRoom(room2); _appointmentController.CancelAllRoomAppointments(room1); _appointmentController.CancelAllRoomAppointments(room2); _roomController.AddRoom(newRoom); } else { MessageBox.Show("Ne mozete spajati prostorije koje nisu istog tipa ili na istom spratu!"); } }
private void button1_Click(object sender, EventArgs e) { string roomNumber = txtRoomNumber.Text; string numberOfBeds = txtNumberOfBeds.Text; string description = txtDescription.Text; string status = txtStatus.Text; string block = txtBlock.Text; string fee = txtFee.Text; Room room = new Room(); room.setRoomNumber(roomNumber); room.setNumberOfBeds(numberOfBeds); room.setDescription(description); room.setStatus(status); room.setBlock(block); room.setFee(fee); RoomController roomController = new RoomController(); bool i = roomController.AddRoom(room); if (i == true) { MessageBox.Show("Room added Successfully"); txtRoomNumber.Text = ""; txtNumberOfBeds.Text = ""; txtDescription.Text = ""; txtStatus.Text = ""; txtBlock.Text = ""; txtFee.Text = ""; } else { MessageBox.Show("Room is not added"); } }
private void OnEnable() { m_controller.AddRoom(gameObject); }