コード例 #1
0
ファイル: FLOW_MODELDEFINE_TDAL.cs プロジェクト: jjg0519/OA
        /// <summary>
        /// 模块定义
        /// </summary>
        /// <param name="con">OracleConnection</param>
        /// <param name="ModelCode">模块代码</param>
        /// <returns></returns>
        public static List <FLOW_MODELDEFINE_T> GetModelDefineByCode(OracleConnection con, string ModelCode)
        {
            if (string.IsNullOrEmpty(con.ConnectionString))
            {
                con.ConnectionString = ADOHelper.ConnectionString;
            }
            List <FLOW_MODELDEFINE_T> list = new List <FLOW_MODELDEFINE_T>();
            OracleDataReader          dr   = null;

            try
            {
                #region

                //OracleCommand cmd = con.CreateCommand();
                //cmd.CommandText = "select * from FLOW_MODELDEFINE_T where MODELCODE='" + ModelCode + "'";

                //dr = cmd.ExecuteReader();
                string sql = "select * from FLOW_MODELDEFINE_T where MODELCODE='" + ModelCode + "'";
                dr = MsOracle.ExecuteReaderByTransaction(con, sql, null);
                while (dr.Read())
                {
                    #region define
                    FLOW_MODELDEFINE_T define = new FLOW_MODELDEFINE_T();
                    define.CREATECOMPANYID    = dr["CREATECOMPANYID"] == DBNull.Value ? null : dr["CREATECOMPANYID"].ToString();
                    define.CREATEDATE         = (DateTime)dr["CREATEDATE"];
                    define.CREATEDEPARTMENTID = dr["CREATEDEPARTMENTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    define.CREATEPOSTID       = dr["CREATEPOSTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    define.CREATEUSERID       = dr["CREATEUSERID"] == DBNull.Value ? null : dr["CREATEUSERID"].ToString();
                    define.CREATEUSERNAME     = dr["CREATEUSERNAME"] == DBNull.Value ? null : dr["CREATEUSERNAME"].ToString();
                    define.DESCRIPTION        = dr["DESCRIPTION"] == DBNull.Value ? null : dr["DESCRIPTION"].ToString();
                    define.EDITDATE           = dr["EDITDATE"] == DBNull.Value ? null : (DateTime?)dr["EDITDATE"];
                    define.EDITUSERID         = dr["EDITUSERID"] == DBNull.Value ? null : dr["EDITUSERID"].ToString();
                    define.EDITUSERNAME       = dr["EDITUSERNAME"] == DBNull.Value ? null : dr["EDITUSERNAME"].ToString();
                    define.MODELCODE          = dr["MODELCODE"] == DBNull.Value ? null : dr["MODELCODE"].ToString();
                    define.MODELDEFINEID      = dr["MODELDEFINEID"] == DBNull.Value ? null : dr["MODELDEFINEID"].ToString();
                    define.PARENTMODELCODE    = dr["PARENTMODELCODE"] == DBNull.Value ? null : dr["PARENTMODELCODE"].ToString();
                    define.SYSTEMCODE         = dr["SYSTEMCODE"] == DBNull.Value ? null : dr["SYSTEMCODE"].ToString();
                    list.Add(define);
                    #endregion
                }
                dr.Close();
                #endregion
                return(list);
            }
            catch (Exception ex)
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                throw new Exception("GetModelDefineByCode-->" + ex.Message);
            }
        }
