using NFine.Code; using NFine.Domain.Entity.SystemManage; using NFine.Domain.IRepository.SystemManage; using NFine.Repository.SystemManage; using System.Collections.Generic; using System.Linq; namespace NFine.Application.SystemManage { public class DutyApp { private IRoleRepository service = new RoleRepository(); public List GetList(string keyword = "") { var expression = ExtLinq.True(); if (!string.IsNullOrEmpty(keyword)) { expression = expression.And(t => t.F_FullName.Contains(keyword)); expression = expression.Or(t => t.F_EnCode.Contains(keyword)); } expression = expression.And(t => t.F_Category == 2); return service.IQueryable(expression).OrderBy(t => t.F_SortCode).ToList(); } public RoleEntity GetForm(string keyValue) { return service.FindEntity(keyValue); } public void DeleteForm(string keyValue) { service.Delete(t => t.F_Id == keyValue); } public void SubmitForm(RoleEntity roleEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { roleEntity.Modify(keyValue); service.Update(roleEntity); } else { roleEntity.Create(); roleEntity.F_Category = 2; service.Insert(roleEntity); } } } }