private void BtnAddRoom_Click(object sender, EventArgs e) { AddRoom addRoom = new AddRoom(); this.Hide(); addRoom.Show(); }
private void cameraToolStripMenuItem_Click(object sender, EventArgs e) { AddRoom form = new AddRoom(rooms, roomsPath); form.SaveRooms += Serialize; openChildForm(form); }
private void btnRoomsDelete_Click(object sender, EventArgs e) { if (activeForm == null) { return; } if (activeForm is AddRoom) { AddRoom addRoom = activeForm as AddRoom; Room room = addRoom.activRoom; interpretor.DeleteRoom(room); btnRoomsAdd.PerformClick(); } else if (activeForm is Rooms) { Rooms addRoom = activeForm as Rooms; Room room = addRoom.activRoom; interpretor.DeleteRoom(room); btnRoomsShow.PerformClick(); } else if (activeForm is EditRoom) { EditRoom addRoom = activeForm as EditRoom; Room room = addRoom.activRoom; interpretor.DeleteRoom(room); btnRoomsShow.PerformClick(); } }
private void CreateRoomButton_Click(object sender, RoutedEventArgs e) { CreateRoomDelegate delegat = CreateRoom; AddRoom ar = new AddRoom(delegat, token); ar.Show(); }
private void Awake() { src = GetComponent <AudioSource>(); numOfRoomtype = new int[(int)AddRoom.RoomTypes.len]; cam = FindObjectOfType <CameraController>(); if (FindObjectOfType <PlayerController>() == null) { Invoke("SpawnPlayer", 0.5f); } Invoke("SpawnBoss", waitTime); Invoke("SpawnBosskey", waitTime); //Spawn the starting room if (!randomStart) { obj = Instantiate(initialSpawn, Vector3.zero, Quaternion.identity); } else { obj = Instantiate(allRooms[Random.Range(0, allRooms.Length)], transform.position, Quaternion.identity); } //Get reference to current room spawned AddRoom curRoom = obj.GetComponent <AddRoom>(); curRoom.roomType = AddRoom.RoomTypes.player; curRoom.ChangeRoom(AddRoom.RoomTypes.player); //Debug.Log("Room type number: " + (int)curRoom.roomType); //Add to current number of rooms of that type AddRoomType(curRoom.roomType, obj); //Instantiate the rooms background for debugging curRoom.thisRoomsSprite = Instantiate(roomSprites[(int)curRoom.roomType], transform.position, Quaternion.identity); }
private void btnRoomsEdit_Click(object sender, EventArgs e) { if (activeForm == null) { EditRoom edit = new EditRoom(null); openForm(edit); } if (activeForm is AddRoom) { AddRoom addRoom = activeForm as AddRoom; Room room = addRoom.activRoom; EditRoom edit = new EditRoom(room); openForm(edit); } else if (activeForm is Rooms) { Rooms addRoom = activeForm as Rooms; Room room = addRoom.activRoom; EditRoom edit = new EditRoom(room); openForm(edit); } else if (activeForm is EditRoom) { EditRoom addRoom = activeForm as EditRoom; Room room = addRoom.activRoom; EditRoom edit = new EditRoom(room); openForm(edit); } }
private void btn_add_camere_Click(object sender, EventArgs e) { AddRoom form = new AddRoom(rooms, roomsPath); form.SaveRooms += Serialize; openChildForm(form); }
// Use this for initialization void Awake() { Destroy(gameObject, waitTime); templates = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomTemplates>(); room = GetComponentInParent <AddRoom>(); Invoke("Spawn", Random.Range(0.1f, 0.3f)); //Este random lo he puesto para que no se superpongan las habitaciones en casos especiales }
void SpawnBoss() { //Instantiate(boss, rooms[rooms.Count - 1].transform.position, Quaternion.identity); //Instantiate(bossBG, rooms[rooms.Count - 1].transform.position, Quaternion.identity); rooms[rooms.Count - 1].GetComponent <AddRoom>().ChangeRoom(AddRoom.RoomTypes.boss); bossRoom = rooms[rooms.Count - 1].GetComponent <AddRoom>(); Invoke("CameraChange", 0.5f); }
public RedirectToRouteResult AddRoom(AddRoom model) { var roomId = Guid.NewGuid(); // For now: Do our best not to redirect to nowhere or yellow-screen-of-death roomId = FacilitiesSingleton.Facilities.GetChildren(model.MapId).First().Item1; return(this.RedirectToAction <RoomController>(c => c.Details(roomId))); }
private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e) { AddRoom WindowAddRoom = new AddRoom(); WindowAddRoom.ShowDialog(); dataGrid.ItemsSource = null; dataGrid.ItemsSource = roomProvider.GetAllRooms(); }
public void StartCommandLoop() { do //Command loop { var cmd = Console.ReadLine(); //Single token commands if (cmd.Equals("exit", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine("Disconnecting EventStore"); break; } if (cmd.Equals("list", StringComparison.OrdinalIgnoreCase)) { _view.ListRooms(); continue; } if (cmd.Equals("list-types", StringComparison.OrdinalIgnoreCase)) { _view.ListRooms(); continue; } //3 token commands var tokens = cmd.Split(' '); if (tokens.Length < 2) { _view.ErrorMsg = "Unknown command or Invalid number of parameters."; continue; } switch (tokens[0].ToUpperInvariant()) { case "ADD-TYPE": var addRoom = new AddRoomType( Guid.NewGuid(), tokens[1], string.Join(" ", tokens.Skip(2))); _mainBus.Publish(addRoom); break; case "ADD-ROOM": var typeId = _view.RoomSummaries.First(type => type.Description == tokens[1]).Id; var room = new AddRoom( Guid.NewGuid(), typeId, tokens[2]); _mainBus.Publish(room); break; default: _view.ErrorMsg = "Unknown Command"; break; } } while (true); }
private void btnAddRoom_Click(object sender, EventArgs e) { AddRoom frm = new AddRoom(); if (frm.ShowDialog() == DialogResult.Yes) { //更新列表 QueryRoom(); } }
static void Main(string[] args) { Utility.InitDb(); AddRoom.AddRooms(); AddDoctor.AddDoctors(); AddPatient.AddPatients(); AddDisease.AddDiseases(); AddExam.ImportExams(); AddRehabilitation.ImportRehabilitation(); AddSurgery.ImportSurgery(); }
public async void AddNewRoom() { Value = true; var connection = await apiService.CheckConnection(); if (!connection.IsSuccess) { await Application.Current.MainPage.DisplayAlert( Languages.Warning, Languages.CheckConnection, Languages.Ok); return; } if (string.IsNullOrEmpty(Name) || string.IsNullOrEmpty(Description)) { Value = true; return; } if (SelectedType.Key == null) { await Application.Current.MainPage.DisplayAlert("Error", "Please Select Type", "ok"); return; } var _room = new AddRoom { active = Active, name = Name, description = Description, type = SelectedType.Key }; var cookie = Settings.Cookie; //.Split(11, 33) var res = cookie.Substring(11, 32); var response = await apiService.Save <AddRoom>( "https://portalesp.smart-path.it", "/Portalesp", "/room/save", res, _room); if (!response.IsSuccess) { await Application.Current.MainPage.DisplayAlert("Error", response.Message, "ok"); return; } Value = false; MessagingCenter.Send((App)Application.Current, "OnSaved"); DependencyService.Get <INotification>().CreateNotification("PortalSP", "Room Added"); await App.Current.MainPage.Navigation.PopPopupAsync(true); }
public bool Handle(AddRoom cmd) { try { var room = new Room(cmd.RoomId, cmd.TypeId, cmd.RoomNumber); _repo.Save(room); } catch (Exception _) { return(false); } return(true); }
//机房列表 private void AddRooms(object sender, RoutedEventArgs e) { if (roomGrid.Children != null) { roomGrid.Children.Clear(); } AddRoom addRoom = RoomManagerBean.AddRoom; roomGrid.Children.Add(addRoom); addRoom.SetValue(Grid.RowProperty, 0); addRoom.SetValue(Grid.ColumnProperty, 0); }
IEnumerator RandomSpawner() { yield return(new WaitForSeconds(5f)); AddRoom lastRoom = rooms[rooms.Count - 1].GetComponent <AddRoom>(); Instantiate(Key, rooms[Random.Range(0, rooms.Count - 2)].transform.position, Quaternion.identity); //Instantiate(Gun, rooms[rooms.Count - 2].transform.position, Quaternion.identity); lastRoom.door.SetActive(true); lastRoom.walls.SetActive(false);//GetComponent<WallsController>().DisableWalls(); FinishedGenerating = true; }
void Start() { playerDetected = false; templates = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomTemplates>(); enemyTemp = GameObject.FindGameObjectWithTag("EnemyTemplate").GetComponent <EnemyTemplates>(); addroom = transform.parent.parent.parent.GetComponent <AddRoom>(); //reference to addroom script at base room // try { // eneSP = transform.parent.parent.parent.GetChild(3).gameObject; // } // catch (Exception e) { // print("error"); // } // eneSP = transform.parent.parent.parent.GetChild(3).gameObject; roomNum = addroom.roomNumber; }
public void StartCommandLoop() { do //Command loop { var cmd = Console.ReadLine(); //Single token commands if (cmd.Equals("exit", StringComparison.OrdinalIgnoreCase)) { Console.WriteLine("Disconnecting EventStore"); break; } if (cmd.Equals("list", StringComparison.OrdinalIgnoreCase)) { _view.ListRooms(); break; } //3 token commands var tokens = cmd.Split(' '); if (tokens.Length != 4) { _view.ErrorMsg = "Unknown command or Invalid number of parameters."; continue; } switch (tokens[0].ToUpperInvariant()) { case "ADD": var addRoom = new AddRoom( Guid.NewGuid(), tokens[1], tokens[2], tokens[3]); _mainBus.Publish(addRoom); break; default: _view.ErrorMsg = "Unknown Command"; break; } } while (true); }
private void btnChangeFloor_Click(object sender, EventArgs e) { List <int> RoomIDs = new List <int>(); foreach (DataGridViewRow row in dgvRoom.Rows) { if (row.Cells["Selected"].Value != null && (bool)row.Cells["Selected"].Value) { RoomIDs.Add(Convert.ToInt32(row.Cells["RoomID"].Value)); } } if (RoomIDs.Count != 1) { MessageBox.Show("只能选择一个房间!"); return; } AddRoom frm = new AddRoom(); frm.RoomID = RoomIDs.First(); if (frm.ShowDialog() == DialogResult.Yes) { QueryRoom(); } }
private void AddRoomButton_Click(object sender, EventArgs e) { var AddRoomDialog = new AddRoom(); AddRoomDialog.ShowDialog(); }
void Spawn() { if (spawned == false) { spawned = true; if (openingDirection == 1) { // Need to spawn a room with a BOTTOM door. bool up = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX && e.StatesY == roomParent.statesY + 2); bool right = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX + 1 && e.StatesY == roomParent.statesY + 1); bool bottom = false; bool left = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX - 1 && e.StatesY == roomParent.statesY + 1); AddRoom room = RoomTemplates.Instance.GetBottomRoomWithConstraint(up, right, bottom, left); room.SetNode(roomParent.statesX, roomParent.statesY + 1); Instantiate(room.gameObject, transform.position, room.transform.rotation); } else if (openingDirection == 2) { // Need to spawn a room with a TOP door. bool up = false; bool right = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX + 1 && e.StatesY == roomParent.statesY - 1); bool bottom = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX && e.StatesY == roomParent.statesY - 2); bool left = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX - 1 && e.StatesY == roomParent.statesY - 1); AddRoom room = RoomTemplates.Instance.GetTopRoomWithConstraint(up, right, bottom, left); room.SetNode(roomParent.statesX, roomParent.statesY - 1); Instantiate(room.gameObject, transform.position, room.transform.rotation); } else if (openingDirection == 3) { // Need to spawn a room with a LEFT door. bool up = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX + 1 && e.StatesY == roomParent.statesY + 1); bool right = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX + 2 && e.StatesY == roomParent.statesY); bool bottom = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX + 1 && e.StatesY == roomParent.statesY - 1); bool left = false; AddRoom room = RoomTemplates.Instance.GetLeftRoomWithConstraint(up, right, bottom, left); room.SetNode(roomParent.statesX + 1, roomParent.statesY); Instantiate(room.gameObject, transform.position, room.transform.rotation); } else if (openingDirection == 4) { // Need to spawn a room with a RIGHT door. bool up = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX - 1 && e.StatesY == roomParent.statesY + 1); bool right = false; bool bottom = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX - 1 && e.StatesY == roomParent.statesY - 1); bool left = NodeRoomHelper.RoomNode.Any(e => e.StatesX == roomParent.statesX - 2 && e.StatesY == roomParent.statesY); AddRoom room = RoomTemplates.Instance.GetRightRoomWithConstraint(up, right, bottom, left); room.SetNode(roomParent.statesX - 1, roomParent.statesY); Instantiate(room.gameObject, transform.position, room.transform.rotation); } // This holds all graph data AstarData data = AstarPath.active.data; // This creates a Grid Graph GridGraph gg = data.AddGraph(typeof(GridGraph)) as GridGraph; // Setup a grid graph with some values int width = 26; int depth = 18; float nodeSize = 1; gg.center = this.transform.position; gg.rotation = new Vector3(90, 0, 0); gg.collision.heightCheck = false; gg.collision.mask = layer; // Updates internal size from the above values gg.SetDimensions(width, depth, nodeSize); gg.collision.use2D = true; gg.collision.collisionCheck = true; gg.collision.type = ColliderType.Ray; // Scans all graphs AstarPath.active.Scan(); } }
private void Start() { room = GetComponentInParent <AddRoom>(); }
private void AddRoom_Selected(object sender, RoutedEventArgs e) { AddRoom addRoom = new AddRoom(); addRoom.ShowDialog(); }
private void Add_Clicked(object sender, RoutedEventArgs e) { DataContext = new AddRoom(); }
private void AddRoom_Clicked(object sender, RoutedEventArgs e) { AddRoom ar = new AddRoom(); ar.Show(); }
//机房选择 private void SelectRoom(object sender, RoutedEventArgs e) { TreeViewItem roomId = ((sender as TreeView).SelectedItem as TreeViewItem); string id = roomId.Uid.ToString(); if (roomGrid.Children != null) { roomGrid.Children.Clear(); } if ("roomName".Equals(id)) { AddRoom addRoom = RoomManagerBean.AddRoom; RoomClass room = new RoomClass(); QueryUser query = new QueryUser(); //query.Account = UserManagerBean.AddUser.queryAccount.Text; //query.UserName = UserManagerBean.AddUser.queryName.Text; DataSet set = room.queryRoomsList(); RoomManagerBean.AddRoom.page.ShowPages(RoomManagerBean.AddRoom.roomDate, set, BaseRequest.PAGE_SIZE); roomGrid.Children.Add(addRoom); addRoom.SetValue(Grid.RowProperty, 0); addRoom.SetValue(Grid.ColumnProperty, 0); } else if (id.Equals("EquipmentInfo")) { } else if (id.Equals("Elist")) { EquipmentList equipment = RoomManagerBean.EquipmentList; RoomClass rc = new RoomClass(); EquipmentBean bean = new EquipmentBean(); DataSet equipmentSet = rc.queryEquipmentList(bean); DataSet typeSet = rc.queryType(); ComboBox box = RoomManagerBean.EquipmentList.type; if (box.HasItems) { box.Items.Clear(); } ComboBoxItem boxItem = new ComboBoxItem(); boxItem.Content = "请选择..."; boxItem.Tag = ""; boxItem.IsSelected = true; box.Items.Add(boxItem); //RoomManagerBean.DeviceClass.selectType.SelectedValuePath = ""; if (typeSet.Tables.Count > 0) { DataRowCollection drc = typeSet.Tables[0].Rows; for (int i = 0; i < drc.Count; i++) { DataRow dr = drc[i]; int typeId = (int)dr["ID"]; string typeName = dr["TYPE_NAME"].ToString(); ComboBoxItem boxItems = new ComboBoxItem(); boxItems.Content = typeName; boxItems.Tag = typeId; box.Items.Add(boxItems); //MessageBox.Show("typeId=" + typeId + " typeName=" + boxItems.Tag); } //MessageBox.Show("===" + equipmentSet.Tables.Count); RoomManagerBean.EquipmentList.page.ShowPages(RoomManagerBean.EquipmentList.equipment, equipmentSet, BaseRequest.PAGE_SIZE); roomGrid.Children.Add(equipment); equipment.SetValue(Grid.RowProperty, 0); equipment.SetValue(Grid.ColumnProperty, 0); } } else if (id.Equals("Report")) { Statement statement = RoomManagerBean.Statement; roomGrid.Children.Add(statement); statement.SetValue(Grid.RowProperty, 0); statement.SetValue(Grid.ColumnProperty, 0); } else if (id.Equals("Inventory")) { RoomClass rc = new RoomClass(); DataSet stockSet = rc.queryInventory(); RoomManagerBean.DeviceList.page.ShowPages(RoomManagerBean.DeviceList.stock, stockSet, BaseRequest.PAGE_SIZE); DeviceList deviceList = RoomManagerBean.DeviceList; roomGrid.Children.Add(deviceList); deviceList.SetValue(Grid.RowProperty, 0); deviceList.SetValue(Grid.ColumnProperty, 0); } else if (id.Equals("Category")) { DeviceClass deviceClass = RoomManagerBean.DeviceClass; RoomClass room = new RoomClass(); QueryUser query = new QueryUser(); //query.Account = UserManagerBean.AddUser.queryAccount.Text; //query.UserName = UserManagerBean.AddUser.queryName.Text; DataSet set = room.queryType(); RoomManagerBean.DeviceClass.page.ShowPages(RoomManagerBean.DeviceClass.deviceData, set, BaseRequest.PAGE_SIZE); roomGrid.Children.Add(deviceClass); deviceClass.SetValue(Grid.RowProperty, 0); deviceClass.SetValue(Grid.ColumnProperty, 0); } else if (id.Equals("HistoryEquipment")) { HistoryEquipment he = RoomManagerBean.HistoryEquipment; RoomClass rc = new RoomClass(); DataSet set = rc.queryHistoryEquipment(); he.page.ShowPages(he.historyEquipment, set, BaseRequest.PAGE_SIZE); roomGrid.Children.Add(he); he.SetValue(Grid.RowProperty, 0); he.SetValue(Grid.ColumnProperty, 0); } else { Room roomBean = RoomManagerBean.Room; EquipmentClass ec = new EquipmentClass(); roomBean.roomId.Text = id; DataSet set = ec.getEquipmentInformationByRoom(int.Parse(id)); roomBean.page.ShowPages(roomBean.roomEquipment, set, BaseRequest.PAGE_SIZE); roomBean.roomName.Content = roomId.Header.ToString(); roomGrid.Children.Add(roomBean); roomBean.SetValue(Grid.RowProperty, 0); roomBean.SetValue(Grid.ColumnProperty, 0); } }
public IEnumerable <object> Add(AddRoom command) { RaiseEvent(new RoomAdded(command.RoomId, command.HotelId, command.RoomType)); return(UnCommitedEvents); }
//[Authorize(Roles = "admin")] public async Task <IActionResult> AddRoom([FromBody] AddRoom addRoom) { await _roomService.AddRoom(addRoom.Name, addRoom.NumberOfRows, addRoom.NumberOfSeatsInRow); return(Ok()); }