Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo

This commit is contained in:
2026-06-23 13:01:08 +02:00
12 changed files with 117 additions and 64 deletions

View File

@@ -13,7 +13,7 @@ namespace BeWo.Converter
if (value is null)
return null;
var t = ((DelegateCommand)value).CanExecute(null);
//var t = ((DelegateCommand)value).CanExecute(null);
return value;
}

View File

@@ -3335,10 +3335,13 @@
</Grid.ColumnDefinitions>
<StackPanel
x:Name="PanelConversationButton"
Margin="0"
Margin="3,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<ai:AiChatButton x:Name="btn_ai_conv" DataContext="{Binding AiChatButtonConversationViewModel}">
<ai:AiChatButton
x:Name="btn_ai_conv"
Margin="3,0"
DataContext="{Binding AiChatButtonConversationViewModel}">
<ai:AiChatButton.Resources>
<ResourceDictionary>
<Style BasedOn="{StaticResource NavigationToolbarButtonStyle}" TargetType="{x:Type Button}" />

View File

@@ -190,7 +190,7 @@
x:Name="listbox_messages"
Grid.Row="1"
Background="Transparent"
ItemsSource="{Binding SelectedVM.Messages.VMList, Converter={StaticResource TestDebugConverter}}">
ItemsSource="{Binding SelectedVM.Messages.VMList}">
<ListView.ItemTemplate>
<DataTemplate x:Name="messages_datatemplate" DataType="viewmodel:AiConversationMessageVM">
<TextBlock Text="{Binding Json}" />

View File

@@ -239,7 +239,8 @@ namespace BeWo.ViewModel
{
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
&& Creator?.EmployeeOid is long owner
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid;
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid
&& CanEdit;
}
public AiPromptbausteinFolderVM Parent { get; set; }

View File

@@ -130,7 +130,8 @@ namespace BeWo.ViewModel
{
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
&& Creator?.EmployeeOid is long owner
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid;
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid
&& CanEdit;
}
public string FavoritenHeader => IsFavorite ? "Favorit entfernen" : "Favorit hinzufügen";

View File

@@ -84,7 +84,7 @@ namespace BeWo.ViewModel
public bool CanEdit
{
get => _CanEdit;
get => _CanEdit && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
set => SetProperty(ref _CanEdit, value, nameof(CanEdit), () => DataContract.CanEdit);
}
@@ -98,7 +98,8 @@ namespace BeWo.ViewModel
{
get => BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteinShare)
&& Creator?.EmployeeOid is long owner
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid;
&& owner == BeWoApp.CompactLoggedOnEmployee.EmployeeOid
&& CanEdit;
}
public string FavoritenHeader => IsFavorite ? "Favorit entfernen" : "Favorit hinzufügen";

View File

@@ -933,8 +933,6 @@ namespace BeWo.ViewModel
{
var list = ServiceFacade.DoAiEnhancedServiceSnyc(s => s.GetAiConversations(actionType, reference_oid));
list.Reverse();
return new AiConversationListVM(list);
}

View File

