コード例 #1
0
        public byte[] GetTheLatestAddIn(UserInfo userInfo, string Id)
        {
            var dtAddIn   = new DataTable(PiPlatFormAddInTable.TableName);
            var parameter = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                dtAddIn = new PiPlatFormAddInManager(dbProvider, userInfo).GetDTById(Id);
            });
            return(BusinessLogic.GetBinaryFormatData(dtAddIn));
        }
コード例 #2
0
        /// <summary>
        /// 单个删除平台插件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主鍵</param>
        /// <returns>受影响的行数</returns>
        public int Delete(UserInfo userInfo, string id)
        {
            int returnValue = 0;
            var parameter   = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                returnValue = new PiPlatFormAddInManager(dbProvider, userInfo).Delete(id);
            });
            return(returnValue);
        }
コード例 #3
0
        /// <summary>
        /// 取得平台插件实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主鍵</param>
        /// <returns>实体</returns>
        public PiPlatFormAddInEntity GetEntity(UserInfo userInfo, string id)
        {
            PiPlatFormAddInEntity entity = null;
            var parameter = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                entity = new PiPlatFormAddInManager(dbProvider, userInfo).GetEntity(id);
            });

            return(entity);
        }
コード例 #4
0
        /// <summary>
        /// 取得平台插件列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <returns>数据表</returns>
        public DataTable GetDT(UserInfo userInfo)
        {
            var dataTable = new DataTable(PiPlatFormAddInTable.TableName);
            var parameter = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new PiPlatFormAddInManager(dbProvider, userInfo).GetDT(CiDbLinkDefineTable.FieldDeleteMark, 0);
                dataTable.TableName = PiPlatFormAddInTable.TableName;
            });
            return(dataTable);
        }
コード例 #5
0
        /// <summary>
        /// 设置可用性
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <param name="enabled">是否可用(1:可用、0:不可用)</param>
        /// <returns>受影响的行数</returns>
        public int SetEnabled(UserInfo userInfo, string id, int enabled)
        {
            var returnValue = 0;
            var parameter   = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                returnValue = new PiPlatFormAddInManager(dbProvider, userInfo).SetProperty(id, PiPlatFormAddInTable.FieldEnabled, enabled);
            });

            return(returnValue);
        }
コード例 #6
0
        /// <summary>
        /// 按条件获取平台插件数据列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="names">字段</param>
        /// <param name="values">值</param>
        /// <returns>数据表</returns>
        public DataTable GetDTByValues(UserInfo userInfo, string[] names, object[] values)
        {
            var dataTable = new DataTable(PiPlatFormAddInTable.TableName);
            var parameter = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new PiPlatFormAddInManager(dbProvider, userInfo).GetDT(names, values);
                dataTable.TableName = PiPlatFormAddInTable.TableName;
            });
            return(dataTable);
        }
コード例 #7
0
        /// <summary>
        /// 新增平台插件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状态信息</param>
        /// <returns>主鍵</returns>
        public string Add(UserInfo userInfo, PiPlatFormAddInEntity entity, out string statusCode, out string statusMessage)
        {
            string returnValue   = string.Empty;
            string returnCode    = string.Empty;
            string returnMessage = string.Empty;
            var    parameter     = ParameterUtil.CreateWithLog(userInfo, MethodBase.GetCurrentMethod());

            ServiceUtil.ProcessRDIReadDb(userInfo, parameter, dbProvider =>
            {
                var manager   = new PiPlatFormAddInManager(dbProvider, userInfo);
                returnValue   = manager.Add(entity, out returnCode);
                returnMessage = manager.GetStateMessage(returnCode);
            });
            statusCode    = returnCode;
            statusMessage = returnMessage;
            return(returnValue);
        }