private void dgProp_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { ViewProp prop = dgProp.CurrentItem as ViewProp; if (prop != null) { selected = db.Properties.Find(prop.Id); cbMarket.Text = selected.Market.Name; cbTypes.Text = selected.Types.Name; tbarea.Text = selected.Area.ToString(); tbrooms.Text = selected.Rooms.ToString(); cbDistricts.Text = selected.District.Name; tbAdress.Text = selected.Address; cbSettlemets.Text = selected.Settlement1.Name; tbPrice.Text = ((decimal)selected.Price).ToString("#"); cbOwners.Text = selected.Owners.Name; if (selected.Status == 1) { statusbox.IsChecked = true; } else { statusbox.IsChecked = false; } } btnAddProp.Visibility = Visibility.Hidden; btnUpdateProp.Visibility = Visibility.Visible; }
} //Update() private void _removeDocumentClassPropAndFilters( CswNbtView DocumentsView, CswNbtMetaDataNodeType MaterialDocumentNT ) { IEnumerable<CswNbtViewRelationship> ChildRelationships = DocumentsView.Root.ChildRelationships[0].ChildRelationships; CswNbtMetaDataNodeTypeProp DocumentClassNTP = MaterialDocumentNT.getNodeTypePropByObjectClassProp( CswNbtObjClassDocument.PropertyName.DocumentClass ); foreach( CswNbtViewRelationship Parent in ChildRelationships ) { if( Parent.SecondName.Equals( MaterialDocumentNT.NodeTypeName ) ) { CswNbtViewProperty PropToDelete = null; foreach( CswNbtViewProperty ViewProp in Parent.Properties ) { if( null != ViewProp.Filters && ViewProp.Filters.Count > 0 ) { ViewProp.removeFilter( (CswNbtViewPropertyFilter) ViewProp.Filters[0] ); } if( ViewProp.NodeTypePropId == DocumentClassNTP.PropId ) { PropToDelete = ViewProp; } } if( null != PropToDelete ) { Parent.removeProperty( PropToDelete ); } DocumentsView.save(); } } }
private void dgSearch_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { ViewProp prop = dgSearch.CurrentItem as ViewProp; if (prop != null) { selected = db.Properties.Find(prop.Id); MessageBox.Show(selected.Owners.Phone); } }
private void FillProperties() { string typessss = cbType.Text; string markt = cbMarket.Text; string settlement = cbSettlement.Text; string district = cbDistrict.Text; string startprice = tbSearchPrice1.Text; string endprice = tbSearchPrice2.Text; if (startprice == string.Empty) { startprice = 0.ToString(); } if (endprice == string.Empty) { endprice = Int32.MaxValue.ToString(); } decimal price1dec = Convert.ToDecimal(startprice); decimal price2dec = Convert.ToDecimal(endprice); dgSearch.Items.Clear(); foreach (Model.Properties item in db.Properties.Where(u => u.Market.Name.Contains(markt) && u.Price >= price1dec && u.Price <= price2dec && u.Types.Name.Contains(typessss) && u.District.Name.Contains(district) && u.Settlement1.Name.Contains(settlement))) { ViewProp viewProp = new ViewProp { Id = item.id, Market = item.Market.Name, Type = item.Types.Name, Area = item.Area, Rooms = item.Rooms, District = item.District.Name, Settlement = item.Settlement1.Name, Adress = item.Address, Price = (int)item.Price, Owner = item.Owners.Name, Status = item.Status }; dgSearch.Items.Add(viewProp); } }
private void FillProperties() { dgProp.Items.Clear(); foreach (Model.Properties item in db.Properties.ToList()) { ViewProp viewProp = new ViewProp { Id = item.id, Market = item.Market.Name, Type = item.Types.Name, Area = item.Area, Rooms = item.Rooms, District = item.District.Name, Settlement = item.Settlement1.Name, Adress = item.Address, Price = item.Price, Owner = item.Owners.Name, Status = item.Status }; dgProp.Items.Add(viewProp); } }