@@ -254,6 +254,8 @@ namespace BeWo.ViewModel.View.AI
conv.Messages.VMList.Add(new AiConversationMessageVM(messages[1]));
conv.Updated = DateTime.Now;
FinishSending();
},
(exception) =>
@@ -305,6 +307,8 @@ namespace BeWo.ViewModel.View.AI
{
MessageInput = string.Empty;
ReloadConversations(ListVM.VMList);
EndSending();
SendNewMessageSuccess?.Invoke(this, EventArgs.Empty);
@@ -355,7 +359,24 @@ namespace BeWo.ViewModel.View.AI
var list = VMFactory.CreateAiConversationListVM(ui_context, reference);
ListVM.VMList.MakeEqualTo(list.VMList);
ReloadConversations(list.VMList);
}
private void ReloadConversations(IEnumerable<AiConversationVM> aiConversations)
{
if(aiConversations is null)
{
throw new ArgumentOutOfRangeException(nameof(aiConversations));
}
var sorted = aiConversations.OrderByDescending(vm => vm.Updated).ToList();
var t0 = ListVM.SelectedVM;
ListVM.VMList.UpdateBy(sorted);
if(ListVM.VMList.Contains(t0))
ListVM.SelectedVM = t0;
ListVM.VMList.ResetBindings();
}
private void OpenSetting()
@@ -538,6 +559,8 @@ namespace BeWo.ViewModel.View.AI
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.ExecuteAiConversationWithPrompt(cb.Oid.Value, ViewContext, prompt.DataContract.Oid.Value),
cb2 =>
{
vm.Updated = DateTime.Now;
FinishSending();
ServiceFacade.EndManuelWaiting();
@@ -592,8 +615,12 @@ namespace BeWo.ViewModel.View.AI
private void ExecuteChain(AiPromptbausteinRoutineVM routine, int step, Action<Exception> error)
{
var conv = ListVM.SelectedVM;
if (step >= routine.Steps.Count)
{
conv.Updated = DateTime.Now;
FinishSending();
ServiceFacade.EndManuelWaiting();
@@ -601,8 +628,6 @@ namespace BeWo.ViewModel.View.AI
return;
}
var conv = ListVM.SelectedVM;
var custom_viewContext = new AiViewContextDC
{
References = ViewContext.References,

View File

@@ -38,6 +38,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel19 = new DevExpress.XtraReports.UI.XRLabel();
@@ -104,7 +105,6 @@ namespace JusinaJugendhilfe.Reporting
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit();
@@ -169,6 +169,21 @@ namespace JusinaJugendhilfe.Reporting
this.bottomMarginBand1.HeightF = 102.3103F;
this.bottomMarginBand1.Name = "bottomMarginBand1";
//
// xrLabel10
//
this.xrLabel10.BackColor = System.Drawing.Color.Transparent;
this.xrLabel10.Font = new DevExpress.Drawing.DXFont("arial", 7F);
this.xrLabel10.ForeColor = System.Drawing.Color.Black;
this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(313.9584F, 0F);
this.xrLabel10.Multiline = true;
this.xrLabel10.Name = "xrLabel10";
this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel10.SizeF = new System.Drawing.SizeF(173F, 85.85F);
this.xrLabel10.StylePriority.UseBackColor = false;
this.xrLabel10.StylePriority.UseFont = false;
this.xrLabel10.StylePriority.UseForeColor = false;
this.xrLabel10.Text = "Volksbank Bocholt eG\r\nIBAN: DE47 4286 0003 0202 8904 00\r\nBIC: GENODEM1BOH\r\n";
//
// xrLabel12
//
this.xrLabel12.BackColor = System.Drawing.Color.Transparent;
@@ -313,15 +328,15 @@ namespace JusinaJugendhilfe.Reporting
//
// xrTable2
//
this.xrTable2.Font = new DevExpress.Drawing.DXFont("Arial", 9F);
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(436.9999F, 0F);
this.xrTable2.Font = new DevExpress.Drawing.DXFont("Arial", 8.5F);
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(449.4999F, 0F);
this.xrTable2.Name = "xrTable2";
this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow4,
this.xrTableRow1,
this.xrTableRow3,
this.xrTableRow5});
this.xrTable2.SizeF = new System.Drawing.SizeF(240F, 72F);
this.xrTable2.SizeF = new System.Drawing.SizeF(202.5003F, 72F);
this.xrTable2.StylePriority.UseFont = false;
//
// xrTableRow4
@@ -337,8 +352,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell16.BackColor = System.Drawing.Color.Transparent;
this.xrTableCell16.BorderColor = System.Drawing.Color.Black;
this.xrTableCell16.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell16.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell16.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell16.Name = "xrTableCell16";
this.xrTableCell16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell16.StylePriority.UseBackColor = false;
@@ -349,7 +363,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell16.StylePriority.UseTextAlignment = false;
this.xrTableCell16.Text = "Beleg-Nr.:";
this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrTableCell16.Weight = 0.45050886161132975D;
this.xrTableCell16.Weight = 0.42714856296093356D;
//
// xrTableCell17
//
@@ -358,8 +372,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell17.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell17.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "InvoiceNumber")});
this.xrTableCell17.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell17.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell17.Name = "xrTableCell17";
this.xrTableCell17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell17.StylePriority.UseBackColor = false;
@@ -369,7 +382,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell17.StylePriority.UsePadding = false;
this.xrTableCell17.StylePriority.UseTextAlignment = false;
this.xrTableCell17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell17.Weight = 0.45050888254973376D;
this.xrTableCell17.Weight = 0.47386918120012994D;
//
// xrTableRow1
//
@@ -384,8 +397,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell3.BackColor = System.Drawing.Color.Transparent;
this.xrTableCell3.BorderColor = System.Drawing.Color.Black;
this.xrTableCell3.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell3.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell3.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell3.Multiline = true;
this.xrTableCell3.Name = "xrTableCell3";
this.xrTableCell3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -397,7 +409,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell3.StylePriority.UseTextAlignment = false;
this.xrTableCell3.Text = "Kunden-Nr.:";
this.xrTableCell3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrTableCell3.Weight = 0.45050886161132975D;
this.xrTableCell3.Weight = 0.42714856296093356D;
//
// xrTableCell4
//
@@ -406,8 +418,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell4.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "OrganisationDebitorNumber")});
this.xrTableCell4.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell4.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell4.Multiline = true;
this.xrTableCell4.Name = "xrTableCell4";
this.xrTableCell4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
@@ -419,7 +430,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell4.StylePriority.UseTextAlignment = false;
this.xrTableCell4.Text = "xrTableCell4";
this.xrTableCell4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell4.Weight = 0.45050888254973376D;
this.xrTableCell4.Weight = 0.47386918120012994D;
//
// xrTableRow3
//
@@ -434,8 +445,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell1.BackColor = System.Drawing.Color.Transparent;
this.xrTableCell1.BorderColor = System.Drawing.Color.Black;
this.xrTableCell1.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell1.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell1.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell1.Name = "xrTableCell1";
this.xrTableCell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell1.StylePriority.UseBackColor = false;
@@ -446,7 +456,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell1.StylePriority.UseTextAlignment = false;
this.xrTableCell1.Text = "Leistungsdatum:";
this.xrTableCell1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrTableCell1.Weight = 0.45050886161132975D;
this.xrTableCell1.Weight = 0.42714856296093356D;
//
// xrTableCell13
//
@@ -455,8 +465,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell13.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "AccountingPeriodEnd", "{0:dd.MM.yyyy}")});
this.xrTableCell13.Font = new DevExpress.Drawing.DXFont("Arial", 9F, DevExpress.Drawing.DXFontStyle.Regular, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] {
new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))});
this.xrTableCell13.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell13.Name = "xrTableCell13";
this.xrTableCell13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell13.StylePriority.UseBackColor = false;
@@ -466,7 +475,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell13.StylePriority.UsePadding = false;
this.xrTableCell13.StylePriority.UseTextAlignment = false;
this.xrTableCell13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell13.Weight = 0.45050888254973376D;
this.xrTableCell13.Weight = 0.47386918120012994D;
//
// xrTableRow5
//
@@ -482,7 +491,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell6.BorderColor = System.Drawing.Color.Black;
this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.xrTableCell6.BorderWidth = 1F;
this.xrTableCell6.Font = new DevExpress.Drawing.DXFont("Arial", 9F);
this.xrTableCell6.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell6.StylePriority.UseBackColor = false;
@@ -494,7 +503,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.Text = "Rechnungsdatum:";
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.xrTableCell6.Weight = 0.45050886161132975D;
this.xrTableCell6.Weight = 0.42714856296093356D;
//
// xrTableCell7
//
@@ -504,7 +513,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell7.BorderWidth = 1F;
this.xrTableCell7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "InvoiceDateTime")});
this.xrTableCell7.Font = new DevExpress.Drawing.DXFont("Arial", 9F);
this.xrTableCell7.Font = new DevExpress.Drawing.DXFont("Arial", 8F);
this.xrTableCell7.Name = "xrTableCell7";
this.xrTableCell7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F);
this.xrTableCell7.StylePriority.UseBackColor = false;
@@ -516,12 +525,12 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableCell7.StylePriority.UseTextAlignment = false;
this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
this.xrTableCell7.TextFormatString = "{0:dd.MM.yyyy}";
this.xrTableCell7.Weight = 0.45050888254973376D;
this.xrTableCell7.Weight = 0.47386918120012994D;
//
// xrTable3
//
this.xrTable3.Font = new DevExpress.Drawing.DXFont("Arial", 9F);
this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(436.9997F, 88.66663F);
this.xrTable3.Font = new DevExpress.Drawing.DXFont("Arial", 8.5F);
this.xrTable3.LocationFloat = new DevExpress.Utils.PointFloat(449.4999F, 88.66661F);
this.xrTable3.Name = "xrTable3";
this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow6,
@@ -529,7 +538,7 @@ namespace JusinaJugendhilfe.Reporting
this.xrTableRow8,
this.xrTableRow2,
this.xrTableRow9});
this.xrTable3.SizeF = new System.Drawing.SizeF(240.0002F, 90F);
this.xrTable3.SizeF = new System.Drawing.SizeF(202.5003F, 90F);
this.xrTable3.StylePriority.UseFont = false;
this.xrTable3.StylePriority.UseTextAlignment = false;
this.xrTable3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
@@ -631,6 +640,7 @@ namespace JusinaJugendhilfe.Reporting
//
// lblAddress
//
this.lblAddress.Font = new DevExpress.Drawing.DXFont("Arial", 10F);
this.lblAddress.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
this.lblAddress.Multiline = true;
this.lblAddress.Name = "lblAddress";
@@ -1024,21 +1034,6 @@ namespace JusinaJugendhilfe.Reporting
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
//
// xrLabel10
//
this.xrLabel10.BackColor = System.Drawing.Color.Transparent;
this.xrLabel10.Font = new DevExpress.Drawing.DXFont("arial", 7F);
this.xrLabel10.ForeColor = System.Drawing.Color.Black;
this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(313.9584F, 0F);
this.xrLabel10.Multiline = true;
this.xrLabel10.Name = "xrLabel10";
this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel10.SizeF = new System.Drawing.SizeF(173F, 85.85F);
this.xrLabel10.StylePriority.UseBackColor = false;
this.xrLabel10.StylePriority.UseFont = false;
this.xrLabel10.StylePriority.UseForeColor = false;
this.xrLabel10.Text = "Volksbank Bocholt eG\r\nIBAN: DE47 4286 0003 0202 8904 00\r\nBIC: GENODEM1BOH\r\n";
//
// ServiceInvoiceReport
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {

View File

@@ -56,11 +56,9 @@ namespace JusinaJugendhilfe.Reporting
var betreuungsarten = c.ValueList.Where(v2o => v2o.Entry.Type == ValueListEntryType.CustomerCareType).ToList();
if (betreuungsarten != null && betreuungsarten.Count > 0)
{
if (betreuungsarten.Count >= 1)
lblBetreuungsart.Text = betreuungsarten[0].Entry.Value;
if (betreuungsarten.Count >= 2)
lblBetreuungsart.Text = betreuungsarten[0].Entry.Value;
if (betreuungsarten.Count > 1)
lblBetreuungsart.Text += " / " + betreuungsarten[1].Entry.Value;
}
}
}

