示例#1
0
 public void Save(RoomType roomType)
 {
     if (roomType.IsValid())
     {
         RoomTypeRepo.Save(roomType);
     }
 }
示例#2
0
 public CreateRateCategoryItemModel(RoomType roomType)
 {
     RoomTypeId = roomType.Id;
     Name = roomType.Name.GetText(LanguageTypeEnum.English);
     Value = 0.0m;
     IsActive = true;
 }
示例#3
0
 public double[] getUtilizationAndLWBS(RoomType[] rooms)
 {
     double[] values = new double[7];
     SQLiteConnection conn = new SQLiteConnection("Data Source = configs.db");
     conn.Open();
     String sql = "select * from Results where ";
     for (int i = 0; i < 6; i++)
     {
         if(i < 5)
             sql += rooms[i].name.Replace(" ", "") + " = " + rooms[i].num + " and ";
         else
             sql += rooms[i].name.Replace(" ", "") + " = " + rooms[i].num;
     }
     //Console.Write(sql);
     SQLiteCommand cmd = new SQLiteCommand(sql, conn);
     SQLiteDataReader dr = cmd.ExecuteReader();
     while(dr.Read())
     {
         values[0] = Convert.ToDouble(dr["ExamRoomUtilization"]);
         values[1] = Convert.ToDouble(dr["TraumaUtilization"]);
         values[2] = Convert.ToDouble(dr["FastTrackUtilization"]);
         values[3] = Convert.ToDouble(dr["RapidAdmissionUnitUtilization"]);
         values[4] = Convert.ToDouble(dr["BehavioralUtilization"]);
         values[5] = Convert.ToDouble(dr["ObservationUtilization"]);
         values[6] = Convert.ToDouble(dr["LWBS"]);
     }
     //System.Diagnostics.Debug.WriteLine(values);
     return values;
 }
 public Room(int roomId, string roomNumber, RoomType rmType, bool availability)
 {
     this._roomId = roomId;
     this._roomNumber = roomNumber;
     this._roomType = rmType;
     this._availability = availability;
 }
示例#5
0
 public void Initialize( int id, RoomType type )
 {
     this.id = id;
     this.type = type;
     roomLight.color = ColorSettings.Instance.GetColorByRoomType( type );
     roomLight.range = _roomWidth * .5f;
 }
示例#6
0
    public void InitializeComplex(string complexCode, UserInfos[] users, int nbjoueurs)
    {
        int i;
        RoomType[,] comp = new RoomType[5, 5];
        string[] lines = complexCode.Split(':');
        for (i = 0; i < 5; i++)
        {
            string[] rooms = lines[i].Split(',');
            for(int j = 0; j < 5; j++)
            {
                int room = int.Parse(rooms[j]);
                print("salle actuelle : " + room);
                comp[i, j] = (RoomType)room;
            }
        }
        InstantiateComplex();
        LoadComplex(comp);

        for (i = 0; i < nbjoueurs; i++)
        {
            players[i] = InstantiateCharacter(users[i]);
        }
        nbplayers = nbjoueurs;
        ReplaceAllPlayers(2, 2);
    }
示例#7
0
 public void FlashScreen( RoomType type )
 {
     StopCoroutine( "FadeScreen" );
     _originalColor = ColorSettings.Instance.GetColorByRoomType( type );
     colorScreen.color = _originalColor;
     StartCoroutine( "FadeScreen" );
 }
示例#8
0
文件: Room.cs 项目: Somerse/Betrayal
 public Room(RoomType _roomType, Vector2 _location, int _size)
 {
     roomType = _roomType;
     location = _location;
     size = _size;
     items = new List<Item>();
 }
示例#9
0
文件: Portal.cs 项目: akbiggs/Trauma
 public Portal(RoomType type, Vector2 position, Vector2 size, Color color, bool isCorrect=false)
     : base(position, Vector2.Zero, Vector2.Zero, Vector2.Zero, Vector2.Zero, 
     color, true, size, GetAnimations(type), "Spin1", 0)
 {
     IsCorrect = isCorrect;
     this.type = type;
 }
示例#10
0
 public RoomInfo(uint Id, RoomType Type, uint OwnerId, string Name, string Description, List<string> Tags,
     RoomAccessType AccessType, string Password, RoomIcon Icon, int CategoryId, int MaxUsers, string Swfs,
     int Score, string ModelName, bool AllowPets, bool AllowPetEating, bool DisableBlocking, bool HideWalls,
     string PubInternalName, int WallThickness, int FloorThickness, Dictionary<string, string> Decorations)
 {
     mId = Id;
     mType = Type;
     mOwnerId = OwnerId;
     mName = Name;
     mDescription = Description;
     mTags = Tags;
     mAccessType = AccessType;
     mPassword = Password;
     mIcon = Icon;
     mCategoryId = CategoryId;
     mMaxUsers = MaxUsers;
     mSwfs = Swfs;
     mCacheAge = UnixTimestamp.GetCurrent();
     mScore = Score;
     mModelName = ModelName;
     mAllowPets = AllowPets;
     mAllowPetEating = AllowPetEating;
     mDisableRoomBlocking = DisableBlocking;
     mHideWalls = HideWalls;
     mPubInternalName = PubInternalName;
     mWallThickness = WallThickness;
     mFloorThickness = FloorThickness;
     mDecorations = Decorations;
     mSyncRoot = new object();
 }
        protected void btnAddRoomType_Click(object sender, EventArgs e)
        {
            roomTypeHandler = new RoomTypeHandler();

            string option = "";
            double num = 0;
            option = txtRate.Text.Trim();

            if (double.TryParse(option, out num) == true)
            {
                RoomType roomType = new RoomType();
                roomType.TypeID = Convert.ToInt32(lblTypeID.Text.Trim());
                roomType.Name = txtName.Text;
                roomType.MaxCapacity = Convert.ToInt32(txtRoomTypeCapacity.Text.Trim());
                roomType.RatePerNight = Convert.ToDouble(txtRate.Text.Trim());

                roomTypeHandler.UpdateRoomType(roomType);

                lblProgress.Text = "Room edited successfully.";

                //delay redirect to alert user of page change
                lblRedirect.Text = "Redirecting to room type list in 5 seconds.";
                Response.Write("<script type=\"text/javascript\">setTimeout(function () { window.location.href = \"ViewRoomTypes.aspx\"; }, 5000);</script>");
            }

            else if (double.TryParse(option, out num) == false)
            {
                lblRoomTypeRateIsNumberValidator.Visible = true;
            }

            else if (txtRate.Text == null)
            {
                lblRoomTypeRateIsNumberValidator.Visible = false;
            }
        }
        public IHttpActionResult PutRoomTypes(int id, RoomType roomtype)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != roomtype.Id)
            {
                return BadRequest();
            }

            

            try
            {
                _RoomTypesService.Update(roomtype);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_RoomTypesService.Exists(id) )
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
示例#13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ID">room id</param>
 /// <param name="beds">amount of beds in room</param>
 /// <param name="price">price for 1 day</param>
 /// <param name="type">Regular or Suite</param>
 /// <param name="seaWatching">the room watchs of the sea?</param>
 public Room(uint ID, uint beds = 1, uint price = 100, RoomType type = RoomType.Regular, bool seaWatching = false)
 {
     Beds = beds;
     Type = type;
     SeaWatching = seaWatching;
     Price = price;
     RoomID = ID;
 }
 public HotelRoom FreeHotelRoom(string hotelName, RoomType type)
 {
     return this.hotelRooms.All()
         .Where(hr => !hr.Booked &&
                hr.Hotel.Name == hotelName &&
                hr.Room.Type == type)
         .FirstOrDefault();
 }
