示例#1
0
        /// <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);
            }
        }
示例#2
0
        /// <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);
            }
        }
示例#3
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);
            }
        }
示例#4
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);
     }
 }