Example #1
0
        /// <summary>
        /// 获取流程信息(对数据库操作)
        /// </summary>
        /// <param name="FormID">表单ID</param>
        /// <param name="FlowGUID">明细ID</param>
        /// <param name="CheckState">审批状态(同意:1,不同意:0 ,未处理:2,会签同意7,会签不同意8)</param>
        /// <param name="Flag">审批状态(已审批:1,未审批:0)</param>
        /// <param name="ModelCode">模块代码</param>
        /// <param name="CompanyID">创建公司ID</param>
        /// <param name="EditUserID">操作人</param>
        /// <param name="FlowType">流程类型(0:审批流程,1:任务流程)</param>
        /// <returns></returns>       
        public static List<FLOW_FLOWRECORDDETAIL_T> GetFlowInfo(OracleConnection con, string FormID, string FlowGUID, string CheckState, string Flag, string ModelCode, string CompanyID, string EditUserID, List<FlowType> FlowType)
        {

            try
            {
                List<string> FlowTypeList = new List<string>();

                FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();
                var dt = FLOW_FLOWRECORDDETAIL_TDAL.GetFlowRecord(con, FormID, FlowGUID, CheckState, Flag, ModelCode, CompanyID, EditUserID, Utility.FlowTypeListToStringList(FlowType));

                if (dt.Count > 0)
                    return dt;
                return null;
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("GetFlowInfo异常信息:" + ex.Message);
                throw new Exception("GetFlowInfo:" + ex.Message);
            }


        }
Example #2
0
 /// <summary>
 /// 更新[流程审批明细表]
 /// </summary>
 /// <param name="entity">流程审批明细表</param>
 /// <returns></returns>
 public FLOW_FLOWRECORDDETAIL_T UpdateFlowRecord2(OracleConnection con, FLOW_FLOWRECORDDETAIL_T entity)
 {
     FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();
     entity.FLAG = "1";
     FLOW_FLOWRECORDDETAIL_TDAL.Update(con, entity);
     return entity;
 }
Example #3
0
        public DataResult CancelFlow(SubmitData submitData, DataResult dataResult, List<FLOW_FLOWRECORDDETAIL_T> fd)
        {
            //WorkflowRuntime workflowRuntime = null;
            WorkflowInstance instance = null;

            FLOW_FLOWRECORDDETAIL_T entity = new FLOW_FLOWRECORDDETAIL_T();
            #region
            entity.FLOWRECORDDETAILID = Guid.NewGuid().ToString();
            entity.CREATECOMPANYID = submitData.ApprovalUser.CompanyID;
            entity.CREATEDEPARTMENTID = submitData.ApprovalUser.DepartmentID;
            entity.CREATEPOSTID = submitData.ApprovalUser.PostID;
            entity.CREATEUSERID = submitData.ApprovalUser.UserID;
            entity.CREATEUSERNAME = submitData.ApprovalUser.UserName;
            entity.EDITDATE = DateTime.Now;
            entity.CONTENT = submitData.ApprovalContent;
            entity.CHECKSTATE = "9";
            entity.STATECODE = "Cancel";
            entity.FLAG = "1";
            entity.PARENTSTATEID = entity.FLOWRECORDDETAILID;

            entity.CREATEDATE = DateTime.Now;
            entity.EDITDATE = DateTime.Now;
            entity.EDITUSERID = entity.CREATEUSERID;
            entity.EDITUSERNAME = entity.CREATEUSERNAME;
            entity.EDITCOMPANYID = entity.CREATECOMPANYID;
            entity.EDITDEPARTMENTID = entity.CREATEDEPARTMENTID;
            entity.EDITPOSTID = entity.CREATEPOSTID;

            entity.FLOW_FLOWRECORDMASTER_T = fd[0].FLOW_FLOWRECORDMASTER_T;
            entity.FLOW_FLOWRECORDMASTER_T.FLOW_FLOWRECORDDETAIL_T.Add(entity);
            entity.FLOW_FLOWRECORDMASTER_T.CHECKSTATE = "9"; //设为撤销
            entity.FLOW_FLOWRECORDMASTER_T.EDITUSERID = submitData.ApprovalUser.UserID;
            entity.FLOW_FLOWRECORDMASTER_T.EDITUSERNAME = submitData.ApprovalUser.UserName;
            entity.FLOW_FLOWRECORDMASTER_T.EDITDATE = DateTime.Now;
            #endregion

            workflowRuntime = SMTWorkFlowManage.CreateWorkFlowRuntime(true);
            LogHelper.WriteLog("CancelFlow从持久化库在恢复创建工作流实例ID=" + entity.FLOW_FLOWRECORDMASTER_T.INSTANCEID);
            instance = SMTWorkFlowManage.GetWorkflowInstance(workflowRuntime, entity.FLOW_FLOWRECORDMASTER_T.INSTANCEID);
            instance.Terminate("0");
            FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();
            entity.FLAG = "1";
            //Dal.AddFlowRecord(entity);
            FLOW_FLOWRECORDDETAIL_TDAL.Add(entity);
            FLOW_FLOWRECORDMASTER_TDAL.Update(entity.FLOW_FLOWRECORDMASTER_T);
            fd.Where(detail => detail.FLAG == "0").ToList().ForEach(item =>
                {
                    //Dal.Delete(item);
                    //Dal.DeleteFlowRecord(item);
                    FLOW_FLOWRECORDDETAIL_TDAL.Delete(item);
                });
            dataResult.CheckState = "9";//
            dataResult.FlowResult = FlowResult.SUCCESS;
            return dataResult;
        }
