public Room(SerializationInfo info, StreamingContext context) { this.RentPricePerHour = (decimal)info.GetValue("RentPricePerHour", typeof(decimal)); this.capacity = (int)info.GetValue("capacity", typeof(int)); this.floor = (int)info.GetValue("floor", typeof(int)); this.RoomTypeProp = (RoomType)info.GetValue("RoomTypeProp", typeof(RoomType)); this.capacityRange = (CapacityRangeType)info.GetValue("capacityRange", typeof(CapacityRangeType)); this.RentPriceRangeTypeProp = (RentPriceRangeType)info.GetValue("RentPriceRangeTypeProp", typeof(RentPriceRangeType)); //this.listMultimedia = new List<MultimediaDevice>(); this.listMultimedia = (List <MultimediaDevice>)info.GetValue("listMultimedia", typeof(List <MultimediaDevice>)); this.PicturePath = (string)info.GetValue("PicturePath", typeof(string)); this.RoomID = (int)info.GetValue("RoomID", typeof(int)); roomIdGenerator = (int)info.GetValue("roomIdGenerator", typeof(int)); }
public Room(string csvStr) { string[] temp = csvStr.Split(new[] { '[', ']' }); csvStr = temp[0] + temp[2].Remove(0, 1).Trim(); //first "," string[] RoomData = csvStr.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); RoomType eRoomType = ClassGeneral.GetEnumByName <RoomType>(RoomData[2]); CapacityRangeType eCapacityRange = ClassGeneral.GetEnumByName <CapacityRangeType>(RoomData[3]); RentPriceRangeType eRentPriceRangeType = ClassGeneral.GetEnumByName <RentPriceRangeType>(RoomData[4]); RoomInit(int.Parse(RoomData[0]), int.Parse(RoomData[1]), MultimediaDevice.createListMMD(temp[1]), eRoomType, eCapacityRange, eRentPriceRangeType, decimal.Parse(RoomData[5]), new Location(), RoomData[7]); }
private void RoomInit(int capacity, int floor, List <MultimediaDevice> listMultimedia, RoomType roomType, CapacityRangeType capacityRange, RentPriceRangeType RentPriceRangeType, decimal rentPricePerHour, Location location, string picturePath = "") { this.Capacity = capacity; this.Floor = floor; this.ListMultimedia = listMultimedia; this.RoomTypeProp = roomType; this.CapacityRange = capacityRange; this.RentPriceRangeTypeProp = RentPriceRangeType; this.RentPricePerHour = rentPricePerHour; this.Location = location; this.PicturePath = picturePath; this.RoomID = roomIdGenerator++; }
public Request( DateTime beginTime, int durationMin, int capacity, CapacityRangeType capacityRange, int floor, List <MultimediaDevice> listMultimedia, Location location, decimal RentPricePerHour, RentPriceRangeType rentPriceRange, RoomType roomType) { //Room modelDesiredRoom = new Room(roomType, capacity, listMultimedia, rentPriceRange, location); this.Occupation = new Timeslot(beginTime, durationMin); this.Capacity = capacity; this.CapacityRange = capacityRange; this.Floor = floor; this.ListMultimedia = listMultimedia; this.Location = location; this.RentPricePerHour = rentPricePerHour; this.RentPriceRangeTypeProp = rentPriceRange; this.RoomTypeProp = roomType; }
public Request(DateTime beginTime, int durationMin, RoomType roomType, RentPriceRangeType rentPriceRange, CapacityRangeType capacityRange, MultimediaType multimediaType, int roomTypePriority = 1, int rentPriceRangePriority = 1, int capacityRangePriority = 1, int multimediaTypePriority = 1) { this.Occupation = new Timeslot(beginTime, durationMin); this.RoomTypeProp = roomType; this.RentPriceRangeTypeProp = rentPriceRange; this.CapacityRange = capacityRange; this.MultimediaTypeProp = multimediaType; this.RoomTypePriority = roomTypePriority; this.RentPriceRangePriority = rentPriceRangePriority; this.CapacityRangePriority = capacityRangePriority; this.MultimediaTypePriority = multimediaTypePriority; }
public Room(int capacity, int floor, List <MultimediaDevice> listMultimedia, RoomType roomType, CapacityRangeType capacityRnage, RentPriceRangeType rentPriceRange, decimal rentPricePerHour, Location location) { RoomInit(capacity, floor, listMultimedia, roomType, capacityRange, rentPriceRange, rentPricePerHour, location); }