コード例 #2
0
ファイル: T_WF_PERSONALRECORDDAL.cs プロジェクト: jjg0519/OA
        /// <summary>
        /// 根据ID获取我的单据实体
        /// </summary>
        /// <param name="PERSONALRECORDID">PERSONALRECORDID</param>
        /// <returns></returns>
        public static T_WF_PERSONALRECORD GetPersonalRecordByPersonalrecordid(OracleConnection con, string personalrecordid)
        {
            if (string.IsNullOrEmpty(con.ConnectionString))
            {
                con.ConnectionString = ADOHelper.ConnectionString;
            }
            T_WF_PERSONALRECORD model = new T_WF_PERSONALRECORD();
            OracleDataReader    dr    = null;

            try
            {
                #region

                string sql = "select * from T_WF_PERSONALRECORD where PERSONALRECORDID='" + personalrecordid + "'";
                dr = MsOracle.ExecuteReaderByTransaction(con, sql, null);
                while (dr.Read())
                {
                    #region define
                    model.PERSONALRECORDID  = dr["PERSONALRECORDID"].ToString();                                                       //个人单据ID
                    model.SYSTYPE           = dr["SYSTYPE"].ToString();                                                                //系统类型
                    model.MODELCODE         = dr["MODELCODE"].ToString();                                                              //所属模块代码
                    model.MODELID           = dr["MODELID"].ToString();                                                                //单据ID
                    model.CHECKSTATE        = dr["CHECKSTATE"].ToString() != "" ? Convert.ToDecimal(dr["CHECKSTATE"]) : 0;             //单据审核状态
                    model.OWNERID           = dr["OWNERID"].ToString();                                                                //所属员工ID
                    model.OWNERPOSTID       = dr["OWNERPOSTID"].ToString();                                                            //所属岗位ID
                    model.OWNERDEPARTMENTID = dr["OWNERDEPARTMENTID"].ToString();                                                      //所属部门ID
                    model.OWNERCOMPANYID    = dr["OWNERCOMPANYID"].ToString();                                                         //所属公司ID
                    model.CONFIGINFO        = dr["CONFIGINFO"].ToString();                                                             //参数配置
                    model.MODELDESCRIPTION  = dr["MODELDESCRIPTION"].ToString();                                                       //单据简要描叙
                    model.ISFORWARD         = dr["ISFORWARD"].ToString() != "" ? Convert.ToDecimal(dr["ISFORWARD"]) : 0;               //是否转发(0表示非转发,1表示转发)
                    model.ISVIEW            = dr["ISVIEW"].ToString() != "" ? Convert.ToDecimal(dr["ISVIEW"]) : 0;                     //是否已查看(0表示未查看,1表示已查看)
                    model.CREATEDATE        = dr["CREATEDATE"].ToString() != "" ? Convert.ToDateTime(dr["CREATEDATE"]) : DateTime.Now; //创建时间
                    model.UPDATEDATE        = dr["UPDATEDATE"].ToString() != "" ? Convert.ToDateTime(dr["UPDATEDATE"]) : DateTime.Now; //修改时间

                    #endregion
                }
                dr.Close();
                #endregion
                return(model);
            }
            catch (Exception ex)
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                throw new Exception("我的单据异常信息-->" + ex.Message);
            }
        }
