c#插件代码怎么写有没有例子?

已邀请:

水若云

赞同来自:

        Context context = Context.Current;

string RecordID = Convert.ToString(FormDataSet["YY_OA_NewDoc.RecordID"]);

string sql1 = String.Format(@"SELECT TOP 1 AttachmentID FROM Document_File WHERE RecordID='{0}'", RecordID);
string a = "";
using (IDataReader read = Context.Current.IDataProvider.ExecuteReader(sql1))
{
if (read.Read())
{
a = read["AttachmentID"].ToString();
}
}
if (a != "")
{
string sqteam = "update YY_OA_NewDoc set Attachment2='" + a + "' where RecordID='" + RecordID + "'";
context.IDataProvider.ExecuteNonQuery(sqteam);
}

传灬说

赞同来自:

对的,可以直接写代码即可。

要回复问题请先登录注册