/// <summary> /// 下载任务 /// </summary> /// <param name="stdCode">标准代码</param> /// <param name="districtCode">区域编码</param> private string DownloadTask(string TaskTemp) { string delErr = string.Empty; string err = string.Empty; StringBuilder sb = new StringBuilder(); DataSet dataSet = new DataSet(); DataTable dtbl = new DataTable(); using (StringReader sr = new StringReader(TaskTemp)) { dataSet.ReadXml(sr); } int len = 0; if (!TaskTemp.Equals("<NewDataSet>\r\n</NewDataSet>")) { if (dataSet != null) { len = dataSet.Tables[0].Rows.Count; dtbl = dataSet.Tables[0]; } //任务 clsTaskOpr bll = new clsTaskOpr(); //bll.Delete(string.Empty, out delErr); sb.Append(delErr); if (len == 0) { return(string.Empty); } clsTask Tst = new clsTask(); for (int i = 0; i < len; i++) { err = string.Empty; Tst.CPCODE = dtbl.Rows[i]["CPCODE"].ToString(); Tst.CPTITLE = dtbl.Rows[i]["CPTITLE"].ToString(); Tst.CPSDATE = dtbl.Rows[i]["CPSDATE"].ToString(); Tst.CPEDATE = dtbl.Rows[i]["CPEDATE"].ToString(); Tst.CPTPROPERTY = dtbl.Rows[i]["CPTPROPERTY"].ToString(); Tst.CPFROM = dtbl.Rows[i]["CPFROM"].ToString(); Tst.CPEDITOR = dtbl.Rows[i]["CPEDITOR"].ToString(); Tst.CPPORGID = dtbl.Rows[i]["CPPORGID"].ToString(); Tst.CPPORG = dtbl.Rows[i]["CPPORG"].ToString(); Tst.CPEDDATE = dtbl.Rows[i]["CPEDDATE"].ToString(); Tst.CPMEMO = dtbl.Rows[i]["CPMEMO"].ToString(); Tst.PLANDETAIL = dtbl.Rows[i]["PLANDETAIL"].ToString(); Tst.PLANDCOUNT = dtbl.Rows[i]["PLANDCOUNT"].ToString(); Tst.BAOJINGTIME = dtbl.Rows[i]["BAOJINGTIME"].ToString(); bll.Insert(Tst, out err); if (!err.Equals(string.Empty)) { sb.Append(err); } } if (sb.Length > 0) { return(sb.ToString()); } } return(string.Format("已经成功下载{0}条样品种类数据", len.ToString())); }
public WpfTaskFinishShow() { InitializeComponent(); _Tskbll = new clsTaskOpr(); }