Added search to AreaComAdminWindow
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user