View File

@@ -272,8 +272,6 @@ namespace BeWo.Service.Plugins
var toadd = request_models.Except(current_prompts, comparer);
var toremove = current_prompts_actives.Except(request_models, comparer);
var toreadd = current_prompts_deactives.Intersect(request_models, comparer);
//var tocheckupdate = request_models.Union(current_prompts, comparer);
//var toupdate = tocheckupdate.;
foreach (var a in current_prompts)
{

View File

@@ -66,7 +66,40 @@ namespace BS.Shared.Extensions
}
}
public static void RemoveRange<T>(this IList<T> pList, IEnumerable<T> pToRemove)
public static void UpdateBy<T>(this IList<T> a_list, IList<T> b_list)
{
// Elemente entfernen, die in der Zielliste nicht mehr vorkommen.
// Rückwärts iterieren, damit RemoveAt die noch zu prüfenden Indizes nicht verschiebt.
for (int i = a_list.Count - 1; i >= 0; i--)
{
if (!b_list.Contains(a_list[i]))
a_list.RemoveAt(i);
}
// Reihenfolge angleichen und fehlende Elemente einfügen.
// Bewusst über Insert/RemoveAt statt über den Indexer (a_list[i] = ...),
// da BindingList<T> beim Indexer nur ItemChanged meldet und WPF die
// ListView dann nicht neu anordnet. Insert/RemoveAt melden ItemAdded/ItemDeleted.
for (int i = 0; i < b_list.Count; i++)
{
var item = b_list[i];
if (i < a_list.Count && a_list[i].Equals(item))
continue;
var currentIndex = a_list.IndexOf(item);
if (currentIndex >= 0)
a_list.RemoveAt(currentIndex);
a_list.Insert(i, item);
}
// Eventuelle überzählige Elemente am Ende entfernen.
while (a_list.Count > b_list.Count)
a_list.RemoveAt(a_list.Count - 1);
}
public static void RemoveRange<T>(this IList<T> pList, IEnumerable<T> pToRemove)
{
foreach (T iItem in pToRemove.ToList())
{