You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
using NFine.Domain._03_Entity.SystemManage;
|
|
using NFine.Domain._04_IRepository.SystemManage;
|
|
using NFine.Domain.Entity.SystemManage;
|
|
using NFine.Domain.IRepository.SystemManage;
|
|
using NFine.Repository.SystemManage;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace NFine.Application.SystemManage
|
|
{
|
|
public class OrganizeByVendorApp
|
|
{
|
|
private IOrganizeByVendorRepository service = new OrganizeByVendorRepository();
|
|
|
|
public List<OrganizeByVendorEntity> GetList()
|
|
{
|
|
return service.IQueryable().OrderBy(t => t.F_CreatorTime).ToList();
|
|
}
|
|
|
|
public OrganizeByVendorEntity GetForm(string keyValue)
|
|
{
|
|
return service.FindEntity(keyValue);
|
|
}
|
|
|
|
public void DeleteForm(string keyValue)
|
|
{
|
|
if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0)
|
|
{
|
|
throw new Exception("删除失败!操作的对象包含了下级数据。");
|
|
}
|
|
else
|
|
{
|
|
service.Delete(t => t.F_Id == keyValue);
|
|
}
|
|
}
|
|
|
|
public void SubmitForm(OrganizeByVendorEntity organizeEntity, string keyValue)
|
|
{
|
|
if (!string.IsNullOrEmpty(keyValue))
|
|
{
|
|
organizeEntity.Modify(keyValue);
|
|
service.Update(organizeEntity);
|
|
}
|
|
else
|
|
{
|
|
organizeEntity.Create();
|
|
service.Insert(organizeEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|