private void setUpListViewVerti() { listDormVerti = DormDatabase.GetAllListDorm(); listViewVerti.ItemsSource = listDormVerti; CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(listViewVerti.ItemsSource); view.Filter = DormFilter; }
private void btnUpload_Click(object sender, RoutedEventArgs e) { DormDb dorm = new DormDb(); dorm.Owner = OwnerDorm; dorm.Address = AddressDorm; dorm.Price = PriceDorm; dorm.Size = AreaDorm; dorm.Sale = SaleDorm; dorm.Quality = 0; dorm.Count = 0; dorm.CountLike = 0; dorm.Description = DesDorm; dorm.Image = Helpers.ConvertImageToBinary(ImageDorm); dorm.IsWifi = Helpers.ConverBoolToByte(WifiDorm); dorm.IsParking = Helpers.ConverBoolToByte(ParkingDorm); dorm.IsTelevision = Helpers.ConverBoolToByte(TelevisionDorm); dorm.IsBathroom = Helpers.ConverBoolToByte(BathDorm); dorm.IsAirCondiditioner = Helpers.ConverBoolToByte(AirConDorm); dorm.IsWaterHeater = Helpers.ConverBoolToByte(WaterHeaterDorm); if (!check) { if (DormDatabase.Insert(dorm)) { Helpers.MakeConfirmMessage(Window.GetWindow(this), "Post Dorm Successfully~", "Notify"); OwnerDormDatabase.Insert(user.Email, DormDatabase.GetAllListDorm()[DormDatabase.GetAllListDorm().Count - 1].Id); } } else { if (DormDatabase.Update(dorm, dormSend.Id)) { Helpers.MakeConfirmMessage(Window.GetWindow(this), "Update Dorm Successfully~", "Notify"); } else { Helpers.MakeErrorMessage(Window.GetWindow(this), "Failure update Dorm", "Error"); } } }