コード例 #3
0
ファイル: FLOW_CONSULTATION_TDAL.cs プロジェクト: jjg0519/OA
        /// <summary>
        ///  更新: [咨询]
        /// </summary>
        /// <param name="model">FLOW_CONSULTATION_T</param>
        /// <returns></returns>
        public static int Update(OracleConnection con, FLOW_CONSULTATION_T model)
        {
            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                model.REPLYDATE = DateTime.Now;
                model.FLAG      = "1";
                string            updSql   = "UPDATE FLOW_CONSULTATION_T SET FLOWRECORDDETAILID=:FLOWRECORDDETAILID,CONSULTATIONUSERID=:CONSULTATIONUSERID,CONSULTATIONUSERNAME=:CONSULTATIONUSERNAME,CONSULTATIONCONTENT=:CONSULTATIONCONTENT,CONSULTATIONDATE=:CONSULTATIONDATE,REPLYUSERID=:REPLYUSERID,REPLYUSERNAME=:REPLYUSERNAME,REPLYCONTENT=:REPLYCONTENT,REPLYDATE=:REPLYDATE,FLAG=:FLAG WHERE   CONSULTATIONID=:CONSULTATIONID";
                OracleParameter[] pageparm =
                {
                    new OracleParameter(":CONSULTATIONID",       OracleType.NVarChar),
                    new OracleParameter(":FLOWRECORDDETAILID",   OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONUSERID",   OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONUSERNAME", OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONCONTENT",  OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONDATE",     OracleType.DateTime),
                    new OracleParameter(":REPLYUSERID",          OracleType.NVarChar),
                    new OracleParameter(":REPLYUSERNAME",        OracleType.NVarChar),
                    new OracleParameter(":REPLYCONTENT",         OracleType.NVarChar),
                    new OracleParameter(":REPLYDATE",            OracleType.DateTime),
                    new OracleParameter(":FLAG",                 OracleType.NVarChar)
                };
                pageparm[0].Value  = MsOracle.GetValue(model.CONSULTATIONID);                             //
                pageparm[1].Value  = MsOracle.GetValue(model.FLOW_FLOWRECORDDETAIL_T.FLOWRECORDDETAILID); //
                pageparm[2].Value  = MsOracle.GetValue(model.CONSULTATIONUSERID);                         //
                pageparm[3].Value  = MsOracle.GetValue(model.CONSULTATIONUSERNAME);                       //
                pageparm[4].Value  = MsOracle.GetValue(model.CONSULTATIONCONTENT);                        //
                pageparm[5].Value  = MsOracle.GetValue(model.CONSULTATIONDATE);                           //
                pageparm[6].Value  = MsOracle.GetValue(model.REPLYUSERID);                                //
                pageparm[7].Value  = MsOracle.GetValue(model.REPLYUSERNAME);                              //
                pageparm[8].Value  = MsOracle.GetValue(model.REPLYCONTENT);                               //
                pageparm[9].Value  = MsOracle.GetValue(model.REPLYDATE);                                  //
                pageparm[10].Value = MsOracle.GetValue(model.FLAG);                                       //0未回复,1回复

                return(MsOracle.ExecuteSQLByTransaction(con, updSql, pageparm));
            }
            catch (Exception ex)
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                throw new Exception("FLOW_CONSULTATION_TDAL_Update:" + ex.Message);
            }
        }
コード例 #4
0
ファイル: FLOW_CONSULTATION_TDAL.cs プロジェクト: jjg0519/OA
        /// <summary>
        /// 新增[咨询]
        /// </summary>
        /// <param name="con">OracleConnection</param>
        /// <param name="model">FLOW_CONSULTATION_T</param>
        /// <returns></returns>
        public static int Add(OracleConnection con, FLOW_CONSULTATION_T model)
        {
            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                string            insSql   = "INSERT INTO FLOW_CONSULTATION_T (CONSULTATIONID,FLOWRECORDDETAILID,CONSULTATIONUSERID,CONSULTATIONUSERNAME,CONSULTATIONCONTENT,CONSULTATIONDATE,REPLYUSERID,REPLYUSERNAME,REPLYCONTENT,REPLYDATE,FLAG) VALUES (:CONSULTATIONID,:FLOWRECORDDETAILID,:CONSULTATIONUSERID,:CONSULTATIONUSERNAME,:CONSULTATIONCONTENT,:CONSULTATIONDATE,:REPLYUSERID,:REPLYUSERNAME,:REPLYCONTENT,:REPLYDATE,:FLAG)";
                OracleParameter[] pageparm =
                {
                    new OracleParameter(":CONSULTATIONID",       OracleType.NVarChar),
                    new OracleParameter(":FLOWRECORDDETAILID",   OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONUSERID",   OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONUSERNAME", OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONCONTENT",  OracleType.NVarChar),
                    new OracleParameter(":CONSULTATIONDATE",     OracleType.DateTime),
                    new OracleParameter(":REPLYUSERID",          OracleType.NVarChar),
                    new OracleParameter(":REPLYUSERNAME",        OracleType.NVarChar),
                    new OracleParameter(":REPLYCONTENT",         OracleType.NVarChar),
                    new OracleParameter(":REPLYDATE",            OracleType.DateTime),
                    new OracleParameter(":FLAG",                 OracleType.NVarChar)
                };
                pageparm[0].Value  = MsOracle.GetValue(model.CONSULTATIONID);                             //
                pageparm[1].Value  = MsOracle.GetValue(model.FLOW_FLOWRECORDDETAIL_T.FLOWRECORDDETAILID); //
                pageparm[2].Value  = MsOracle.GetValue(model.CONSULTATIONUSERID);                         //
                pageparm[3].Value  = MsOracle.GetValue(model.CONSULTATIONUSERNAME);                       //
                pageparm[4].Value  = MsOracle.GetValue(model.CONSULTATIONCONTENT);                        //
                pageparm[5].Value  = MsOracle.GetValue(model.CONSULTATIONDATE);                           //
                pageparm[6].Value  = MsOracle.GetValue(model.REPLYUSERID);                                //
                pageparm[7].Value  = MsOracle.GetValue(model.REPLYUSERNAME);                              //
                pageparm[8].Value  = MsOracle.GetValue(model.REPLYCONTENT);                               //
                pageparm[9].Value  = MsOracle.GetValue(model.REPLYDATE);                                  //
                pageparm[10].Value = MsOracle.GetValue(model.FLAG);                                       //0未回复,1回复

                return(MsOracle.ExecuteSQLByTransaction(con, insSql, pageparm));
            }
            catch (Exception ex)
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                throw new Exception("FLOW_CONSULTATION_TDAL_Add:" + ex.Message);
            }
        }