示例#15
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="roomType"></param>
        /// <param name="seasons"></param>
        /// <param name="inventoryStatus"></param>
        /// <param name="arrival"></param>
        /// <param name="departure"></param>
        public RoomAvailability(RoomType roomType, IList<Season> seasons, IList<InventoryStatus> inventoryStatus, DateTime arrival, DateTime departure)
        {
            Seasons = seasons;
            InventoryStatus = inventoryStatus;
            Arrival = arrival;
            Departure = departure;

            RoomType = roomType;
            Duration = (Departure - Arrival).Days;
        }
示例#16
0
        private int roomWidth = 0; //Includes walls.

        #endregion Fields

        #region Constructors

        public Room(int start_X, int start_Y, int end_X, int end_Y)
        {
            this.roomStart_X = start_X;
            this.roomStart_Y = start_Y;
            this.roomEnd_X = end_X;
            this.roomEnd_Y = end_Y;
            roomType = RoomType.Square;
            roomWidth = roomEnd_X + 1 - roomStart_X;
            roomHeight = roomEnd_Y + 1 - roomStart_Y;
        }
示例#17
0
 static RoomType() {
     RoomTypes = new RoomType[14];
     for (int i = 0; i < 14; i++)
         RoomTypes[i] = new RoomType();
     RoomTypes[0].RotationResult[Rotation.RIGHT] = RoomTypes[0];
     RoomTypes[0].RotationResult[Rotation.LEFT] = RoomTypes[0];
     RoomTypes[1].Paths[Direction.LEFT] = Direction.DOWN;
     RoomTypes[1].Paths[Direction.RIGHT] = Direction.DOWN;
     RoomTypes[1].Paths[Direction.UP] = Direction.DOWN;
     RoomTypes[1].RotationResult[Rotation.RIGHT] = RoomTypes[1];
     RoomTypes[1].RotationResult[Rotation.LEFT] = RoomTypes[1];
     RoomTypes[2].Paths[Direction.LEFT] = Direction.RIGHT;
     RoomTypes[2].Paths[Direction.RIGHT] = Direction.LEFT;
     RoomTypes[2].RotationResult[Rotation.RIGHT] = RoomTypes[3];
     RoomTypes[2].RotationResult[Rotation.LEFT] = RoomTypes[3];
     RoomTypes[3].Paths[Direction.UP] = Direction.DOWN;
     RoomTypes[3].RotationResult[Rotation.RIGHT] = RoomTypes[2];
     RoomTypes[3].RotationResult[Rotation.LEFT] = RoomTypes[2];
     RoomTypes[4].Paths[Direction.RIGHT] = Direction.DOWN;
     RoomTypes[4].Paths[Direction.UP] = Direction.LEFT;
     RoomTypes[4].RotationResult[Rotation.RIGHT] = RoomTypes[5];
     RoomTypes[4].RotationResult[Rotation.LEFT] = RoomTypes[5];
     RoomTypes[5].Paths[Direction.LEFT] = Direction.DOWN;
     RoomTypes[5].Paths[Direction.UP] = Direction.RIGHT;
     RoomTypes[5].RotationResult[Rotation.RIGHT] = RoomTypes[4];
     RoomTypes[5].RotationResult[Rotation.LEFT] = RoomTypes[4];
     RoomTypes[6].Paths[Direction.LEFT] = Direction.RIGHT;
     RoomTypes[6].Paths[Direction.RIGHT] = Direction.LEFT;
     RoomTypes[6].RotationResult[Rotation.RIGHT] = RoomTypes[7];
     RoomTypes[6].RotationResult[Rotation.LEFT] = RoomTypes[9];
     RoomTypes[7].Paths[Direction.UP] = Direction.DOWN;
     RoomTypes[7].Paths[Direction.RIGHT] = Direction.DOWN;
     RoomTypes[7].RotationResult[Rotation.RIGHT] = RoomTypes[8];
     RoomTypes[7].RotationResult[Rotation.LEFT] = RoomTypes[6];
     RoomTypes[8].Paths[Direction.LEFT] = Direction.DOWN;
     RoomTypes[8].Paths[Direction.RIGHT] = Direction.DOWN;
     RoomTypes[8].RotationResult[Rotation.RIGHT] = RoomTypes[9];
     RoomTypes[8].RotationResult[Rotation.LEFT] = RoomTypes[7];
     RoomTypes[9].Paths[Direction.LEFT] = Direction.DOWN;
     RoomTypes[9].Paths[Direction.UP] = Direction.DOWN;
     RoomTypes[9].RotationResult[Rotation.RIGHT] = RoomTypes[6];
     RoomTypes[9].RotationResult[Rotation.LEFT] = RoomTypes[8];
     RoomTypes[10].Paths[Direction.UP] = Direction.LEFT;
     RoomTypes[10].RotationResult[Rotation.RIGHT] = RoomTypes[11];
     RoomTypes[10].RotationResult[Rotation.LEFT] = RoomTypes[13];
     RoomTypes[11].Paths[Direction.UP] = Direction.RIGHT;
     RoomTypes[11].RotationResult[Rotation.RIGHT] = RoomTypes[12];
     RoomTypes[11].RotationResult[Rotation.LEFT] = RoomTypes[10];
     RoomTypes[12].Paths[Direction.RIGHT] = Direction.DOWN;
     RoomTypes[12].RotationResult[Rotation.RIGHT] = RoomTypes[13];
     RoomTypes[12].RotationResult[Rotation.LEFT] = RoomTypes[11];
     RoomTypes[13].Paths[Direction.LEFT] = Direction.DOWN;
     RoomTypes[13].RotationResult[Rotation.RIGHT] = RoomTypes[10];
     RoomTypes[13].RotationResult[Rotation.LEFT] = RoomTypes[12];
 }
