纽威
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.
 
 
 
 
 

40 lines
1.3 KiB

using NFine.Data;
using NFine.Domain.Entity.SystemManage;
using NFine.Domain.IRepository.SystemManage;
using NFine.Repository.SystemManage;
using System.Collections.Generic;
namespace NFine.Repository.SystemManage
{
public class RoleRepository : RepositoryBase<RoleEntity>, IRoleRepository
{
public void DeleteForm(string keyValue)
{
using (var db = new RepositoryBase().BeginTrans())
{
db.Delete<RoleEntity>(t => t.F_Id == keyValue);
db.Delete<RoleAuthorizeEntity>(t => t.F_ObjectId == keyValue);
db.Commit();
}
}
public void SubmitForm(RoleEntity roleEntity, List<RoleAuthorizeEntity> roleAuthorizeEntitys, string keyValue)
{
using (var db = new RepositoryBase().BeginTrans())
{
if (!string.IsNullOrEmpty(keyValue))
{
db.Update(roleEntity);
}
else
{
roleEntity.F_Category = 1;
db.Insert(roleEntity);
}
db.Delete<RoleAuthorizeEntity>(t => t.F_ObjectId == roleEntity.F_Id);
db.Insert(roleAuthorizeEntitys);
db.Commit();
}
}
}
}