Bugs + Tabelle erweitert

This commit is contained in:
2024-07-16 16:15:57 +02:00
parent 774c4b3344
commit 69faaf5dcd
7 changed files with 53 additions and 10 deletions

View File

@@ -32,7 +32,7 @@
<ComboBox Grid.Row="0" Grid.Column="1" Margin="3" IsReadOnly="False"
x:Name="combobox_wohnungsname" IsEditable="True" IsTextSearchEnabled="False"
ItemsSource="{Binding WohneinheitListVM.Wohnungsnamen}"
Text="{Binding WohneinheitListVM.CurrentVM.Wohnname}"/>
Text="{Binding Path=WohneinheitListVM.CurrentVM.Wohnname}"/>
<Label VerticalAlignment="Center" Grid.Row="1" Margin="3">Zimmername</Label>
<TextBox Grid.Row="1" Grid.Column="1" Margin="3"

View File

@@ -73,11 +73,15 @@ namespace BeWo.View.Controls
private void Popup_Opened(object sender, EventArgs e)
{
BeWoApp.CurrentBeWo.FirePropertyChanged(nameof(ViewModel));
var vmlist = ViewModel.WohneinheitListVM;
_IsNew = vmlist.CurrentVM == vmlist.NewVM;
groupbox_newWohneinheit.Header = _IsNew ? "Wohneinheit erstellen" : "Wohneinheit bearbeiten";
combobox_wohnungsname.SelectedItem = null;
}
}
}

View File

@@ -327,10 +327,32 @@
</Grid.RowDefinitions>
<Button Click="Button_NewWohneinheit_Click" Content="Wohneinheit hinzufügen" HorizontalAlignment="Left" Margin="3"/>
<dxg:GridControl Grid.Row="1" DataSource="{Binding WohneinheitListVM.VMList}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.ColumnSpan="2">
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="WohnheimOid" Width="177" Header="WohnheimOid" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Wohnname" Width="177" Header="Wohnname" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Zimmername" Width="177" Header="Zimmername" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Miete" Width="177" Header="Miete" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Oid" Header="Nr." />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Wohnname" Header="Wohnungsname" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Zimmername" Header="Zimmername" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Baujahr" Header="Baujahr" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Stock" Header="Stock" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="FlacheString" Header="Fläche" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Kaution" Header="Kaution" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="c" Mask="c" MaskType="Numeric" HorizontalContentAlignment="Right"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Miete" Header="Miete" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="c" Mask="c" MaskType="Numeric" HorizontalContentAlignment="Right"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Brutto" Header="Brutto" >
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="c" Mask="c" MaskType="Numeric" HorizontalContentAlignment="Right"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Mobilierung" Header="Möbilierung" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Zusatznotiz" Header="Notiz" />
<dxg:GridControl.View>
<dxg:TableView NavigationStyle="Cell" BestFitModeOnSourceChange="AllRows" BestFitMode="AllRows"/>
</dxg:GridControl.View>
</dxg:GridControl>
<uvc:WohneinheitEditPopup x:Name="popup_newWohneinheit" ViewModel="{Binding}"/>

View File

@@ -139,7 +139,7 @@ namespace BeWo.ViewModel.ListViewModel
#endregion
public VMType AddNewVMToList()
public virtual VMType AddNewVMToList()
{
this.VMList.Add(this.NewVM);
@@ -147,7 +147,7 @@ namespace BeWo.ViewModel.ListViewModel
VMType lVM = this.NewVM;
this.NewVM = null;
// FirePropertyChanged("VMList");
//FirePropertyChanged("VMList");
return lVM;
}

View File

@@ -15,6 +15,20 @@ namespace BeWo.ViewModel.ListViewModel
public WohneinheitVM CurrentVM => EditVM ?? NewVM;
public List<string> Wohnungsnamen => VMList?.Select(x => x.Wohnname)?.Distinct().ToList() ?? new List<string>();
}
public List<string> Wohnungsnamen => VMList?
.Where(x => !string.IsNullOrEmpty(x.Zimmername))
.Select(x => x.Wohnname)?
.Distinct()
.ToList() ?? new List<string>();
public override WohneinheitVM AddNewVMToList()
{
var vm = base.AddNewVMToList();
FirePropertyChanged(nameof(CurrentVM));
FirePropertyChanged(nameof(WohneinheitVM));
return vm;
}
}
}

View File

@@ -50,6 +50,8 @@ namespace BeWo.ViewModel
}
}
public long? Oid => _Oid;
public string Wohnname
{
get { return _Wohnname; }
@@ -176,9 +178,11 @@ namespace BeWo.ViewModel
_QM = value;
StoreDirtyInformation(AreDifferent(DataContract.QM, value), nameof(QM));
FirePropertyChanged(nameof(QM));
FirePropertyChanged(nameof(FlacheString));
}
}
}
public string FlacheString => QM.ToString("########0.00 qm");
public int Baujahr
{
get { return _Baujahr; }

View File

@@ -23,7 +23,6 @@ CREATE TABLE `wohneinheit` (
`Zusatznotiz` varchar(1024) DEFAULT NULL,
`Stock` varchar(256) DEFAULT NULL,
PRIMARY KEY (`Oid`),
CONSTRAINT `FK_WOHNEINHEIT_WOHNHEIM` FOREIGN KEY (`WohnheimOid`) REFERENCES `Wohnheim` (`Oid`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
CREATE TABLE `wohneinheitbelegung` (