示例#18
0
	// Constructor room
	public Room()
	{
		roomId = ++roomIdCounter;
		type = RoomType.None;
		leftBottom = new Vector2();
		leftTop = new Vector2();
		rightBottom = new Vector2();
		rightTop = new Vector2();
		xLength = 0;
		yLength = 0;
	}
示例#19
0
 public static void insertRoomType(string name, double price)
 {
     var context = new MovieTheaterEntities();
     RoomType rt = new RoomType();
     rt.RoomType_Name = name;
     rt.Price = price;
     rt.Active_Indicator = true;
     rt.Update_Datetime = DateTime.Today;
     context.RoomType.Add(rt);
     context.SaveChanges();
 }
示例#20
0
    public Room GetRoom(RoomType roomType)
    {
        for(var i = 0; i < rooms.Length; i++)
        {
            if (rooms[i].roomType == roomType)
                return rooms[i];
        }

        Debug.LogWarning("Could not find room as type '" + roomType.ToString() + "'.");
        return null;
    }
示例#21
0
        public static List<Facility> SearchFacilities(Faculties fac, int minCap, int maxCap, RoomType rtype, bool hasWebcast, bool hasFlexiSeat,
            bool hasVidConf, bool hasMIC, bool hasProjector, bool hasVisualizer)
        {
            List<Facility> fList = SearchFacilities(minCap, maxCap, rtype, hasWebcast, hasFlexiSeat,
            hasVidConf, hasMIC, hasProjector, hasVisualizer);

            List<Facility> filteredByFacList = (from faci in fList
                                                where faci.Faculty == fac
                                                select faci).ToList<Facility>();

            return filteredByFacList;
        }
        protected void btnDeleteRoomType_Click(object sender, EventArgs e)
        {
            RoomType roomType = new RoomType();
            roomType.TypeID = Convert.ToInt32(lblRoomTypeID.Text);
            roomTypeHandler.DeleteRoomType(roomType);

            lblProgress.Text = "Room type was deleted.";

            //delay redirect to alert user of page change
            lblRedirect.Text = "Redirecting to room type list in 5 seconds.";
            Response.Write("<script type=\"text/javascript\">setTimeout(function () { window.location.href = \"ViewRoomTypes.aspx\"; }, 5000);</script>");
        }
示例#23
0
    private void Accept_Click(object sender, RoutedEventArgs e)
    {
      Name = RoomNameTextBox.Text;
      Type = VoiceRoomCheckBox.IsChecked == true ? RoomType.Voice : RoomType.Chat;

      if (string.IsNullOrEmpty(Name))
      {
        MessageBox.Show(this, "Проверьте правильность заполнения всех полей.", "TCP Chat");
        return;
      }

      DialogResult = true;
    }
        protected void btnAddRoomType_Click(object sender, EventArgs e)
        {
            handler = new RoomTypeHandler();
            int rateId = 0;
            string option = "";
            double num = 0;
            option = txtRatePerNight.Text;

            if (double.TryParse(option, out num) == true && handler.ValidateRoomTypeName(txtRoomTypeName.Text) == false && double.TryParse(option, out num) == true)
            {
                RoomType roomType = new RoomType();
                roomType.Name = txtRoomTypeName.Text;
                roomType.MaxCapacity = int.Parse(txtRoomTypeCapacity.Text);
                roomType.RatePerNight = Convert.ToDouble(txtRatePerNight.Text);

                handler.AddNewRoomType(roomType);
                rateId = handler.GetLastRoomTypeID();
                handler.AddNewRate(Convert.ToDouble(txtRatePerNight.Text), rateId);
                Response.Redirect("ViewRoomTypes.aspx");
            }

            if (handler.ValidateRoomTypeName(txtRoomTypeName.Text) == false)
            {
                DuplicateNameValidator.Visible = false;
            }

            if (handler.ValidateRoomTypeName(txtRoomTypeName.Text) == true)
            {
                DuplicateNameValidator.Visible = true;
            }

            if (txtRoomTypeName == null)
            {
                DuplicateNameValidator.Visible = false;
            }

            if (double.TryParse(option, out num) == false)
            {
                lblRoomTypeRateIsNumberValidator.Visible = true;
            }

            if (double.TryParse(option, out num) == true)
            {
                lblRoomTypeRateIsNumberValidator.Visible = false;
            }

            if (txtRatePerNight.Text == null)
            {
                lblRoomTypeRateIsNumberValidator.Visible = false;
            }
        }
示例#25
0
	// Use this for initialization
	void Start () 
	{	
		// Instantiate tile for hover
		hoverTile = (GameObject) Instantiate(hoverTile);
		hoverTile.GetComponentInChildren<MeshRenderer>().enabled = false;
		
		// Create a mesh renderer component
		hoverTileRenderer = hoverTile.GetComponentInChildren<MeshRenderer>();
		
		// Initialize other variables
		selectedRoomType = RoomType.None;
		selectedCell = new Vector2(-1,-1);
		rooms = new List<Room>();
	}
示例#26
0
 public void DisplayEffect(RoomType room)
 {
     switch (room)
     {
         case RoomType.VORTEX:
             effectImage.sprite = vortexEffect;
             break;
         case RoomType.VISION:
             effectImage.sprite = visionEffect;
             break;
         case RoomType.PIEGE:
             effectImage.sprite = trapEffect;
             break;
         case RoomType.MOBILE:
             effectImage.sprite = mobileEffect;
             break;
         case RoomType.CONTROLE:
             effectImage.sprite = controlEffect;
             break;
         case RoomType.JUMELLE:
             break;
         case RoomType.MORTELLE:
             effectImage.sprite = fireEffect;
             break;
         case RoomType.PRISON:
             effectImage.sprite = prisonEffect;
             break;
         case RoomType.ILLUSION:
             effectImage.sprite = illusionEffect;
             break;
         case RoomType.INNONDABLE:
             effectImage.sprite = waterEffect;
             break;
         case RoomType.ACIDE:
             effectImage.sprite = acidEffect;
             break;
         case RoomType.FROIDE:
             effectImage.sprite = freezeEffect;
             break;
         case RoomType.NOIRE:
             effectImage.sprite = blackEffect;
             break;
         default:
             effectImage.enabled = false;
             effectImage.sprite = null;
             return;
     }
     Appear();   
     effectImage.enabled = true ;
 }
 public bool ValidateRoomTypeName(string name)
 {
     RoomType roomType = new RoomType();
     roomType = roomTypeDB.ValidateRoomTypeName(name);
     bool exists = false;
     try
     {
         if (roomType.Name != null)
             exists = true;
     }
     catch (NullReferenceException)
     {
         exists = false;
     }
     return exists;
 }
示例#28
0
 private static Rectangle GetTextureSourceRectangle(RoomType type)
 {
     switch (type) {
         case RoomType.VisitedRoom:
             return new Rectangle(16, 0, 17, 16);
         case RoomType.Current:
             return new Rectangle(32, 0, 16, 16);
         case RoomType.Start:
             return new Rectangle(0, 0, 16, 16);
         case RoomType.UnvisitedRoom:
             return new Rectangle(64, 0, 16, 16);
         case RoomType.Boss:
             return new Rectangle(48, 0, 16, 16);
         default:
             return new Rectangle(0, 0, 0, 0);
     }
 }
示例#29
0
    public static Room createInstance(RoomType type)
    {
        switch (type)
        {
            case RoomType.Kitchen:
                return new Kitchen();

            case RoomType.Sauna:
                return new Sauna();

            case RoomType.LivingRoom:
                return new LivingRoom();

            default:
                throw new ApplicationException("Unsupported room type: " + type.ToString());
        }
    }
示例#30
0
 public Facility(string id, Faculties fac, string loc, string bookingCon, string techCon, int cap,
     RoomType rType, bool hasWebCast, bool flexiSeat, bool vidConf, bool mic, bool projector, bool visualizer)
 {
     this.bookingContact = bookingCon;
     this.facilityID = id;
     this.fac = fac;
     this.location = loc;
     this.techContact = techCon;
     this.bookingContact = bookingCon;
     this.capacity = cap;
     this.rType = rType;
     this.webcast = hasWebCast;
     this.flexibleSeating = flexiSeat;
     this.videoConferencing = vidConf;
     this.mic = mic;
     this.projector = projector;
     this.visualizer = visualizer;
 }
示例#31
0
 /// <summary>
 /// Method which I use to take capacity of a roomtype to be assigned to objects later on
 /// </summary>
 public int GetCapacity(RoomType x)
 {
     if (x == RoomType.Single_Room)
     {
         return(1);
     }
     if (x == RoomType.Double_Room)
     {
         return(2);
     }
     if (x == RoomType.Family_Room)
     {
         return(4);
     }
     if (x == RoomType.Lux_Room)
     {
         return(1);
     }
     if (x == RoomType.Dormitory_Room)
     {
         return(8);
     }
     return(0);
 }
        private void edit_Click_1(object sender, RoutedEventArgs e)
        {
            RoomType item = (RoomType)dataGrid.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("请选择数据行");
                return;
            }

            MessageBox.Show(item.type, item.description);

            currentItem = new RoomType();
            ObjectUtils.copyObjectValues(item, currentItem);

            /*
             * FileEdit window = new FileEdit(this);
             * window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
             * if (window.ShowDialog() == true)
             * {
             *
             * }
             */
        }
示例#33
0
        public static void SerializeRoom(Room room, string head, List <string> list)
        {
            int genericId = room.GenericID;

            list.Add(head + "." + genericId);

            RoomType roomType = room.RoomType;

            list.Add(head + "." + roomType);

            ZoneType zoneType = room.ZoneType;

            list.Add(head + "." + zoneType);

            Vector forward = room.Forward;

            SerializeVector(forward, head + ".Room-forward", list);
            Vector position = room.Position;

            SerializeVector(position, head + ".Room-position", list);
            Vector vector = room.SpeakerPosition;

            SerializeVector(vector, head + ".Room-speakerPosition", list);
        }
示例#34
0
        public void Init(LevelGenerator.RoomData roomData, RoomType type)
        {
            if (type == RoomType.None)
            {
                Log("Initializing a non-existing room. Check whether this is wanted.", LogType.Warning);
                return;
            }

            _type           = type;
            GridPosition    = roomData.GridPosition;
            _availableDoors = roomData.Doors;
            _neighbourIDs   = roomData.Neighbours;
            OwnID           = roomData.ID;

            _corners = new Transform[_cornersObj.transform.childCount];
            for (int i = 0; i < _corners.Length; i++)
            {
                _corners[i] = _cornersObj.transform.GetChild(i);
            }

            LockUnavailableDoors();
            InitializeDoors();
            SpawnMonsters();
        }
