Beispiel #1
0
        /// <summary>
        /// 获得一个主表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主表单主键</param>
        /// <returns>主表单表</returns>
        public DataTable GetMainUserControl(UserInfo userInfo, string id)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_GetMainUserControl);
            var dataTable = new DataTable(MainUserControlTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                dataTable   = manager.GetMainUserControl(id);
            });
            return(dataTable);
        }
Beispiel #2
0
        /// <summary>
        /// 是否存在指定主子表单关联
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ctrlLinkId">关联Id</param>
        /// <returns>
        /// true:存在
        /// false:不存在
        /// </returns>
        public bool ExistsControlsLink(UserInfo userInfo, string ctrlLinkId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = false;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.ExistsControlsLink(ctrlLinkId);
            });
            return(returnValue);
        }
Beispiel #3
0
        /// <summary>
        /// 更新主表单知
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">主表单实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateMainUserCtrl(UserInfo userInfo, MainUserControlEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_UpdateMainUserCtrl);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.UpdateMainUserCtrl(entity);
            });
            return(returnValue);
        }
Beispiel #4
0
        /// <summary>
        /// 移除所有子表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="mainUserCtrlId">主表单id</param>
        /// <returns>大于0成功</returns>
        public int MoveUserControlsOfMain(UserInfo userInfo, string mainUserCtrlId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_MoveUserControlsOfMain);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.MoveUserControlsOfMain(mainUserCtrlId);
            });
            return(returnValue);
        }
Beispiel #5
0
        /// <summary>
        /// 增加子表单到主表单中
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="mainUserCtrlId">主表单id</param>
        /// <param name="userContrlsId">子表单id</param>
        /// <param name="controlOrder">顺序号,以此排序</param>
        /// <param name="controlState">子表单状态</param>
        /// <returns>增加成功返回主键</returns>
        public string AddUserControls(UserInfo userInfo, string mainUserCtrlId, string userContrlsId, int controlOrder, string controlState)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_AddUserControls);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.AddUserControls(mainUserCtrlId, userContrlsId, controlOrder, controlState);
            });
            return(returnValue);
        }
Beispiel #6
0
        /// <summary>
        /// 获得主表单分页列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>数据表</returns>
        public DataTable GetMainUserControlByPage(UserInfo userInfo, string search, out int recordCount, int pageIndex = 0, int pageSize = 50, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_GetMainUserControlByPage);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager            = new MainUserControlManager(dbProvider, userInfo);
                string whereExpression = MainUserControlTable.FieldDeleteMark + " = 0 ";
                if (!string.IsNullOrEmpty(search))
                {
                    whereExpression += " AND " + search;
                }
                order = string.IsNullOrEmpty(order) ? MainUserControlTable.FieldSortCode : order;

                dataTable = manager.GetDTByPage(out myrecordCount, pageIndex, pageSize, whereExpression, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }