You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB
C#

using BP.DA;
using BP.Sys;
using BP.Web;
using BP.WF;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BP.Demo
{
public class DoEvnFlow : BP.WF.FlowEventBase
{
public override string FlowMark {
get {return "021,002,060"; }
}
public override string FlowOverAfter()
{
try
{
GenerWorkFlow gwf = new GenerWorkFlow(this.WorkID);
string pTable1 = BP.DA.DBAccess.RunSQLReturnString("SELECT PTable FROM WF_FLOW WHERE No = " + gwf.FlowNo);//当前触发流程存储表
DataTable BFParas = BP.DA.DBAccess.RunSQLReturnTable("SELECT LCBH,BFOID,FLOWENDERRDT FROM " + pTable1 + " WHERE OID='" + this.WorkID + "'");//要同步表的数据
if (BFParas.Rows[0][0].ToString() == "") {
return "";
}
if (BFParas.Rows[0][1].ToString() == "")
{
return "";
}
string pTable2 = BP.DA.DBAccess.RunSQLReturnString("SELECT PTable FROM WF_FLOW WHERE No = " + BFParas.Rows[0][0]);
if (gwf.FlowNo == "021")
{
BP.DA.DBAccess.RunSQL("UPDATE " + pTable2 + " SET EFFECTIVE_DATE = '" + BFParas.Rows[0][2] + "' WHERE OID=" + BFParas.Rows[0][1]);
}
else if (gwf.FlowNo == "002")
{
BP.DA.DBAccess.RunSQL("UPDATE " + pTable2 + " SET BFSJ = '" + BFParas.Rows[0][2] + "' WHERE OID=" + BFParas.Rows[0][1]);
}
}
catch (Exception ex) {
return ex.Message;
}
return base.FlowOverAfter();
}
}
}