示例#35
0
    public void PlayRoomSound(RoomType desiredRoomType)
    {
        switch (desiredRoomType)
        {
        case RoomType.Bathroom:
            SoundSystem.PlaySoundEffect(SoundEffects.SoundEffectDictionary["Toilet"]);
            break;

        case RoomType.Bedroom:
            SoundSystem.PlaySoundEffect(SoundEffects.SoundEffectDictionary["Bedroom"]);
            break;

        case RoomType.Gym:
            SoundSystem.PlaySoundEffect(SoundEffects.SoundEffectDictionary["Gym"]);
            break;

        case RoomType.LivingRoom:
            SoundSystem.PlaySoundEffect(SoundEffects.SoundEffectDictionary["Bookpaper"]);
            break;

        default:
            break;
        }
    }
示例#36
0
 public StiffyRoom(int a, RoomType TypeOfRoom) : base(a)
 {
     this.TypeOfRoom = TypeOfRoom;
 }
示例#37
0
 /// <summary>
 /// Change the room type of this room
 /// </summary>
 /// <param name="roomType">new room type</param>
 public void setRoomType(RoomType roomType)
 {
     this.roomType = roomType;
 }
示例#38
0
文件: Room.cs 项目: boadle/CCTV-VR
 public Room(IntPtr o)
 {
     ApplicationID = CAPI.ovr_Room_GetApplicationID(o);
     DataStore     = CAPI.DataStoreFromNative(CAPI.ovr_Room_GetDataStore(o));
     Description   = CAPI.ovr_Room_GetDescription(o);
     ID            = CAPI.ovr_Room_GetID(o);
     {
         var pointer = CAPI.ovr_Room_GetInvitedUsers(o);
         InvitedUsers = new UserList(pointer);
         if (pointer == IntPtr.Zero)
         {
             InvitedUsersOptional = null;
         }
         else
         {
             InvitedUsersOptional = InvitedUsers;
         }
     }
     IsMembershipLocked = CAPI.ovr_Room_GetIsMembershipLocked(o);
     JoinPolicy         = CAPI.ovr_Room_GetJoinPolicy(o);
     Joinability        = CAPI.ovr_Room_GetJoinability(o);
     {
         var pointer = CAPI.ovr_Room_GetMatchedUsers(o);
         MatchedUsers = new MatchmakingEnqueuedUserList(pointer);
         if (pointer == IntPtr.Zero)
         {
             MatchedUsersOptional = null;
         }
         else
         {
             MatchedUsersOptional = MatchedUsers;
         }
     }
     MaxUsers = CAPI.ovr_Room_GetMaxUsers(o);
     Name     = CAPI.ovr_Room_GetName(o);
     {
         var pointer = CAPI.ovr_Room_GetOwner(o);
         Owner = new User(pointer);
         if (pointer == IntPtr.Zero)
         {
             OwnerOptional = null;
         }
         else
         {
             OwnerOptional = Owner;
         }
     }
     {
         var pointer = CAPI.ovr_Room_GetTeams(o);
         Teams = new TeamList(pointer);
         if (pointer == IntPtr.Zero)
         {
             TeamsOptional = null;
         }
         else
         {
             TeamsOptional = Teams;
         }
     }
     Type = CAPI.ovr_Room_GetType(o);
     {
         var pointer = CAPI.ovr_Room_GetUsers(o);
         Users = new UserList(pointer);
         if (pointer == IntPtr.Zero)
         {
             UsersOptional = null;
         }
         else
         {
             UsersOptional = Users;
         }
     }
     Version = CAPI.ovr_Room_GetVersion(o);
 }
示例#39
0
 public static int InsertType(RoomType rt)
 {
     return(TypeService.InsertType(rt));
 }
 //set a nodes room type
 public void SetType(RoomType Type)
 {
     roomType = Type;
 }
示例#41
0
 public void Update(RoomType roomType)
 {
     _uow.Repository <RoomType>().Update(roomType);
 }
示例#42
0
 public Room(long _id, int _roomNumber, RoomType _roomType)
 {
     Id         = _id;
     RoomNumber = _roomNumber;
     RoomType   = _roomType;
 }
示例#43
0
 public void UpdateRoomtype(RoomType roomType)
 {
     _roomtypeDALProvider.Update(roomType);
 }
示例#44
0
 public RoomInput(uint cost, RoomType roomType, IEnumerable <string> images)
 {
     RoomType = roomType;
     Cost     = cost;
     Images   = images;
 }