コード例 #5
0
ファイル: FLOW_FLOWDEFINE_TDAL.cs プロジェクト: jjg0519/OA
        /// <summary>
        /// 流程模型定义
        /// </summary>
        /// <param name="con"></param>
        /// <param name="CompanyID"></param>
        /// <param name="ModelCode"></param>
        /// <returns></returns>
        public static List <FLOW_FLOWDEFINE_T> GetFlowByModelName(OracleConnection con, string CompanyID, string ModelCode)
        {
            List <FLOW_FLOWDEFINE_T> listDefine = new List <FLOW_FLOWDEFINE_T>();
            OracleDataReader         dr         = null;

            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }
                #region
                string sqlFLOW_MODELFLOWRELATION_T = @"select * from FLOW_MODELFLOWRELATION_T where COMPANYID='" + CompanyID + "' and FLAG='1'";

                string sqlFLOW_FLOWDEFINE_T = @"select * from FLOW_FLOWDEFINE_T where MODELCODE='" + ModelCode + "'";
                string sql = @"select FLOW_FLOWDEFINE_T.* from ("
                             + sqlFLOW_MODELFLOWRELATION_T
                             + ") FLOW_MODELFLOWRELATION_T join ("
                             + sqlFLOW_FLOWDEFINE_T
                             + ") FLOW_FLOWDEFINE_T on FLOW_MODELFLOWRELATION_T.FLOWCODE=FLOW_FLOWDEFINE_T.FLOWCODE";


                //OracleCommand cmd = con.CreateCommand();
                //cmd.CommandText = sql;

                //dr = cmd.ExecuteReader();
                LogHelper.WriteLog("FLOW_FLOWDEFINE_TDAL->GetFlowByModelName SQL语句:" + sql);
                dr = MsOracle.ExecuteReaderByTransaction(con, sql, null);
                while (dr.Read())
                {
                    #region FLOW_FLOWDEFINE_T
                    FLOW_FLOWDEFINE_T define = new FLOW_FLOWDEFINE_T();
                    define.CREATECOMPANYID    = dr["CREATECOMPANYID"] == DBNull.Value ? null : dr["CREATECOMPANYID"].ToString();
                    define.CREATEDATE         = (DateTime)dr["CREATEDATE"];
                    define.CREATEDEPARTMENTID = dr["CREATEDEPARTMENTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    define.CREATEPOSTID       = dr["CREATEPOSTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    define.CREATEUSERID       = dr["CREATEUSERID"] == DBNull.Value ? null : dr["CREATEUSERID"].ToString();
                    define.CREATEUSERNAME     = dr["CREATEUSERNAME"] == DBNull.Value ? null : dr["CREATEUSERNAME"].ToString();
                    define.DESCRIPTION        = dr["DESCRIPTION"] == DBNull.Value ? null : dr["DESCRIPTION"].ToString();
                    define.EDITDATE           = dr["EDITDATE"] == DBNull.Value ? null : (DateTime?)dr["EDITDATE"];
                    define.EDITUSERID         = dr["EDITUSERID"] == DBNull.Value ? null : dr["EDITUSERID"].ToString();
                    define.EDITUSERNAME       = dr["EDITUSERNAME"] == DBNull.Value ? null : dr["EDITUSERNAME"].ToString();
                    define.FLOWCODE           = dr["FLOWCODE"] == DBNull.Value ? null : dr["FLOWCODE"].ToString();
                    define.FLOWTYPE           = dr["FLOWTYPE"] == DBNull.Value ? null : dr["FLOWTYPE"].ToString();
                    define.FLOWDEFINEID       = dr["FLOWDEFINEID"] == DBNull.Value ? null : dr["FLOWDEFINEID"].ToString();
                    define.LAYOUT             = dr["LAYOUT"] == DBNull.Value ? null : dr["LAYOUT"].ToString();
                    define.RULES = dr["RULES"] == DBNull.Value ? null : dr["RULES"].ToString();
                    define.XOML  = dr["XOML"] == DBNull.Value ? null : dr["XOML"].ToString();;
                    listDefine.Add(define);
                    break;
                    #endregion
                }
                dr.Close();
                #endregion
                return(listDefine);
            }

            catch (Exception ex)
            {
                #region
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }

                throw new Exception("GetFlowByModelName-->" + ex.Message);
                #endregion
            }
        }
