diff --git a/Elwig/Models/AreaCom.cs b/Elwig/Models/AreaCom.cs index 2e3c157..c03f54b 100644 --- a/Elwig/Models/AreaCom.cs +++ b/Elwig/Models/AreaCom.cs @@ -1,5 +1,9 @@ +using Elwig.Helpers; using Microsoft.EntityFrameworkCore; +using System.Collections; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; namespace Elwig.Models { [Table("area_commitment"), PrimaryKey("FbNr")] @@ -51,5 +55,12 @@ namespace Elwig.Models { [ForeignKey("KgNr, RdNr")] public virtual WbRd? Rd { get; private set; } + + public int SearchScore(IEnumerable keywords) { + var list = new string?[] { + WineCult.Name, Kg.AtKg.Name, Rd.Name, GstNr, Comment, + }.ToList(); + return Utils.GetSearchScore(list, keywords); + } } } diff --git a/Elwig/Windows/AreaComAdminWindow.xaml b/Elwig/Windows/AreaComAdminWindow.xaml index bb17af2..21bd2c9 100644 --- a/Elwig/Windows/AreaComAdminWindow.xaml +++ b/Elwig/Windows/AreaComAdminWindow.xaml @@ -7,7 +7,7 @@ xmlns:ctrl="clr-namespace:Elwig.Controls" mc:Ignorable="d" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" - Title="Flächenbindungen - Elwig" Height="480" Width="1100" + Title="Flächenbindungen - Elwig" Height="500" Width="920" MinWidth="860" Loaded="Window_Loaded"> - - + +