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, IRoleRepository { public void DeleteForm(string keyValue) { using (var db = new RepositoryBase().BeginTrans()) { db.Delete(t => t.F_Id == keyValue); db.Delete(t => t.F_ObjectId == keyValue); db.Commit(); } } public void SubmitForm(RoleEntity roleEntity, List 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(t => t.F_ObjectId == roleEntity.F_Id); db.Insert(roleAuthorizeEntitys); db.Commit(); } } } }