コード例 #6
0
        /// <summary>
        /// 查询 [模块与流程定义关联]
        /// </summary>
        /// <param name="CompanyID">创建公司ID</param>
        /// <param name="DepartID">创建部门ID</param>
        /// <param name="ModelCode">模块代码</param>
        /// <param name="FlowType">0:审批流程,1:任务流程</param>
        /// <param name="OrgType">1:代表部门ID为空,否则部门ID不为空</param>
        /// <returns></returns>
        public static List <FLOW_MODELFLOWRELATION_T> GetFlowByModelName(OracleConnection con, string CompanyID, string DepartID, string ModelCode, string FlowType, string OrgType)
        {
            List <FLOW_MODELFLOWRELATION_T> listRelation = new List <FLOW_MODELFLOWRELATION_T>();
            OracleDataReader dr  = null;
            string           sql = "";

            try
            {
                if (con.State != ConnectionState.Open)
                {
                    con.Open();
                }

                sql = @" select * from FLOW_MODELFLOWRELATION_T where COMPANYID='{0}' and FLOWTYPE='{1}' and FLAG='1'  and MODELCODE='{2}'";

                if (OrgType != "1")
                {
                    sql = sql + " and DEPARTMENTID is null";
                }
                else
                {
                    sql = sql + " and DEPARTMENTID='{3}'";
                }

                sql = string.Format(sql, CompanyID, FlowType, ModelCode, DepartID);
                #region



                //OracleCommand cmd = con.CreateCommand();
                //cmd.CommandText = sql;

                //dr = cmd.ExecuteReader();
                LogHelper.WriteLog("FLOW_MODELFLOWRELATION_TDAL->GetFlowByModelName SQL语句:" + sql);
                dr = MsOracle.ExecuteReaderByTransaction(con, sql, null);
                while (dr.Read())
                {
                    #region FLOW_MODELFLOWRELATION_T
                    FLOW_MODELFLOWRELATION_T relation = new FLOW_MODELFLOWRELATION_T();
                    relation.COMPANYID          = dr["COMPANYID"] == DBNull.Value ? null : dr["COMPANYID"].ToString();
                    relation.CREATECOMPANYID    = dr["CREATECOMPANYID"] == DBNull.Value ? null : dr["CREATECOMPANYID"].ToString();
                    relation.CREATEDATE         = (DateTime)dr["CREATEDATE"];
                    relation.CREATEDEPARTMENTID = dr["CREATEDEPARTMENTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    relation.CREATEPOSTID       = dr["CREATEPOSTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                    relation.CREATEUSERID       = dr["CREATEUSERID"] == DBNull.Value ? null : dr["CREATEUSERID"].ToString();
                    relation.CREATEUSERNAME     = dr["CREATEUSERNAME"] == DBNull.Value ? null : dr["CREATEUSERNAME"].ToString();
                    relation.DEPARTMENTID       = dr["DEPARTMENTID"] == DBNull.Value ? null : dr["DEPARTMENTID"].ToString();
                    relation.EDITDATE           = dr["EDITDATE"] == DBNull.Value ? null : (DateTime?)dr["EDITDATE"];
                    relation.EDITUSERID         = dr["EDITUSERID"] == DBNull.Value ? null : dr["EDITUSERID"].ToString();
                    relation.EDITUSERNAME       = dr["EDITUSERNAME"] == DBNull.Value ? null : dr["EDITUSERNAME"].ToString();
                    relation.FLAG                       = dr["FLAG"] == DBNull.Value ? null : dr["FLAG"].ToString();
                    relation.FLOWTYPE                   = dr["FLOWTYPE"] == DBNull.Value ? null : dr["FLOWTYPE"].ToString();
                    relation.MODELFLOWRELATIONID        = dr["MODELFLOWRELATIONID"] == DBNull.Value ? null : dr["MODELFLOWRELATIONID"].ToString();
                    relation.FLOW_FLOWDEFINE_T          = new FLOW_FLOWDEFINE_T();
                    relation.FLOW_FLOWDEFINE_T.FLOWCODE = dr["FLOWCODE"] == DBNull.Value ? null : dr["FLOWCODE"].ToString();
                    listRelation.Add(relation);
                    break;
                    #endregion
                }
                dr.Close();
                if (listRelation.Count > 0)
                {
                    sql = @"select * from FLOW_FLOWDEFINE_T where FLOWCODE='" + listRelation[0].FLOW_FLOWDEFINE_T.FLOWCODE + "'";
                    //dr = cmd.ExecuteReader();

                    dr = MsOracle.ExecuteReaderByTransaction(con, sql, null);
                    while (dr.Read())
                    {
                        #region FLOW_FLOWDEFINE_T
                        FLOW_FLOWDEFINE_T define = new FLOW_FLOWDEFINE_T();
                        define.CREATECOMPANYID    = dr["CREATECOMPANYID"] == DBNull.Value ? null : dr["CREATECOMPANYID"].ToString();
                        define.CREATEDATE         = (DateTime)dr["CREATEDATE"];
                        define.CREATEDEPARTMENTID = dr["CREATEDEPARTMENTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                        define.CREATEPOSTID       = dr["CREATEPOSTID"] == DBNull.Value ? null : dr["CREATEDEPARTMENTID"].ToString();
                        define.CREATEUSERID       = dr["CREATEUSERID"] == DBNull.Value ? null : dr["CREATEUSERID"].ToString();
                        define.CREATEUSERNAME     = dr["CREATEUSERNAME"] == DBNull.Value ? null : dr["CREATEUSERNAME"].ToString();
                        define.DESCRIPTION        = dr["DESCRIPTION"] == DBNull.Value ? null : dr["DESCRIPTION"].ToString();
                        define.EDITDATE           = dr["EDITDATE"] == DBNull.Value ? null : (DateTime?)dr["EDITDATE"];
                        define.EDITUSERID         = dr["EDITUSERID"] == DBNull.Value ? null : dr["EDITUSERID"].ToString();
                        define.EDITUSERNAME       = dr["EDITUSERNAME"] == DBNull.Value ? null : dr["EDITUSERNAME"].ToString();
                        define.FLOWCODE           = dr["FLOWCODE"] == DBNull.Value ? null : dr["FLOWCODE"].ToString();
                        define.FLOWTYPE           = dr["FLOWTYPE"] == DBNull.Value ? null : dr["FLOWTYPE"].ToString();
                        define.FLOWDEFINEID       = dr["FLOWDEFINEID"] == DBNull.Value ? null : dr["FLOWDEFINEID"].ToString();
                        define.LAYOUT             = dr["LAYOUT"] == DBNull.Value ? null : dr["LAYOUT"].ToString();
                        define.RULES = dr["RULES"] == DBNull.Value ? null : dr["RULES"].ToString();
                        define.XOML  = dr["XOML"] == DBNull.Value ? null : dr["XOML"].ToString();;
                        listRelation[0].FLOW_FLOWDEFINE_T = define;
                        break;
                        #endregion
                    }
                    dr.Close();
                }

                #endregion
                return(listRelation);
            }
            catch (Exception ex)
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                throw new Exception("GetFlowByModelName-->" + ex.Message);
            }
        }
コード例 #7
0
        /// <summary>
        /// 更新元数据
        /// </summary>
        /// <param name="formid">formid</param>
        /// <param name="xml"></param>
        /// <returns></returns>
        public static bool UpdateMetadataByFormid(string formid, string xml)
        {
            try
            {
                string sql  = "UPDATE FLOW_FLOWRECORDMASTER_T set BUSINESSOBJECT=:BUSINESSOBJECT where FORMID=:FORMID ";
                string sql2 = "UPDATE T_WF_DOTASK set APPXML=:APPXML where ORDERID=:FORMID ";
                using (OracleConnection con = new OracleConnection(ADOHelper.ContextOracleConnection))
                {
                    try
                    {
                        con.Open();
                        MsOracle.BeginTransaction(con);
                        #region 审核主表
                        OracleParameter[] pageparm =
                        {
                            new OracleParameter(":FORMID",         OracleType.NVarChar),
                            new OracleParameter(":BUSINESSOBJECT", OracleType.Clob)
                        };
                        pageparm[0].Value = MsOracle.GetValue(formid); //
                        pageparm[1].Value = MsOracle.GetValue(xml);    //
                        int n = MsOracle.ExecuteSQLByTransaction(con, sql, pageparm);
                        LogHelper.WriteLog("时间:" + DateTime.Now.ToString() + "UpdateMetadataByFormid:【审核主表FLOW_FLOWRECORDMASTER_T】[更新元数据]成功 影响记录数:" + n + ";formid=" + formid + ";xml=" + xml);
                        #endregion
                        #region 待办任务
                        OracleParameter[] pageparm2 =
                        {
                            new OracleParameter(":FORMID", OracleType.NVarChar),
                            new OracleParameter(":APPXML", OracleType.Clob)
                        };
                        pageparm2[0].Value = MsOracle.GetValue(formid); //
                        pageparm2[1].Value = MsOracle.GetValue(xml);    //
                        int n2 = MsOracle.ExecuteSQLByTransaction(con, sql2, pageparm2);
                        LogHelper.WriteLog("时间:" + DateTime.Now.ToString() + "UpdateMetadataByFormid:【待办任务T_WF_DOTASK】[更新元数据]成功 影响记录数:" + n2 + ";formid=" + formid + ";xml=" + xml);

                        #endregion
                        MsOracle.CommitTransaction(con);
                        if ((n + n2) > 0)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    catch (Exception ex)
                    {
                        LogHelper.WriteLog("更新元数据 UpdateMetadataByFormid 异常信息:" + ex.Message);
                        return(false);
                    }
                    finally
                    {
                        if (con.State == ConnectionState.Open)
                        {
                            con.Close();
                        }
                        LogHelper.WriteLog("更新元数据:UpdateMetadataByFormid-> SQL=" + sql);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("更新元数据:UpdateMetadataByFormid:异常信息:" + ex.Message);
                return(false);
            }
        }
コード例 #8
0
 public bool AddDoTask(T_PF_PERSONALRECORD model)
 {
     ClosedDoTaskStatus(model.SYSTYPE, model.MODELID, model.OWNERID);
     try
     {
         using (OracleConnection con = new OracleConnection(dao.DatabaseString))
         {
             string insSql = @"INSERT INTO T_WF_DOTASK (DOTASKID,COMPANYID,ORDERID,ORDERUSERID,ORDERUSERNAME,ORDERSTATUS,MESSAGEBODY,
                              APPLICATIONURL,RECEIVEUSERID,BEFOREPROCESSDATE,ENGINECODE,DOTASKTYPE,DOTASKSTATUS,MAILSTATUS,
                              RTXSTATUS,SYSTEMCODE,MODELCODE,REMARK)
                              VALUES (:DOTASKID,:COMPANYID,:ORDERID,:ORDERUSERID,:ORDERUSERNAME,:ORDERSTATUS,:MESSAGEBODY,
                             :APPLICATIONURL,:RECEIVEUSERID,:BEFOREPROCESSDATE,:ENGINECODE,:DOTASKTYPE,:DOTASKSTATUS,:MAILSTATUS,
                             :RTXSTATUS,:SYSTEMCODE,:MODELCODE,:REMARK)";
             #region
             #region
             OracleParameter[] pageparm =
             {
                 new OracleParameter(":DOTASKID",          OracleType.NVarChar,   100),
                 new OracleParameter(":COMPANYID",         OracleType.NVarChar,   100),
                 new OracleParameter(":ORDERID",           OracleType.NVarChar,   100),
                 new OracleParameter(":ORDERUSERID",       OracleType.NVarChar,   100),
                 new OracleParameter(":ORDERUSERNAME",     OracleType.NVarChar,   100),
                 new OracleParameter(":ORDERSTATUS",       OracleType.Number),
                 new OracleParameter(":MESSAGEBODY",       OracleType.NVarChar,  4000),
                 new OracleParameter(":APPLICATIONURL",    OracleType.NVarChar,  2000),
                 new OracleParameter(":RECEIVEUSERID",     OracleType.NVarChar,   100),
                 new OracleParameter(":BEFOREPROCESSDATE", OracleType.DateTime),
                 new OracleParameter(":ENGINECODE",        OracleType.NVarChar,   100),
                 new OracleParameter(":DOTASKTYPE",        OracleType.Number),
                 new OracleParameter(":DOTASKSTATUS",      OracleType.Number),
                 new OracleParameter(":MAILSTATUS",        OracleType.Number),
                 new OracleParameter(":RTXSTATUS",         OracleType.Number),
                 new OracleParameter(":SYSTEMCODE",        OracleType.NVarChar,   100),
                 new OracleParameter(":MODELCODE",         OracleType.NVarChar,   100),
                 new OracleParameter(":REMARK",            OracleType.NVarChar,   200),
             };
             #endregion
             pageparm[0].Value  = MsOracle.GetValue(Guid.NewGuid().ToString()); //待办任务ID
             pageparm[1].Value  = MsOracle.GetValue(model.OWNERCOMPANYID);      //公司ID
             pageparm[2].Value  = MsOracle.GetValue(model.MODELID);             //单据ID
             pageparm[3].Value  = MsOracle.GetValue(model.OWNERID);             //单据所属人ID
             pageparm[4].Value  = MsOracle.GetValue("");                        //单据所属人名称
             pageparm[5].Value  = MsOracle.GetValue(0);                         //单据状态
             pageparm[6].Value  = MsOracle.GetValue(model.MODELDESCRIPTION);
             pageparm[7].Value  = MsOracle.GetValue(model.CONFIGINFO);
             pageparm[8].Value  = MsOracle.GetValue(model.OWNERID);
             pageparm[9].Value  = MsOracle.GetValue(DateTime.Now.AddDays(3));
             pageparm[10].Value = MsOracle.GetValue(""); //
             pageparm[11].Value = MsOracle.GetValue(4);  //待办任务类型(0、待办任务、1、流程咨询、3  )
             pageparm[12].Value = MsOracle.GetValue(0);  //代办任务状态(0、未处理 1、已处理 、2、任务撤销 10、删除)
             pageparm[13].Value = MsOracle.GetValue(1);  //邮件状态(0、未发送 1、已发送、2、未知 )
             pageparm[14].Value = MsOracle.GetValue(1);  //RTX状态(0、未发送 1、已发送、2、未知 )
             pageparm[15].Value = MsOracle.GetValue(model.SYSTYPE);
             pageparm[16].Value = MsOracle.GetValue(model.MODELCODE);
             pageparm[17].Value = MsOracle.GetValue("未提交单据");
             #endregion
             return(MsOracle.ExecuteNonQuery(con, CommandType.Text, insSql, pageparm) > 0 ? true : false);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog("新增未提交单据待办消息出错:" + ex);
         throw new Exception(ex.Message, ex);
     }
 }