/// <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); } }
/// <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); } }
/// <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); } }