示例#1
0
        public void Create(object param)
        {
            var tuple = param as Tuple <string, string, string, string>;

            if (String.IsNullOrEmpty(tuple.Item1) ||
                String.IsNullOrEmpty(tuple.Item2) ||
                String.IsNullOrEmpty(tuple.Item3))
            {
                return;
            }

            roomsDAL.AddRoom(int.Parse(tuple.Item1), tuple.Item2, int.Parse(tuple.Item3));

            foreach (var image in DataManager.Instance.SelectedRoomImages)
            {
                var temp = image.Substring(image.LastIndexOf("\\") + 1);
                imagesDAL.Add(DataManager.Instance.LastRoom.Id_Camera, temp);
            }

            foreach (var feature in DataManager.Instance.SelectedRoomFeatures)
            {
                feature.IdRoom = DataManager.Instance.LastRoom.Id_Camera;
                featuresDAL.Add(feature);
            }

            DataManager.Instance.SelectedRoomFeatures.Clear();
            DataManager.Instance.SelectedRoomImages.Clear();
        }
示例#2
0
        public void Add(object param)
        {
            var tuple = param as Tuple <string, string>;

            string type  = tuple.Item1;
            int    price = int.Parse(tuple.Item2);

            if (String.IsNullOrEmpty(type))
            {
                return;
            }

            Feature feature = new Feature()
            {
                Type   = type,
                Price  = price,
                IdRoom = null
            };

            featuresDAL.Add(feature);
        }