using System; using System.Collections.Generic; using Edu.Model.Public; using Edu.Repository.Public; using VT.FW.DB; namespace Edu.Module.Public { /// /// 公共处理类 /// public class PublicModule { /// /// 上传配置仓储层对象 /// private readonly RB_File_StoreRepository storeRepository = new RB_File_StoreRepository(); #region 上传设置 /// /// 获取上传存储信息 /// /// 查询条件 /// public List GetFileStoreList(RB_File_Store query) { return storeRepository.GetListRepository(query); } /// /// 新增/修改存储位置 /// /// /// public bool AddOrUpdateFileStore(RB_File_Store model) { bool result; int id; if (model.ID == 0) { id = storeRepository.Insert(model); result = id > 0; } else { id = model.ID; result = storeRepository.Update(model); } //判断当前的是否设置成默认没有 if (model.IsDefault == 1 && result)//将其他的默认赋值成0 { Dictionary fileds = new Dictionary() { { nameof(RB_File_Store.IsDefault), 0 }, }; List whereHelpers = new List() { new WhereHelper(){ FiledName=nameof(RB_File_Store.Group_Id),FiledValue=model.Group_Id ,OperatorEnum=OperatorEnum.Equal}, new WhereHelper(){ FiledName=nameof(RB_File_Store.ID),FiledValue=id, OperatorEnum=OperatorEnum.NotEqual }, }; result = storeRepository.Update(fileds, whereHelpers); } return result; } #endregion #region 留学就业审核配置 /// /// 获取留学就业审核配置 /// /// public List GetStudyAbroadListModule() { List list = new List { new { Id = Common.Config.StudyAbroadDirectorId, AuditType = 1, Name = "部门主管审核" }, new { Id = Common.Config.StudyAbroadManagerId, AuditType = 2, Name = "部门负责人审核" } }; return list; } #endregion } }