public async Task <IActionResult> Putrooms([FromRoute] int id, [FromBody] rooms rooms) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != rooms.id) { return(BadRequest()); } _context.Entry(rooms).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!roomsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public static void LoadSceneBlocking(rooms room) { if (gameMode == null) { CreateGameMode(); if (gameMode == null) { Debug.LogWarning("Gamemode static ref is not valid"); return; } } bool isFirst = true; foreach (var roomName in GetRoomForType(room)) { if (isFirst) { isFirst = false; SceneManager.LoadSceneAsync(roomName, LoadSceneMode.Single); } else { SceneManager.LoadSceneAsync(roomName, LoadSceneMode.Additive); } } }
public IHttpActionResult Postrooms(rooms rooms) { db.rooms.Add(rooms); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = rooms.id }, rooms)); }
public IHttpActionResult Putrooms(int id, rooms rooms) { if (id != rooms.id) { return(BadRequest()); } db.Entry(rooms).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!roomsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public List <rooms> getrooms() { SqlCommand cmd = new SqlCommand("select*From roomstable", con); cmd.CommandType = CommandType.Text; List <rooms> tr = new List <rooms>(); try { con.Open(); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { var dd = new rooms(); dd.roomnumber = dr["RoomNumber"].ToString(); dd.floor = dr["level"].ToString(); dd.status = dr["status"].ToString(); dd.colour = dr["colour"].ToString(); tr.Add(dd); } dr.Close(); return(tr); } catch (Exception ex) { return(tr); } finally { con.Close(); } }
protected void Sua_Click(object sender, CommandEventArgs e) { if (e.CommandName == "sua") { int room_id = Convert.ToInt16(e.CommandArgument); rooms room = data.get1Room(room_id); Session["room"] = room; Response.Redirect("roomsEdit.aspx"); } }
public IHttpActionResult Getrooms(int id) { rooms rooms = db.rooms.Find(id); if (rooms == null) { return(NotFound()); } return(Ok(rooms)); }
void Start() { currentRoom = rooms.title; bgMusic.clip = cave; bgMusic.loop = true; if (!bgMusic.isPlaying) { bgMusic.volume = 0.3f; bgMusic.Play(); } }
public async Task <IActionResult> Postrooms([FromBody] rooms rooms) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.rooms.Add(rooms); await _context.SaveChangesAsync(); return(CreatedAtAction("Getrooms", new { id = rooms.id }, rooms)); }
void suggest() { rooms room = (rooms)tableID; GameManager gm = FindObjectOfType <GameManager>(); sugerencia.enabled = true; sugerencia.text = me.name + " suguiere que el asesino es: " + personToSuggest.ToString() + " \n En la habitación: "+ room.ToString() + "\n Con el arma: " + weapons.Candelabro.ToString(); Invoke("askCard", 5f); //charactersInMyRoom.Clear(); }
public static void StartLoadingScene(rooms room, bool UseFade = false) { if (gameMode == null) { CreateGameMode(); if (gameMode == null) { Debug.LogWarning("Gamemode static ref is not valid"); return; } } gameMode.StartCoroutine(gameMode.LoadSceneWithFade(room)); }
// Thêm phòng vào bảng rooms public void createRoom(rooms room) { string sql = "Insert Into rooms (room_name, room_status, room_type_id) Values (@room_name, @room_status, @room_type_id)"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("room_name", room.room_name); cmd.Parameters.AddWithValue("room_status", room.room_status); cmd.Parameters.AddWithValue("room_type_id", room.room_type_id); cmd.ExecuteNonQuery(); con.Close(); }
// Cập nhật thông tin phòng public void updateRoom(rooms room) { string sql = "Update rooms Set room_name=@room_name, room_status=@room_status, room_type_id=@room_type_id Where room_id=@room_id"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("room_name", room.room_name); cmd.Parameters.AddWithValue("room_status", room.room_status); cmd.Parameters.AddWithValue("room_type_id", room.room_type_id); cmd.Parameters.AddWithValue("room_id", room.room_id); cmd.ExecuteNonQuery(); con.Close(); }
public IHttpActionResult Deleterooms(int id) { rooms rooms = db.rooms.Find(id); if (rooms == null) { return(NotFound()); } db.rooms.Remove(rooms); db.SaveChanges(); return(Ok(rooms)); }
private async void GetRooms() { try { var client = new HttpClient(); client.BaseAddress = new Uri(App.api_url); var values = new Dictionary <string, string>(); values.Add("session_string", App.session_string); values.Add("data", "{\"table\": \"rooms\"}"); var content = new FormUrlEncodedContent(values); HttpResponseMessage response = await client.PostAsync("/itcrm/getElements/", content); var result = await response.Content.ReadAsStringAsync(); //await DisplayAlert("Rooms", result, "ok"); rooms rooms_list = JsonConvert.DeserializeObject <rooms>(result); dt = new ObservableCollection <SetRoomsList>(); lvRoomsList.ItemsSource = dt; var lst = rooms_list.result; for (int i = 0; i < lst.Length; i++) { try { iList.Add(lst[i].id); } catch (Exception e) { // await DisplayAlert("CloudSchool", "Error: " + e.Message, "ok"); } } for (int i = 0; i <= lst.Length; i++) { try { dt.Add(new SetRoomsList() { rooms_name = lst[i].name, id = lst[i].id, icon = "https://cloudschool.management/itcrm/media/images/blackrooms.png", }); } catch (Exception e) { // await DisplayAlert("CloudSchool", "Error: " + e.Message, "ok"); } } } catch { } }
private void allPlayers(rooms room, weapons weapon, people person) { Room[] r = FindObjectsOfType <Room>(); Weapons[] w = FindObjectsOfType <Weapons>(); Suspects[] s = FindObjectsOfType <Suspects>(); for (int i = 0; i < r.Length; i++) { if (r[i].tipo == room) { r[i].SP[0].GetComponent <TextMeshProUGUI>().color = Color.red; r[i].SP[1].GetComponent <TextMeshProUGUI>().color = Color.red; r[i].SP[2].GetComponent <TextMeshProUGUI>().color = Color.red; r[i].SP[0].GetComponent <TextMeshProUGUI>().text = "???"; r[i].SP[1].GetComponent <TextMeshProUGUI>().text = "???"; r[i].SP[2].GetComponent <TextMeshProUGUI>().text = "???"; } } for (int p = 0; p < w.Length; p++) { if (w[p].tipo == weapon) { w[p].SP[0].GetComponent <TextMeshProUGUI>().color = Color.red; w[p].SP[1].GetComponent <TextMeshProUGUI>().color = Color.red; w[p].SP[2].GetComponent <TextMeshProUGUI>().color = Color.red; w[p].SP[0].GetComponent <TextMeshProUGUI>().text = "???"; w[p].SP[1].GetComponent <TextMeshProUGUI>().text = "???"; w[p].SP[2].GetComponent <TextMeshProUGUI>().text = "???"; } } for (int q = 0; q < s.Length; q++) { if (s[q].tipo == person) { s[q].SP[0].GetComponent <TextMeshProUGUI>().color = Color.red; s[q].SP[1].GetComponent <TextMeshProUGUI>().color = Color.red; s[q].SP[2].GetComponent <TextMeshProUGUI>().color = Color.red; s[q].SP[0].GetComponent <TextMeshProUGUI>().text = "???"; s[q].SP[1].GetComponent <TextMeshProUGUI>().text = "???"; s[q].SP[2].GetComponent <TextMeshProUGUI>().text = "???"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { rooms room = (rooms)Session["room"]; room_id.Text = room.room_id.ToString(); room_name.Text = room.room_name; room_type_id.DataSource = data.getRoomTypes(); room_type_id.DataValueField = "room_type_id"; room_type_id.DataTextField = "room_type_name"; DataBind(); room_type_id.SelectedValue = room.room_type_id.ToString(); room_status.Items.FindByValue(room.room_status.ToString()).Selected = true; } }
public void accusate() { if (!confirmAccusation) { if (!FindObjectOfType <MouseOverObject>().getEnable()) { accusating = true; confirmAccusation = true; acusateButton.GetComponent <Button>().GetComponentInChildren <Text>().text = "CONFIRMAR ACUSACION"; foreach (GameObject g in buttonsToHide) { g.SetActive(false); } foreach (GameObject g in FindObjectOfType <GameManager>().charactersObjects) { if (g.GetComponent <Characters>().myName == selectedCharacter) { personAccusated = g; originalAccusatedPos = g.transform; g.transform.position = FindObjectOfType <GameManager>().playersInGame[FindObjectOfType <GameManager>().actPlayer].transform.position; accusationPanel.SetActive(true); rooms r = (rooms)FindObjectOfType <GameManager>().playersInGame[FindObjectOfType <GameManager>().actPlayer].GetComponent <Characters>().getCasillaID(); roomName = r.ToString(); } } } else { selection.enabled = true; Invoke("disableText", 2f); } } else { confirmAccusation = false; acusateButton.GetComponent <Button>().GetComponentInChildren <Text>().text = "ACUSAR"; acusateButton.SetActive(false); accusationPanel.SetActive(false); sugerencia.enabled = false; personAccusated.transform.position = originalAccusatedPos.position; accusating = false; } }
IEnumerator LoadSceneWithFade(rooms room) { bool isFirst = true; foreach (var roomName in GetRoomForType(room)) { if (isFirst) { isFirst = false; yield return(SceneManager.LoadSceneAsync(roomName, LoadSceneMode.Single)); } else { yield return(SceneManager.LoadSceneAsync(roomName, LoadSceneMode.Additive)); } } }
int findRoom(Vector3 posFrom) { RaycastHit hit; int layerMask = 1 << 9; if (Physics.Raycast(posFrom, Vector3.down, out hit, 5, layerMask, QueryTriggerInteraction.Collide)) { GameObject gHit = hit.collider.gameObject; ScrFloor floor = gHit.GetComponent <ScrFloor>(); rooms r = building.GetComponent <rooms>(); Debug.Log(r.ToString()); Debug.Log(floor.ToString()); Debug.Log("Object is in Room: " + r.roomNames[floor.roomID]); return(floor.roomID); } return(-1); }
public static void SearchedRooms(Message Msg, Session Session) { string Keywords = Msg.NextString(); var Rooms = FluentRooms.GetByQry(Keywords); var All = Rooms.GetEnumerator(); fuseResponse.New(Opcodes.OpcodesOut.SendRoomDataNavigator); fuseResponse.Append <int>(8); fuseResponse.Append <string>(Keywords); fuseResponse.Append <int>(Rooms.Count); while (All.MoveNext()) { rooms Row = (rooms)All.Current; FluentRooms.Serialize(fuseResponse, Row); } fuseResponse.Append <bool>(false); fuseResponse.Send(Session); }
protected void btnThemPhong_Click1(object sender, EventArgs e) { try { rooms room = new rooms(); room.room_name = room_name.Text; room.room_status = Convert.ToBoolean(room_status.SelectedValue); room.room_type_id = Convert.ToInt32(room_type_id.SelectedValue); data.createRoom(room); err_msg.ForeColor = System.Drawing.Color.Green; err_msg.Text = "Thêm phòng thành công!"; } catch (Exception ex) { err_msg.ForeColor = System.Drawing.Color.Red; err_msg.Text = "Đã xảy ra lỗi: " + ex.Message; } }
internal static void Serialize(ServerMessage Msg, rooms Room) { Msg.Append <uint>(Room.ID); Msg.Append <bool>(false); Msg.Append <string>(Room.Caption); Msg.Append <bool>(true); Msg.Append <int>(Engine.dbManager.ReadInt("SELECT id FROM members WHERE username = '******'")); Msg.Append <string>(Room.Owner); Msg.Append <int>(Room.State); Msg.Append <int>(Room.Users_Now); Msg.Append <int>(Room.Users_Max); Msg.Append <string>(Room.Description); Msg.Append <int>(0); Msg.Append <int>(0); Msg.Append <int>(Room.Score); Msg.Append <int>(Room.Category); Msg.Append <int>(Room.GroupID); if (Room.GroupID > 0) { groups group = Engine.GetHabboHotel.getGroups.Groups[Room.GroupID]; Msg.Append <string>(group.Name); Msg.Append <string>(group.Badges); Msg.Append <string>(""); } else { Msg.Append <string>(""); Msg.Append <string>(""); Msg.Append <string>(""); } Msg.Append <int>(Room.Tags.Length); Msg.Append <string[]>(Room.Tags); Msg.Append <int>(0); Msg.Append <int>(0); Msg.Append <int>(0); Msg.Append <bool>(true); Msg.Append <bool>(true); }
// Get danh sách tất cả các phòng public List <rooms> getAllRooms() { List <rooms> li = new List <rooms>(); string sql = "Select * From rooms, room_types where rooms.room_type_id=room_types.room_type_id ORDER BY room_id DESC"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { rooms room = new rooms(); room.room_id = (int)rd["room_id"]; room.room_name = (string)rd["room_name"]; room.room_status = (Boolean)rd["room_status"]; room.room_type_name = (string)rd["room_type_name"]; li.Add(room); } con.Close(); return(li); }
protected void btnSuaPhong_Click(object sender, EventArgs e) { try { rooms room = new rooms(); room.room_id = int.Parse(room_id.Text); room.room_name = room_name.Text; room.room_status = Convert.ToBoolean(room_status.SelectedValue); room.room_type_id = int.Parse(room_type_id.SelectedValue); data.updateRoom(room); err_msg.ForeColor = System.Drawing.Color.Green; err_msg.Text = "Cập nhật phòng thành công!"; } catch (Exception ex) { err_msg.ForeColor = System.Drawing.Color.Red; err_msg.Text = "Da xay ra loi: " + ex.Message; } }
// Get ra danh sách các phòng trống từ bảng rooms public List <rooms> getEmptyRooms() { List <rooms> li = new List <rooms>(); // Phòng có room_status = 0 là phòng trống chưa có người string sql = "Select * From rooms where room_status = 0"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { rooms room = new rooms(); room.room_id = (int)rd["room_id"]; room.room_name = (string)rd["room_name"]; room.room_status = (Boolean)rd["room_status"]; room.room_type_id = (int)rd["room_type_id"]; li.Add(room); } con.Close(); return(li); }
public void selectPeople(int tableId, string playerName) { myName = playerName; charactersInMyRoom.Clear(); foreach (Characters g in FindObjectsOfType <Characters>()) { if (g.gameObject.GetComponent <Player>() == null) { if (g.casillaID == tableId) { charactersInMyRoom.Add(g); g.gameObject.GetComponent <objectSize>().enabled = true; } } } CallSuspectButton.SetActive(true); accusationPanel.SetActive(true); sugerencia.enabled = true; tableStandPoints[] tsp = FindObjectsOfType <tableStandPoints>(); foreach (tableStandPoints t in tsp) { if (t.TableId == tableId) { roomName = t.roomName; roomID = t.room; } } if (charactersInMyRoom.Count == 1) { selectedCharacter = charactersInMyRoom[0].myName; personID = charactersInMyRoom[0].me; showInformation(); } }
// Lấy phòng theo mã phòng room_id public rooms get1Room(int room_id) { string sql = "Select * From rooms, room_types where rooms.room_type_id=room_types.room_type_id And room_id=@room_id"; con.Open(); SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("room_id", room_id); SqlDataReader rd = cmd.ExecuteReader(); rooms room = null; if (rd.Read()) { room = new rooms(); room.room_id = (int)rd["room_id"]; room.room_name = (string)rd["room_name"]; room.room_status = (Boolean)rd["room_status"]; room.room_type_id = (int)rd["room_type_id"]; } con.Close(); return(room); }
static string[] GetRoomForType(rooms room) { return(Rooms[room]); }
public void Rooms_Test2() { string[] errors = new string[] { }; patients t_patients = null; doctors t_doctors = null; rooms t_rooms = null; appointments t_appointments = null; t_patients = _dentnedModel.Patients.FirstOrDefault(r => r.patients_name == "XX1" && r.patients_surname == "XX1"); if (t_patients != null) { _dentnedModel.Appointments.Remove(_dentnedModel.Appointments.List(r => r.patients_id == t_patients.patients_id).ToArray()); } _dentnedModel.Patients.Remove(_dentnedModel.Patients.List(r => r.patients_name == "XX1" && r.patients_surname == "XX1").ToArray()); _dentnedModel.Doctors.Remove(_dentnedModel.Doctors.List(r => r.doctors_name == "XX1" && r.doctors_surname == "XX1").ToArray()); _dentnedModel.Rooms.Remove(_dentnedModel.Rooms.List(r => r.rooms_name == "XX1").ToArray()); t_patients = new patients() { patients_name = "XX1", patients_surname = "XX1", patients_birthdate = DateTime.Now, patients_birthcity = "xxx", patients_doctext = "xxx", patients_sex = "M", patients_username = "******", patients_password = "******" }; _dentnedModel.Patients.Add(t_patients); t_doctors = new doctors() { doctors_name = "XX1", doctors_surname = "XX1", doctors_doctext = "XXXXX", doctors_username = "******", doctors_password = "******" }; _dentnedModel.Doctors.Add(t_doctors); t_rooms = new rooms() { rooms_name = "XX1" }; _dentnedModel.Rooms.Add(t_rooms); t_appointments = new appointments() { patients_id = t_patients.patients_id, doctors_id = t_doctors.doctors_id, rooms_id = t_rooms.rooms_id, appointments_title = "xxx", appointments_from = DateTime.Now, appointments_to = DateTime.Now.AddMinutes(40) }; _dentnedModel.Appointments.Add(t_appointments); Assert.IsFalse(_dentnedModel.Rooms.CanRemove(_dentnedModel.Rooms.List(r => r.rooms_name == "XX1").ToArray())); t_patients = _dentnedModel.Patients.FirstOrDefault(r => r.patients_name == "XX1" && r.patients_surname == "XX1"); if (t_patients != null) { _dentnedModel.Appointments.Remove(_dentnedModel.Appointments.List(r => r.patients_id == t_patients.patients_id).ToArray()); } Assert.IsTrue(_dentnedModel.Rooms.CanRemove(_dentnedModel.Rooms.List(r => r.rooms_name == "XX1").ToArray())); _dentnedModel.Patients.Remove(_dentnedModel.Patients.List(r => r.patients_name == "XX1" && r.patients_surname == "XX1").ToArray()); _dentnedModel.Doctors.Remove(_dentnedModel.Doctors.List(r => r.doctors_name == "XX1" && r.doctors_surname == "XX1").ToArray()); _dentnedModel.Rooms.Remove(_dentnedModel.Rooms.List(r => r.rooms_name == "XX1").ToArray()); }