/// <summary> /// 更新文件夹 /// </summary> /// <param name="userInfo">用户</param> /// <param name="folderEntity">文件夹</param> /// <param name="statusCode">状态码</param> /// <param name="statusMessage">状态信息</param> /// <returns>影响行数</returns> public int Update(UserInfo userInfo, CiFolderEntity folderEntity, out string statusCode, out string statusMessage) { string returnCode = string.Empty; string returnMessage = string.Empty; int returnValue = 0; var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty); parameter.IsAddLog = false; ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider => { var folderManager = new CiFolderManager(dbProvider, userInfo); returnValue = folderManager.Update(folderEntity, out returnCode); returnMessage = folderManager.GetStateMessage(returnCode); }); statusCode = returnCode; statusMessage = returnMessage; return(returnValue); }
/// <summary> /// 添加 /// </summary> /// <param name="userInfo">用户</param> /// <param name="parentId">父主键</param> /// <param name="folderName">文件夹名称</param> /// <param name="enabled">有效</param> /// <param name="statusCode">状态码</param> /// <param name="statusMessage">状态信息</param> /// <returns></returns> public string AddByFolderName(UserInfo userInfo, string parentId, string folderName, bool enabled, out string statusCode, out string statusMessage) { string returnCode = string.Empty; string returnMessage = string.Empty; string returnValue = string.Empty; var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty); parameter.IsAddLog = false; ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider => { var folderEntity = new CiFolderEntity(); var folderManager = new CiFolderManager(dbProvider, userInfo); folderEntity.ParentId = parentId; folderEntity.FolderName = folderName; folderEntity.Enabled = enabled ? 1: 0; returnValue = folderManager.Add(folderEntity, out returnCode); returnMessage = folderManager.GetStateMessage(returnCode); }); statusCode = returnCode; statusMessage = returnMessage; return(returnValue); }
/// <summary> /// 重命名 /// </summary> /// <param name="userInfo">用户</param> /// <param name="id">主键</param> /// <param name="newName">新名称</param> /// <param name="enabled">有效</param> /// <param name="statusCode">状态码</param> /// <param name="statusMessage">状态信息</param> /// <returns>影响行数</returns> public int Rename(UserInfo userInfo, string id, string newName, bool enabled, out string statusCode, out string statusMessage) { string returnCode = string.Empty; string returnMessage = string.Empty; int returnValue = 0; var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, string.Empty); parameter.IsAddLog = false; ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider => { var folderEntity = new CiFolderEntity(); var folderManager = new CiFolderManager(dbProvider, userInfo); DataTable dataTable = folderManager.GetDTById(id); folderEntity.GetFrom(dataTable); folderEntity.FolderName = newName; folderEntity.Enabled = enabled ? 1 : 0; returnValue = folderManager.Update(folderEntity, out returnCode); returnMessage = folderManager.GetStateMessage(returnCode); }); statusCode = returnCode; statusMessage = returnMessage; return(returnValue); }