private void BtnSaveAppointment_Click(object sender, RoutedEventArgs e) { try { int appoId = int.Parse(lblHiddenId.Content.ToString()); string selectedTime = cmbbAppointmentTime.SelectedValue.ToString(); string selectedHour = selectedTime.Substring(0, 2); if (dpAppointmentDate.SelectedDate != null) { DateTime dateTime = new DateTime(dpAppointmentDate.SelectedDate.Value.Year, dpAppointmentDate.SelectedDate.Value.Month, dpAppointmentDate.SelectedDate.Value.Day, int.Parse(selectedHour), 00, 00); AppointmentTypeView typeView = _controller.GetAppointmentTypeByName(cmbbAppointmentType.SelectedValue.ToString(), cmbbPractitioner.SelectedValue.ToString()); RoomView roomview = _controller.GetRoomByAppointmentId(appoId, cmbbDepartment.SelectedValue.ToString()); AppointmentView tempAppoView = _controller.GetAppointmentById(appoId); TimeSpan time = TimeSpan.Parse(cmbbNotificationTime.SelectedValue.ToString()); AppointmentView appoView = new AppointmentView(appoId, dateTime, tempAppoView.Users, typeView, roomview, txtNotes.Text, tempAppoView.Price, time, (bool)cbEmail.IsChecked, (bool)cbSMS.IsChecked); _controller.EditAppointment(appoView); } } catch (SqlException) { MessageBox.Show("Kunne ikke oprette forbindlse til databasen.\nPrøv at checke din internet forbindelse", "Fejl!!!", MessageBoxButton.OK, MessageBoxImage.Error); } Close(); }
public void Edit([FromBody] RoomView roomView) { if (roomView.Id != 0) { _roomAreaService.EditRoom(roomView); } }
private void deleteRoom_button(object sender, RoutedEventArgs e) { RoomView watcherView = RoomsGrid.SelectedItem as RoomView; Boolean b = false; foreach (RoomView wv in SelectedRooms) { if (wv.Name == watcherView.Name && wv.WorkLocation == watcherView.WorkLocation) { b = true; } } if (b == true) { foreach (RoomView slw in SelectedRooms.ToList()) { if (slw.Name == watcherView.Name && slw.WorkLocation == watcherView.WorkLocation) { SelectedRooms.Remove(slw); watcherView.IsSelected = false; MessageBox.Show("تم"); } } } else { MessageBox.Show("هذا العنصر غير مضاف مسبقا"); } }
public RoomProfilePage(RoomView room, bool isPrivate = false) { isNewRoom = isPrivate; _roomController = (Application.Current as App).RoomController; InitializeComponent(); if (!isNewRoom) { idLabel.Content = room.Id; } var maxNumberOfPatients = _roomController.Get((int)room.Id); if (maxNumberOfPatients == null) { textBox.Text = "20"; } else { textBox.Text = _roomController.Get((int)room.Id).MaxNumberOfPatients.ToString(); } roomComboBox.ItemsSource = Enum.GetNames(typeof(Model.RoomType)); if (room.RoomType != null) { roomComboBox.SelectedItem = room.RoomType.ToString(); } }
private void dodajSobu(object sender, RoutedEventArgs e) { var newRoom = new RoomView(); //RoomPage.RoomList.Add(newRoom); frame.Navigate(new RoomProfilePage(newRoom, true)); }
// TODO Rename this function /// <summary> /// Initialize Packet data to it's Current Room. /// Optional param sets to given room index /// </summary> /// <param name="packet_key"></param> /// <param name="new_room_index">optional; sets the packet to this room index</param> public void InitializePacketToRoom(string packet_key, int new_room_index = -1) { PartyController party = m_questingParties[packet_key].GetComponent <PartyController>(); // TODO aherrera, wspier : should 0 be allowed? That would mean fighting Boss Room right away if (new_room_index >= 0) { party.SetCurrentRoomIndex(new_room_index); } // TODO aherrera : replace this check with something more elegant :/ if (new_room_index >= mDungeonModel.RoomCount) { Debug.LogError("GIVEN INDEX LARGER THAN ARRAY SIZE"); } RoomModel current_room_reference = mDungeonModel.GetRoom(party.GetCurrentRoomIndex()); RoomView currentRoomView = current_room_reference.gameObject.GetComponent <RoomView> (); if (current_room_reference != null) { party.SetRoomTimer(Helper.Epoch.GetEpochTimestamp(current_room_reference.timer_frequency)); currentRoomView.addAdventurer(party.GetAdventurers()[0]); } else { Debug.LogError("DungeonModel::InitializePacketToCurrentRoom -- currentroom not found for string: " + packet_key); } }
public ActionResult CreateRoom(RoomView rv) { var res = GlobalVariables.client.PostAsJsonAsync("Room", rv).Result; TempData["success"] = "Create new room successfully!"; return(RedirectToAction("RoomList")); }
public ActionResult UpdateRoom(RoomView rv) { var res = GlobalVariables.client.PutAsJsonAsync("Room/" + rv.IDRoom.ToString(), rv).Result; TempData["success"] = "Update room successfully!"; return(RedirectToAction("RoomList")); }
/// <summary> /// 部屋に入ったとき /// </summary> void EnterRoom() { Debug.Log("enter room"); if (!_player) { _player = FindObjectOfType <PlayerCore>(); } _currentRoomView = _player.transform.GetComponentInParent <RoomView>(); _playerPosition = _currentRoomView.Room.Coordinate; //プレイヤーのいた部屋を移動 if (_prevStayRoom.X != -1) { _mapData[_prevStayRoom.Y * 2, _prevStayRoom.X * 2] &= ~(int)MinimapObject.Players; } _mapData[_playerPosition.Y * 2, _playerPosition.X * 2] |= (int)MinimapObject.Floor; _mapData[_playerPosition.Y * 2, _playerPosition.X * 2] |= (int)MinimapObject.Players; _prevStayRoom = _playerPosition; OnMapChanged?.Invoke(_mapData); }
private void deleteRoom(object sender, RoutedEventArgs e) { if (isNewRoom) { NavigationService.Navigate(new Page()); return; } RoomView newRoom = null; foreach (var room in RoomPage.RoomList) { if (room.Id == Int32.Parse(idLabel.Content.ToString())) { newRoom = room; break; } } MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("Da li ste sigurni da zelite da obrisete sobu?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo); if (messageBoxResult == MessageBoxResult.Yes) { if (newRoom != null) { RoomPage.RoomList.Remove(newRoom); _roomController.Remove((int)newRoom.Id); } System.Windows.MessageBox.Show("Uspešno ste obrisali sobu."); NavigationService.Navigate(new Page()); } }
public RoomController(RoomModel roomModel, RoomView roomView) { this.roomModel = roomModel; this.roomView = roomView; roomView.MouseMove += new MouseEventHandler(this.Mouse_Move); Console.WriteLine("Instanciation du Controller sans problèmes"); }
public ManualModeActivationPopup(RoomView roomView) { InitializeComponent(); InitializeEvents(); _roomView = roomView; }
private void Start() { Owner = GetComponent <RoomView>(); Owner.OnInitializeAsync.Subscribe(_ => OnInitialize()).AddTo(this); OnStart(); }
public void EditRoom(RoomView roomView) { var room = _unitOfWork.GetRepository <Room>().FindSingle(roomView.Id); room.Name = roomView.Name; _unitOfWork.GetRepository <Room>().Update(room); _unitOfWork.Save(); }
// PUT api/<controller>/5 public IHttpActionResult Put(int id, RoomView rv) { var item = new Room { IDRoom = rv.IDRoom, IDCateRoom = rv.IDCateRoom, NameRoom = rv.NameRoom, Empty = rv.Empty }; Repositories.UpdateRoom(item); return(Ok()); }
// POST api/<controller> public IHttpActionResult Post(RoomView rv) { var newItem = new Room { IDCateRoom = rv.IDCateRoom, NameRoom = rv.NameRoom }; Repositories.CreateRoom(newItem); return(Ok()); }
public void AddRoom(RoomView room) { if (room != null) { Room temp = ToRoom(room); db.Rooms.Add(temp); db.SaveChanges(); } }
public void updateCurrentRoom(IRoom model) { if (currentRoom) { Destroy(currentRoom.gameObject); } currentRoom = makeCurrent(model); currentRoom.roomeEnabled = true; }
public IHttpActionResult Get(int id) { var item = Repositories.GetRoomByID(id); var rv = new RoomView { IDRoom = item.IDRoom, IDCateRoom = item.IDCateRoom, NameCateRoom = item.CategoryRoom.NameCateRoom, NameRoom = item.NameRoom, Empty = item.Empty }; return(Ok(rv)); }
public void changeRoom(DungeonModel model, Dir direction) { Dir oppositeDir = Positions.opposite(direction); currentRoom.exitAndDestroy(oppositeDir); currentRoom = makeCurrent(model.currentRoom); currentRoom.enterAndEnable(direction); }
void OnChangeViewMessage(ChangeViewMessage Message) { Dispatcher.Invoke(() => { var view = (this.FindName(Message.ViewName) as UserControl); #region Caching for Rooms if (Message.ViewName == "RoomView") { var data = Message.Data as RoomSubCategory.Time; var vm = Message.ViewModel as RoomViewModel; if (data != null) { var key = data.CinemaName + data.HallID.ToString(); if (RoomViewsCache.ContainsKey(key)) { view = RoomViewsCache[key]; } else { view = new RoomView(); if (vm != null) { view.DataContext = vm; (view as RoomView).Init(); } RoomViewsCache.Add(key, view); RootLayout.Children.Add(view); } } } #endregion if (view == null) { return; } if (ActiveView == view) { return; } view.Visibility = Visibility.Visible; ActiveView.Visibility = Visibility.Collapsed; ActiveView = view; if (view is IView) { (view as IView).OnShow(Message.Data); } ActiveView.Dispatcher.Invoke(() => { }, DispatcherPriority.Render); }); }
public Room MapRoomViewToRoom(RoomView room) { var result = new Room() { Id = room.Id, RoomName = room.RoomName, Description = room.Description, AccommodationID = room.Accommodation.Id }; return(result); }
protected void Update() { RoomView roomView = Binder.RoomView; if (roomView != null) { RoomCamera roomCamera = roomView.RoomCamera; this.Transform.position = new Vector3(roomCamera.Transform.position.x, this.Transform.position.y, roomCamera.Transform.position.z); this.Transform.localEulerAngles = new Vector3(this.Transform.localEulerAngles.x, roomCamera.Orientation, this.Transform.localEulerAngles.z); this.ShaderTransform.localEulerAngles = new Vector3(this.ShaderTransform.localEulerAngles.x, -roomCamera.Orientation, this.ShaderTransform.localEulerAngles.z); } }
private void button_Copy_Click(object sender, RoutedEventArgs e) { RoomView newRoom = new RoomView(); Room room = new Room(); if (!isNewRoom) { foreach (var _room in RoomPage.RoomList) { if (_room.Id == Int32.Parse(idLabel.Content.ToString())) { newRoom = _room; break; } } } else { newRoom.Id = (uint)room.Id; } if (!isNewRoom) { RoomPage.RoomList.Remove(newRoom); } newRoom.RoomType = roomComboBox.SelectedItem.ToString(); room = newRoom.Convert(); int newMaxNumberOfPatients = Int32.Parse(textBox.Text); if (newMaxNumberOfPatients < room.Patient.Count) { newMaxNumberOfPatients = room.Patient.Count; } room.MaxNumberOfPatients = newMaxNumberOfPatients; room.Id = (int)newRoom.Id; if (!isNewRoom) { _roomController.Update(room); } else { _roomController.Add(room); } RoomPage.RoomList.Add(newRoom); System.Windows.MessageBox.Show("Uspešno ste sačuvali informacije."); NavigationService.Navigate(new Page()); }
public Room ToRoom(RoomView room) { return(new Room { Id = room.Id, LeavedAt = room.LeavedAt, UserId = room.UserId, Price = room.Price, Status = (DBHotel.Entities.Status)(int) room.Status, Places = room.Places, TypeOf = (DBHotel.Entities.TypeOf)(int) room.TypeOf }); }
private static void WriteRoomView(BBData data, RoomView rv) { data.Buffer.Write(new RoomViewEntry { IsEnabled = rv.IsEnabled ? DwordBool.True : DwordBool.False, Port = rv.Port, View = rv.View, Border = rv.Border, Speed = rv.Speed, ObjectId = rv.ObjectId ?? 0xFFFFFFFF }); }
static void Main(string[] args) { Console.WriteLine("Room Project . . ."); RoomModel roomModel = new RoomModel(); RoomView roomView = new RoomView(roomModel); Application.Run(roomView); Console.WriteLine("Les clients vont arriver !"); RoomController roomController = new RoomController(roomModel, roomView); }
// PUT: api/Rooms/5 public IHttpActionResult Put([FromBody] RoomView room) { var model = _mapper.MapRoomViewToRoom(room); var result = _service.UpdateRoom(model); if (result) { return(Ok(result)); } else { return(InternalServerError()); } }
static RoomView ReadRoomView(GMFileContent content, IntPtr p) { var entry = (RoomViewEntry *)p; var v = new RoomView(); v.IsEnabled = entry->IsEnabled.IsTrue(); v.Port = entry->Port; v.View = entry->View; v.Border = entry->Border; v.Speed = entry->Speed; v.ObjectId = entry->ObjectId == 0xFFFFFFFF ? null : (uint?)entry->ObjectId; return(v); }
static JsonData SerializeRoomView(RoomView view, LazyArray <ObjectInfo> objs) { var r = CreateObj(); r["enabled"] = view.IsEnabled; r["view"] = SerializeRect(view.View); r["port"] = SerializeRect(view.Port); r["border"] = SerializePoint(view.Border); r["speed"] = SerializePoint(view.Speed); if (view.ObjectId.HasValue) { r["obj"] = objs[view.ObjectId.Value].Name; } return(r); }
// Use this for initialization void Start () { view = GetComponent<RoomView>(); modal = GetComponent<RoomModal>(); }
protected override void OnViewAttached(object view, object context) { this.view = (RoomView) view; }