Example #4
0
File: FlowBLL.cs Project: JuRogn/OA
        public FLOW_FLOWRECORDDETAIL_T UpdateFlowRecord2(FLOW_FLOWRECORDDETAIL_T entity)
        {
            FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();


            entity.FLAG = "1";
            FLOW_FLOWRECORDDETAIL_TDAL.Update(entity);
            //Dal.UpdateFlowRecord2(entity);
            return entity;




        }
Example #5
0
File: FlowBLL.cs Project: JuRogn/OA
        public FLOW_FLOWRECORDDETAIL_T UpdateFlowRecord(FLOW_FLOWRECORDDETAIL_T entity, string NextStateCode, string EditUserId)
        {
            FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();


            //List<FLOW_FLOWRECORDDETAIL_T> Temp = Dal.GetFlowRecord("", entity.FLOWRECORDDETAILID, "", "", "", "", "");
            //Temp[0].CONTENT = entity.CONTENT;
            //Temp[0].CHECKSTATE = entity.CHECKSTATE;
            //Temp[0].FLAG = "1";
            //Temp[0].EDITDATE = DateTime.Now;
            //if (entity.FLOW_FLOWRECORDMASTER_T.CHECKSTATE != null)
            //    Temp[0].FLOW_FLOWRECORDMASTER_T.CHECKSTATE = entity.FLOW_FLOWRECORDMASTER_T.CHECKSTATE;
            //if (entity.FLOW_FLOWRECORDMASTER_T.EDITUSERID != null)
            //    Temp[0].FLOW_FLOWRECORDMASTER_T.EDITUSERID = entity.FLOW_FLOWRECORDMASTER_T.EDITUSERID;
            //if (entity.FLOW_FLOWRECORDMASTER_T.EDITUSERNAME != null)
            //    Temp[0].FLOW_FLOWRECORDMASTER_T.EDITUSERNAME = entity.FLOW_FLOWRECORDMASTER_T.EDITUSERNAME;
            //if (entity.FLOW_FLOWRECORDMASTER_T.EDITDATE != null)
            //    Temp[0].FLOW_FLOWRECORDMASTER_T.EDITDATE = entity.FLOW_FLOWRECORDMASTER_T.EDITDATE;

            //entity = Temp[0];

            //  entity.EDITDATE = DateTime.Now;
            entity.FLAG = "1";
            FLOW_FLOWRECORDDETAIL_TDAL.Update(entity);
            //Dal.UpdateFlowRecord(entity);
            return entity;




        }
Example #6
0
        /// <summary>
        /// 获取流程信息(对数据库操作)
        /// </summary>
        /// <param name="FormID">表单ID</param>
        /// <param name="FlowGUID">明细ID</param>
        /// <param name="CheckState">审批状态(同意:1,不同意:0 ,未处理:2,会签同意7,会签不同意8)</param>
        /// <param name="Flag">审批状态(已审批:1,未审批:0)</param>
        /// <param name="ModelCode">模块代码</param>
        /// <param name="CompanyID">创建公司ID</param>
        /// <param name="EditUserID">操作人</param>
        /// <param name="FlowType">流程类型(0:审批流程,1:任务流程)</param>
        /// <returns></returns>       
        public static List<FLOW_FLOWRECORDDETAIL_T> GetFlowInfo( string FormID, string FlowGUID, string CheckState, string Flag, string ModelCode, string CompanyID, string EditUserID, List<FlowType> FlowType)
        {
            try
            {
                List<string> FlowTypeList = new List<string>();

                FLOW_FLOWRECORDDETAIL_TDAL Dal = new FLOW_FLOWRECORDDETAIL_TDAL();
                var dt = FLOW_FLOWRECORDDETAIL_TDAL.GetFlowRecord( FormID, FlowGUID, CheckState, Flag, ModelCode, CompanyID, EditUserID, FlowUtility.FlowTypeListToStringList(FlowType));

                if (dt.Count > 0)
                    return dt;
                return null;
            }
            catch (Exception ex)
            {
                Tracer.Debug("获取流程信息GetFlowInfo异常信息(FormID=" + FormID + ";ModelCode=" + ModelCode + ";CompanyID=" + CompanyID + ";EditUserID=" + EditUserID + "):" + ex.Message);
                throw new Exception("获取流程信息出错,请联系管理员! \r\n FormID=" + FormID + "");
            }
        }