示例#45
0
        public async Task <ActionResult <Reservation> > AddReservation(RoomType type, int idguest, DateTime checkin, DateTime checkout, bool breakfestincluded)
        {
            var RoomToRentTypeList = (from Room item in _context.Rooms
                                      where item.nubmerbeds == type
                                      select item).ToList();

            var GuestToRent = (from Guest item in _context.Guests
                               where item.GuestID == idguest
                               select item).SingleOrDefault();
            var RoomTypeNumbers = (from Room n in RoomToRentTypeList
                                   select n.RoomID).ToList();
            var ReservationTypes = (from Reservation n in _context.Reserevations
                                    where RoomTypeNumbers.Contains(n.Room.RoomID)
                                    select n);

            // need db for checkin&checkoutvalues
            // filtering method propsal
            DateTime checkinvalue  = new DateTime();
            DateTime checkoutvalue = new DateTime();

            checkinvalue  = checkin;
            checkoutvalue = checkout;
            int numberOfRoomProposal = (from Reservation m in ReservationTypes
                                        where (checkinvalue < m.Check_in &&
                                               checkoutvalue < m.Check_in) ||
                                        (checkinvalue > m.Check_out &&
                                         checkoutvalue > m.Check_out)
                                        select m.Room.RoomID).FirstOrDefault();
            // lista numerów zajętych w konkretnej dacie
            var numbersOfRoomOccupied = (from Reservation m in ReservationTypes
                                         where (checkinvalue >= m.Check_in &&
                                                checkinvalue <= m.Check_out) ||
                                         (checkoutvalue >= m.Check_in &&
                                          checkoutvalue <= m.Check_out)
                                         select m.Room.RoomID).ToList();
            // lista z wyrzuconymi zajętymi numerami
            var RoomsToRent = (from Room n in RoomToRentTypeList
                               where !numbersOfRoomOccupied.Contains(n.RoomID)
                               select n).ToList();

            /*var RoomToRent = (from Room n in RoomToRentTypeList
             *                where n.RoomID == numberOfRoomProposal
             *                select n).FirstOrDefault();*/

            var RoomToRent = (from Room n in RoomsToRent
                              select n).FirstOrDefault();

            Reservation NewReservation = new Reservation();

            if (RoomToRent != null)
            {
                //RoomToRent.Is_ocuppied = true;


                NewReservation.Status = 0;
                NewReservation.Guest  = GuestToRent;

                NewReservation.Room      = RoomToRent;
                NewReservation.Check_in  = checkin;
                NewReservation.Check_out = checkout;

                NewReservation.BreakfestIncluded = breakfestincluded;
                // add breakfest fee with "if" conditional
                if (NewReservation.BreakfestIncluded == true)
                {
                    NewReservation.TotalAmount = ((checkout.DayOfYear - checkin.DayOfYear) * RoomToRent.ReguralPrice) + ((checkout.DayOfYear - checkin.DayOfYear) * 80);
                }
                else
                {
                    NewReservation.TotalAmount = (checkout.DayOfYear - checkin.DayOfYear) * RoomToRent.ReguralPrice;
                }
                //Old way of Total Amount Count method
                //NewReservation.TotalAmount = (checkout.DayOfYear - checkin.DayOfYear) * RoomToRent.ReguralPrice;
                _context.Reserevations.Add(NewReservation);
                await _context.SaveChangesAsync();
            }
            return(CreatedAtAction("GetReservation", new { id = NewReservation.ReservationID }, NewReservation));

            //throw new NotImplementedException();
        }
示例#46
0
 internal IRoomPrice GetRoomPrice(RoomType rType)
 {
     return(dbCon.GetRoomPrice(rType));
 }
示例#47
0
 public Room(RoomType type, int id, int row, int column) : base(row, column)
 {
     Id   = id;
     Type = type;
 }
示例#48
0
 public static int UpdateType(RoomType rt)
 {
     return(TypeService.UpdateType(rt));
 }
示例#49
0
 public bool Add(RoomType roomtype)
 {
     return _roomtypeRepository.Add(roomtype);
 }
示例#50
0
 public Room(int _roomNumber, RoomType _roomType)
 {
     RoomNumber = _roomNumber;
     RoomType   = _roomType;
 }
示例#51
0
 public void AddRoomtype(RoomType roomType)
 {
     _roomtypeDALProvider.Add(roomType);
 }
示例#52
0
 public void Clear()
 {
     type = RoomType.RT_EMPTY;
     System.Array.Clear(conn, 0, conn.Length);
 }
 //set up class
 public SCR_NodeClass()
 {
     nodeID        = new STR_ID();
     nodeNeigbours = new List <STR_ID>();
     roomType      = RoomType.SecondaryPathway;
 }
示例#54
0
        public async Task <JsonResult> GetResources([FromBody] Event2 event2)
        {
            AppIdentityUser _user = await _userManager.FindByNameAsync(User.Identity.Name);

            var channel = _context.FncChannelType.ToList();

            #region GetEvents
            var             branch             = event2.Branch;
            Branch2         resources2         = new Branch2();
            List <RoomType> roomTypeList       = new List <RoomType>();
            var             fncBranch          = _context.FncBranch.SingleOrDefault(x => x.BranchName == branch);
            var             fncHouseTypeList   = _context.FncHouseType.Include(x => x.FncHouseNumber).Where(x => x.BranchId == fncBranch.BranchId && x.IsReal).ToList();
            var             typeCollet         = fncHouseTypeList.Select(x => x.HouseTypeId).ToArray();
            var             fncHouseNumberList = _context.FncHouseNumber.Where(x => typeCollet.Contains(x.HouseTypeId)).ToList();
            var             numberCollet       = fncHouseNumberList.Select(x => new { x.HouseNumberId, x.HouseNumber }).ToList();
            List <Room>     roomNumberList     = new List <Room>();
            foreach (var fncHouseNumber in fncHouseNumberList)
            {
                var room = new Room();
                room.id = fncHouseNumber.HouseNumber;
                if (fncHouseNumber.isClean)
                {
                    room.title = fncHouseNumber.HouseNumber;
                }
                else
                {
                    room.title = fncHouseNumber.HouseNumber + " 脏";
                }
                room.typeId  = fncHouseNumber.HouseTypeId;
                room.isClean = fncHouseNumber.isClean;
                if (string.IsNullOrEmpty(room.state))
                {
                    room.state = "空";
                }
                foreach (var aaa in fncHouseTypeList)
                {
                    if (aaa.FncHouseNumber.Select(x => x.HouseNumber).Contains(room.title))
                    {
                        room.houseType = aaa.HouseType;
                        break;
                    }
                }
                roomNumberList.Add(room);
            }
            foreach (var fncHouseType in fncHouseTypeList)
            {
                var count1   = 0;
                var count2   = 0;
                var roomType = new RoomType();
                var roomList = new List <Room>();
                roomType.id    = fncHouseType.Order.ToString();
                roomType.title = fncHouseType.HouseType;
                roomType.order = fncHouseType.Order;
                foreach (var rrr in roomNumberList)
                {
                    var room = new Room();
                    if (fncHouseType.HouseTypeId == rrr.typeId)
                    {
                        count1++;
                        room.id      = rrr.id;
                        room.title   = rrr.title;
                        room.state   = rrr.state;
                        room.typeId  = rrr.typeId;
                        room.isClean = rrr.isClean;
                        if (room.state != "空")
                        {
                            count2++;
                        }
                        foreach (var aaa in fncHouseTypeList)
                        {
                            if (aaa.FncHouseNumber.Select(x => x.HouseNumber).Contains(room.title))
                            {
                                room.houseType = aaa.HouseType;
                                break;
                            }
                        }
                        roomList.Add(room);
                    }
                }
                if (count1 != count2)
                {
                    roomType.state = (count1 - count2).ToString() + " 间";
                }
                else
                {
                    roomType.state = "无房";
                }
                roomType.children = roomList;
                roomTypeList.Add(roomType);
            }

            resources2.id       = fncBranch.BranchName;
            resources2.title    = fncBranch.BranchName;
            resources2.isType   = fncBranch.IsType;
            resources2.children = roomNumberList;
            #endregion

            return(Json(new { resources2, channel, numberCollet }));
        }
示例#55
0
 public async Task <RoomType> Add(RoomType roomType)
 {
     return(await _uow.Repository <RoomType>().Insert(roomType));
 }
示例#56
0
        public async Task <JsonResult> GetCalendarData([FromBody] Event2 event2)
        {
            AppIdentityUser _user = await _userManager.FindByNameAsync(User.Identity.Name);

            var channel = _context.FncChannelType.ToList();

            #region GetEvents
            var             startDate          = event2.StartDate;
            var             endDate            = event2.EndDate;
            var             branch             = event2.Branch;
            var             frontData          = _context.BrhScalp.Where(x => DateTime.Compare(startDate, x.EndDate) <= 0 && DateTime.Compare(x.StartDate, endDate) < 0 && x.Branch == branch).ToList();
            var             todayData          = _context.BrhScalp.Where(x => DateTime.Compare(x.StartDate, DateTime.Now) <= 0 && DateTime.Compare(DateTime.Now, x.EndDate) < 0 && x.Branch == branch).ToList();
            Branch1         resources1         = new Branch1();
            Branch2         resources2         = new Branch2();
            List <RoomType> roomTypeList       = new List <RoomType>();
            var             fncBranch          = _context.FncBranch.SingleOrDefault(x => x.BranchName == branch);
            var             fncHouseTypeList   = _context.FncHouseType.Include(x => x.FncHouseNumber).Where(x => x.BranchId == fncBranch.BranchId && x.IsReal).ToList();
            var             typeCollet         = fncHouseTypeList.Select(x => x.HouseTypeId).ToArray();
            var             fncHouseNumberList = _context.FncHouseNumber.Where(x => typeCollet.Contains(x.HouseTypeId)).ToList();
            var             numberCollet       = fncHouseNumberList.Select(x => new { x.HouseNumberId, x.HouseNumber }).ToList();
            List <Room>     roomNumberList     = new List <Room>();
            foreach (var fncHouseNumber in fncHouseNumberList)
            {
                var room = new Room();
                room.id = fncHouseNumber.HouseNumber;
                if (fncHouseNumber.isClean)
                {
                    room.title = fncHouseNumber.HouseNumber;
                }
                else
                {
                    room.title = fncHouseNumber.HouseNumber + " 脏";
                }
                room.typeId  = fncHouseNumber.HouseTypeId;
                room.isClean = fncHouseNumber.isClean;
                if (string.IsNullOrEmpty(room.state))
                {
                    room.state = "空";
                }
                foreach (var aaa in fncHouseTypeList)
                {
                    if (aaa.FncHouseNumber.Select(x => x.HouseNumber).Contains(room.title))
                    {
                        room.houseType = aaa.HouseType;
                        break;
                    }
                }
                roomNumberList.Add(room);
            }
            foreach (var fncHouseType in fncHouseTypeList)
            {
                var count1   = 0;
                var count2   = 0;
                var roomType = new RoomType();
                var roomList = new List <Room>();
                roomType.id    = fncHouseType.Order.ToString();
                roomType.title = fncHouseType.HouseType;
                roomType.order = fncHouseType.Order;
                foreach (var rrr in roomNumberList)
                {
                    var room = new Room();
                    if (fncHouseType.HouseTypeId == rrr.typeId)
                    {
                        count1++;
                        room.id      = rrr.id;
                        room.title   = rrr.title;
                        room.state   = rrr.state;
                        room.typeId  = rrr.typeId;
                        room.isClean = rrr.isClean;
                        if (room.state != "空")
                        {
                            count2++;
                        }
                        foreach (var aaa in fncHouseTypeList)
                        {
                            if (aaa.FncHouseNumber.Select(x => x.HouseNumber).Contains(room.title))
                            {
                                room.houseType = aaa.HouseType;
                                break;
                            }
                        }
                        roomList.Add(room);
                    }
                }
                if (count1 != count2)
                {
                    roomType.state = (count1 - count2).ToString() + " 间";
                }
                else
                {
                    roomType.state = "无房";
                }
                roomType.children = roomList;
                roomTypeList.Add(roomType);
            }

            resources1.id       = fncBranch.BranchName;
            resources1.title    = fncBranch.BranchName;
            resources1.isType   = fncBranch.IsType;
            resources1.children = roomTypeList;
            resources2.id       = fncBranch.BranchName;
            resources2.title    = fncBranch.BranchName;
            resources2.isType   = fncBranch.IsType;
            resources2.children = roomNumberList;
            if (fncHouseNumberList.Count != todayData.Count)
            {
                resources1.state = (fncHouseNumberList.Count - todayData.Count).ToString() + " 间";
                resources2.state = (fncHouseNumberList.Count - todayData.Count).ToString() + " 间";
            }
            else
            {
                resources1.state = "满房";
                resources2.state = "满房";
            }

            List <Event2> events = new List <Event2>();
            for (var i = 0; i < 31; i++)
            {
                var eventTotal = new Event2();
                var tempDate   = startDate.AddDays(i);
                var templist   = frontData.Where(x => DateTime.Compare(x.StartDate, tempDate) <= 0 && DateTime.Compare(tempDate, x.EndDate) < 0).ToList();
                eventTotal.id         = resources1.id;
                eventTotal.resourceId = resources1.id;
                var total = templist.Count;
                if (total == fncHouseNumberList.Count)
                {
                    eventTotal.title     = "满刷";
                    eventTotal.className = "fullbranch";
                }
                else
                {
                    eventTotal.title     = total.ToString() + " 单";
                    eventTotal.className = "emptybranch";
                }
                eventTotal.allDay   = true;
                eventTotal.isTitle  = true;
                eventTotal.start    = tempDate.Date.ToString();
                eventTotal.end      = tempDate.AddDays(1).Date.ToString();
                eventTotal.editable = false;
                events.Add(eventTotal);
                foreach (var br in resources1.children)
                {
                    var tempevent = new Event2();
                    tempevent.id         = br.id;
                    tempevent.resourceId = br.id;
                    var j = 0;
                    foreach (var ff in templist)
                    {
                        if (br.children.Select(x => x.id).Contains(ff.HouseNumber))
                        {
                            j++;
                        }
                    }
                    tempevent.allDay  = true;
                    tempevent.isTitle = true;
                    tempevent.start   = tempDate.Date.ToString();
                    tempevent.end     = tempDate.AddDays(1).Date.ToString();
                    //tempevent.color = "gray";
                    tempevent.editable = false;
                    events.Add(tempevent);
                }
            }
            foreach (var f in frontData)
            {
                var tempevent = new Event2();
                tempevent.id                = f.ScalpId.ToString();
                tempevent.resourceId        = f.HouseNumber;
                tempevent.title             = f.CustomerName + " " + f.Channel;
                tempevent.allDay            = true;
                tempevent.start             = f.StartDate.Date.ToString();
                tempevent.end               = f.EndDate.Date.ToString();
                tempevent.Color             = f.Color;
                tempevent.IsFinance         = f.IsFinance;
                tempevent.IsFront           = f.IsFront;
                tempevent.ImprestAccountsId = f.ImprestAccountsId;
                tempevent.EnteringDate      = f.EnteringDate;
                tempevent.Branch            = f.Branch;
                tempevent.Channel           = f.Channel;
                tempevent.CustomerName      = f.CustomerName;
                tempevent.EndDate           = f.EndDate;
                tempevent.EnteringStaff     = f.EnteringStaff;
                tempevent.ScalpId           = f.ScalpId;
                tempevent.HouseNumber       = f.HouseNumber;
                tempevent.Note              = f.Note;
                tempevent.Settlement        = f.Settlement;
                tempevent.Commission        = f.Commission;
                tempevent.StartDate         = f.StartDate;
                tempevent.TotalPrice        = f.TotalPrice;
                tempevent.UnitPrice         = f.UnitPrice;
                if (tempevent.IsFinance)
                {
                    tempevent.editable = false;  //临时
                }
                else
                {
                    tempevent.editable = false;
                }
                events.Add(tempevent);
            }
            #endregion

            return(Json(new { events, resources1, resources2, channel, numberCollet }));
        }
