惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threatpost
P
Privacy International News Feed
T
Tenable Blog
Know Your Adversary
Know Your Adversary
C
Cisco Blogs
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
爱范儿
爱范儿
U
Unit 42
K
Kaspersky official blog
C
Cybersecurity and Infrastructure Security Agency CISA
Jina AI
Jina AI
O
OpenAI News
L
LangChain Blog
PCI Perspectives
PCI Perspectives
P
Privacy & Cybersecurity Law Blog
Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
F
Full Disclosure
L
Lohrmann on Cybersecurity
V
V2EX
L
LINUX DO - 热门话题
S
Security Affairs
量子位
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG
Schneier on Security
Schneier on Security
月光博客
月光博客
MyScale Blog
MyScale Blog
C
CERT Recently Published Vulnerability Notes
AWS News Blog
AWS News Blog
博客园 - 叶小钗
Forbes - Security
Forbes - Security
W
WeLiveSecurity
T
Troy Hunt's Blog
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Apple Machine Learning Research
Apple Machine Learning Research
雷峰网
雷峰网
Google Online Security Blog
Google Online Security Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
H
Help Net Security
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - 软件之美,美在缺陷-Johnson

轻松部署Captaris Workflow 6.5模型 浅比.NET和Java开发工具。 .NET资源转换工具 排除大型工作流应用的性能问题纪要。 淘宝网一家店里看到的留言和掌柜的搞笑回复。 Windows Network Load Balancing群集故障排除手记。 Captaris Workflow 6.0 EventService 执行效率低下的排除。 Captaris Workflow开发系列课程介绍。 在虚拟机里System进程占用CPU100%的问题解决 如何做好售前技术支持工作 一家公司网站上的招聘人才招聘栏目 在GridView中使用ModalPopupExtender(转) VMWare 5.5 虚拟机错误。 Your've got mail A new post form Microsoft Live Writer. How to: Debug Captaris Workflow 6.0 Process efficiency? How to: Debug Captaris Workflow 6.0 Process efficiency? Captaris Workflow 6.0问题两则。 Recently learning about AJAX on ASP.NET
如何:在OpenText Workflow 6.5模型中保存和读取多行数据
软件之美,美在缺陷-Johnson · 2009-11-17 · via 博客园 - 软件之美,美在缺陷-Johnson

在Captaris Workflow 6.0和之前的版本中,保存多行数据似乎没有被提及,因此大部分(包括我的团队)都要自己建立(利用IDE的向导也算)数据库来保存订单项、物品列表、人员列表这样的多行集合。这一切在6.5都已解决,流程开发者可以保存多行的事省下些脑细胞。不过从应用的情况来看,还是要费一些脑细胞的。下面用示例展示如何保存。

1.在设计流程时加入一个XML对象。

2.新增一行数据:

Teamplate.BLL.IModelXML oXml = this.Process.GetXmlObject("Common"); //”Common”是在前一步加入的XML对象名。
XmlDocument oDoc = new XmlDocument();
oDoc.LoadXml(oXml.XmlString);

XmlNode oE = oDoc.SelectSingleNode("Common/Form/Items");
//创建"Item"元素
XmlElement oEl = oDoc.CreateElement("Item");
//员工编号
oEl.SetAttribute("Code", this.drpEmployees.SelectedItem.Value);
//姓名
oEl.SetAttribute("Name", this.drpEmployees.SelectedItem.Text);
//补卡时间
DateTime time = DateTime.ParseExact(this.txtCheckDate.Text, "yyyy-MM-dd", null);
time = time.AddHours(int.Parse(this.txtCheckHour.Text));
time = time.AddMinutes(int.Parse(this.txtCheckMinute.Text));
oEl.SetAttribute("CheckTime", time.ToString("yyyy-MM-dd HH:mm"));
//原因
oEl.SetAttribute("Purpose", this.txtPurpose.Text);
//本月已补次数
oEl.SetAttribute("Times", this.txtTimes.Text);
//补卡类型
oEl.SetAttribute("CheckType", this.drpCheckType.SelectedItem.Text);

oE.AppendChild(oEl);


oXml.XmlString = oDoc.InnerXml;
oDoc = null;
//更新显示申请人列表
//this.LoadCheckItems();

3.显示列表数据:

XmlDocument oDoc = new XmlDocument();
oDoc.LoadXml(this.Process.GetXmlObject("Common").XmlString);
XmlNode nItems = oDoc.SelectSingleNode("Common/Form/Items");
string timesXml = nItems.OuterXml;
oDoc = null;

DataSet ds = new DataSet(“”);
Captaris.Workflow.Xml.DataSetXmlAdapter oA = new Captaris.Workflow.Xml.DataSetXmlAdapter(ds);
oA.ReadXml(xml);

//将数据集绑定到GridView

this.grdTimes.DataSource = ds;
this.grdTimes.DataBind();

4.移除一行:

private void RemoveCheckItem(int i)
{
    Teamplate.BLL.IModelXML oXml = this.Process.GetXmlObject("Common");
    XmlDocument oDoc = new XmlDocument();
    oDoc.LoadXml(oXml.XmlString);
    XmlNode nItems = oDoc.SelectSingleNode("Common/Form/Items");
    string timesXml = nItems.OuterXml;

    DataSet ds = new DataSet();
    Captaris.Workflow.Xml.DataSetXmlAdapter oA = new Captaris.Workflow.Xml.DataSetXmlAdapter(ds);
    oA.ReadXml(timesXml);

    if (ds.Tables.Count < 1)
    {
        ds = null;
        return;
    }

    ds.Tables[0].Rows[i].Delete();
    ds.Tables[0].AcceptChanges();
    //System.IO.StringWriter writer = new System.IO.StringWriter();
    //ds.Tables[0].WriteXml(writer);

    //nItems.InnerXml = writer.ToString();
    nItems.InnerXml = "";
    this.NewCheckItem(oDoc, ds.Tables[0]);
    oXml.XmlString = oDoc.OuterXml;
    //writer.Close();
    oDoc = null;
}

我觉得上面的代码太多了,为了节省您的脑细胞,我对XML操作封装成一个类,可以在此下载它。