Added search to AreaComAdminWindow

This commit is contained in:
2023-11-05 17:42:25 +01:00
parent a1ae44e135
commit 053fbdbf30
3 changed files with 237 additions and 84 deletions

View File

@ -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<string> keywords) {
var list = new string?[] {
WineCult.Name, Kg.AtKg.Name, Rd.Name, GstNr, Comment,
}.ToList();
return Utils.GetSearchScore(list, keywords);
}
}
}