示例#57
0
 public Block(Point Position, RoomType Type)
 {
     position = Position;
     type     = Type;
 }
示例#58
0
 private IServerDistributedRoom CreateServerDistributedRoom(AccountId accountCreatingRoom, string roomName, RoomId roomId, RoomType roomType, PrivacyLevel privacyLevel, XmlNode roomItemsXml)
 {
     return(CreateServerDistributedRoom(new RoomProperties(accountCreatingRoom, roomName, roomId, roomType, privacyLevel, roomItemsXml)));
 }
示例#59
0
        private RoomType GetRoomType(int type)
        {
            var      serviceGenerator = new ServicesGenerator();
            RoomType room             = null;

            switch (type)
            {
            case HotelSeedMetada.ROOMTYPE_SINGLE:
                room = new RoomType
                {
                    Name        = "Single room",
                    Capacity    = 1,
                    Description = "Our single rooms have an area of 26m² with a 1.60m Queen size bed.",
                    Price       = 180,
                    NumPhotos   = 3,
                    SingleBeds  = 1
                };
                room.Services = serviceGenerator.GetRoomServices()
                                .Select(rs => new ServicePerRoom()
                {
                    RoomType = room, Service = rs
                }).ToList();
                return(room);

            case HotelSeedMetada.ROOMTYPE_DOUBLE:
                room = new RoomType
                {
                    Name        = "Double room",
                    Capacity    = 2,
                    Description = "The doubles are 32m² with French Size twin beds of 1.40m",
                    Price       = 300,
                    NumPhotos   = 4,
                    TwinBeds    = 2
                };
                room.Services = serviceGenerator.GetRoomServices()
                                .Select(rs => new ServicePerRoom()
                {
                    RoomType = room, Service = rs
                }).ToList();
                return(room);

            case HotelSeedMetada.ROOMTYPE_DOUBLE2:
                room = new RoomType
                {
                    Name        = "Double room",
                    Capacity    = 2,
                    Description = "The doubles are 40m² with a 3.20m double Queen size bed",
                    Price       = 400,
                    NumPhotos   = 2,
                    TwinBeds    = 2,
                };
                room.Services = serviceGenerator.GetRoomServices()
                                .Select(rs => new ServicePerRoom()
                {
                    RoomType = room, Service = rs
                }).ToList();
                return(room);

            case HotelSeedMetada.ROOMTYPE_LUXURY:
                room = new RoomType
                {
                    Name        = "Luxury room",
                    Capacity    = 2,
                    Description = "Luxury room is 42m² with a 3.20m double Queen size bed.",
                    Price       = 500,
                    NumPhotos   = 3,
                    DoubleBeds  = 1,
                };
                room.Services = serviceGenerator.GetRoomServices()
                                .Select(rs => new ServicePerRoom()
                {
                    RoomType = room, Service = rs
                }).ToList();
                return(room);

            default:
                return(null);
            }
        }
 public RoomTypeDefinitionRow(RoomType roomType, decimal pricePerNight)
 {
     RoomType      = roomType;
     PricePerNight = pricePerNight;
 }