public void RetriveTaskConfigInfo(ThematicTaskStatus to) { DataTable dt = DataBaseUtility.DataSelect("select * from TASK_ORDER where TASK_ORDER_ID='" + to.ThematicId + "'"); List <ThematicOrder> thematicOrderList = new List <ThematicOrder>(); if (dt == null) { MessageBox.Show("查询未返回结果,请检查数据库!"); return; } foreach (DataRow row in dt.Rows) { ThematicOrder order = new ThematicOrder(); order.Orderid = row["TASK_ORDER_ID"].ToString(); order.ProductName = row["PRODUCT_NAME"].ToString(); order.EnglishName = row["ENGLISH_NAME"].ToString(); order.OrderDate = row["CREATE_DATE"].ToString(); order.ProductType = row["PRODUCT_TYPE"].ToString(); order.StartDate = row["START_DATE"].ToString(); order.EndDate = row["END_DATE"].ToString(); order.CoverScope = row["LEFT_TOP_LON"].ToString() + "," + row["LEFT_TOP_LAT"].ToString() + "," + row["RIGHT_BOTTOM_LON"].ToString() + "," + row["RIGHT_BOTTOM_LAT"].ToString(); thematicOrderList.Add(order); } tb_detailedOrderId.Text = thematicOrderList[0].Orderid; cb_detailedProductName.Text = thematicOrderList[0].ProductName; this.productName = thematicOrderList[0].ProductName; cb_detailedProductType.Text = thematicOrderList[0].ProductType; tb_detailedEnglishName.Text = thematicOrderList[0].EnglishName; dtp_detailedStartDate.Text = thematicOrderList[0].StartDate; dtp_DetailedEndDate.Text = thematicOrderList[0].EndDate; tb_detailedCoverrage.Text = thematicOrderList[0].CoverScope; getDataInNeed(to); }
public List <ThematicOrder> retriveThematicOrder(string xmlstring) { if (xmlstring == null) { return(null); } XmlDocument xmldoc = new XmlDocument(); xmldoc.LoadXml(xmlstring); XmlNodeList xmlNodeList = xmldoc.SelectNodes("/root/responseparam/order"); List <ThematicOrder> thematicOrderList = new List <ThematicOrder>(); foreach (XmlNode xxNode in xmlNodeList) { ThematicOrder to = new ThematicOrder(); to.Orderid = xxNode.SelectSingleNode("orderid").InnerText; to.ProductType = xxNode.SelectSingleNode("producttype").InnerText; to.ProductName = xxNode.SelectSingleNode("productname").InnerText; to.Industry = xxNode.SelectSingleNode("industry").InnerText; to.EnglishName = xxNode.SelectSingleNode("englishname").InnerText; to.StartDate = xxNode.SelectSingleNode("startdate").InnerText; to.EndDate = xxNode.SelectSingleNode("enddate").InnerText; to.OrderDate = xxNode.SelectSingleNode("orderdate").InnerText; to.CoverScope = xxNode.SelectSingleNode("coverscope").InnerText; to.Status = OrderStatus.等待数据; thematicOrderList.Add(to); } return(thematicOrderList); }
private void bt_getDataRequest_Click(object sender, EventArgs e) { if (cb_detailedProductName.Text.Length == 0) { MessageBox.Show("请先输入订单信息"); return; } if (this.thematicOrder != null && this.tb_detailedOrderId.TextLength != 0) { return; } ThematicOrder to = new ThematicOrder(); //TODO:生成orderID to.Orderid = ""; to.ProductName = cb_detailedProductName.Text; to.ProductType = cb_detailedProductType.Text; to.EnglishName = tb_detailedEnglishName.Text; to.Industry = cb_detailedProductType.Text; to.StartDate = dtp_detailedStartDate.Value.ToString("yyyy-MM-dd"); to.EndDate = dtp_DetailedEndDate.Value.ToString("yyyy-MM-dd"); to.CoverScope = tb_detailedCoverrage.Text; to.Status = OrderStatus.等待生产队列; to.OrderDate = DateTime.Now.ToString("yyyy-MM-dd"); to.IsLocalOrder = true; this.thematicOrder = to; getDataInNeed(to); }
private void bt_addToTaskQueue_Click(object sender, EventArgs e) { if (this.thematicOrder == null && cb_detailedProductName.Text.Length == 0) { MessageBox.Show("请确定是否已选中订单,或已输入本订单并已解析订单数据需求"); return; } if (cb_detailedProductName.Text.Length == 0) { MessageBox.Show("请先解析订单或填写本地订单信息"); return; } if (this.commonInNeedList.Count == 0) { MessageBox.Show("请先解析订单或查看本地订单的数据需求"); return; } if (this.thematicOrder == null) { ThematicOrder to = new ThematicOrder(); //TODO:生成orderID to.Orderid = ""; to.ProductName = cb_detailedProductName.Text; to.ProductType = cb_detailedProductType.Text; to.EnglishName = tb_detailedEnglishName.Text; to.Industry = cb_detailedProductType.Text; to.StartDate = dtp_detailedStartDate.Value.ToString("yyyy-MM-dd"); to.EndDate = dtp_DetailedEndDate.Value.ToString("yyyy-MM-dd"); to.Status = OrderStatus.等待生产队列; to.OrderDate = DateTime.Now.ToString("yyyy-MM-dd"); to.IsInDataBase = true; to.IsLocalOrder = true; this.thematicOrder = to; } else { this.thematicOrder.Status = OrderStatus.等待生产队列; } //TODO: if (this.thematicOrder.IsLocalOrder == false) { ThematicOrderStateFeedBack tosfb = new ThematicOrderStateFeedBack(); string result = tosfb.FeedBackThematicOrder(this.thematicOrder, this.thematicOrder.Status.ToString()); MessageBox.Show(result); } else { ThematicOrderRegister tor = new ThematicOrderRegister(); string result = tor.RegistThematicOrder(this.thematicOrder); string orderid = xmlUtility.GetOrderIdForLocalOrder(result); MessageBox.Show("注册成功,OrderId为" + orderid); } TaskQueue taskQueue = new TaskQueue(this.thematicOrder, this.commonInNeedList, this.assistInNeedList); }
public void RetriveOrder(ThematicOrder to) { //this.thematicOrder = new ThematicOrder(); this.thematicOrder = to; tb_detailedOrderId.Text = to.Orderid; cb_detailedProductName.Text = to.ProductName; cb_detailedProductType.Text = to.ProductType; tb_detailedEnglishName.Text = to.EnglishName; dtp_detailedStartDate.Text = to.StartDate; dtp_DetailedEndDate.Text = to.EndDate; tb_detailedCoverrage.Text = to.CoverScope; getDataInNeed(to); }
private void bt_addLocalThematicOrder_Click(object sender, EventArgs e) { this.thematicOrder = null; tb_detailedOrderId.Clear(); cb_detailedProductName.Enabled = true; cb_detailedProductName.Text = ""; cb_detailedProductType.Enabled = true; cb_detailedProductType.Text = "生态环境"; tb_detailedEnglishName.ReadOnly = false; tb_detailedEnglishName.Clear(); dtp_DetailedEndDate.Enabled = true; dtp_detailedStartDate.Enabled = true; tb_detailedCoverrage.ReadOnly = false; tb_detailedCoverrage.Clear(); }
private void getDataInNeed(ThematicOrder to) { ProductDataMap pdm = new ProductDataMap(); List <string> commonInNeed = pdm.GetCommonInNeed(to); List <string> assistInNeed = pdm.GetAssistInNeed(to); List <CommonOrder> commonListTmp = new List <CommonOrder>(); List <AssistData> assistListTmp = new List <AssistData>(); this.commonOrderList = new List <CommonOrder>(); foreach (string name in commonInNeed) { CommonOrder co = new CommonOrder(); co.ProductName = name; co.CoverScope = to.CoverScope; co.StartDate = to.StartDate; co.EndDate = to.EndDate;
private void getDataInNeed(ThematicOrder to) { ProductDataMap pdm = new ProductDataMap(); List <string> commonInNeed = pdm.GetCommonInNeed(to); List <string> assistInNeed = pdm.GetAssistInNeed(to); List <CommonOrder> commonListTmp = new List <CommonOrder>(); List <AssistData> assistListTmp = new List <AssistData>(); this.commonOrderList = new List <CommonOrder>(); foreach (string name in commonInNeed) { CommonOrder co = new CommonOrder(); co.ProductName = name; co.CoverScope = to.CoverScope; co.StartDate = to.StartDate; co.EndDate = to.EndDate; co.EnglishName = dataNameMap.GetCommonEnglishName(co.ProductName);; co.ProductType = dataNameMap.GetCommonCategory(co.ProductName);; //TODO:查找数据库,找出该数据是否在库 co.IsInDataBase = false; commonListTmp.Add(co); if (co.IsInDataBase == false) { co.Status = OrderStatus.等待生产队列.ToString(); commonOrderList.Add(co); } } this.commonInNeedList = commonListTmp; dgv_commonProductInNeed.DataSource = commonInNeedList; foreach (string name in assistInNeed) { AssistData ad = new AssistData(); ad.ProductName = name; ad.CoverScope = to.CoverScope; ad.StartDate = to.StartDate; ad.EndDate = to.EndDate; //TODO:查找数据库,找出该数据是否在库 ad.IsInDataBase = false; ad.ProductType = ""; ad.EnglishName = ""; assistListTmp.Add(ad); } dgv_assistDataInNeed.DataSource = assistInNeedList; }
public string RegistThematicOrder(ThematicOrder to) { string paramXml = "<?xml version='1.0' encoding='UTF-8'?><root><condition>"; paramXml += "<producttype>" + to.ProductType + "</producttype>"; paramXml += "<productname>" + to.ProductName + "</productname>"; paramXml += "<englishname>" + to.EnglishName + "</englishname>"; paramXml += "<industry>" + to.Industry + "</industry>"; paramXml += "<coverscope>" + to.CoverScope + "</coverscope>"; paramXml += "<startdate>" + to.StartDate + "</startdate>"; paramXml += "<enddate>" + to.EndDate + "</enddate>"; paramXml += "</condition></root>"; TPOrderRegisterService.TPOrderRegisterClient tor = new TPOrderRegisterService.TPOrderRegisterClient(); result = tor.thematicProductOrderRegister(paramXml); return(result); }
public string FeedBackThematicOrder(ThematicOrder to, string status) { try{ string paramXml = "<?xml version='1.0' encoding='UTF-8'?><root><condition>"; paramXml += "<orderid>" + to.Orderid + "</orderid>"; paramXml += "<username>" + "生态环境系统" + "</username>"; paramXml += "<content>" + status + "</content>"; //paramXml += "<content>" + "数据准备中" + "</content>"; paramXml += "<time>" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "</time>"; paramXml += "</condition></root>"; TPStateFeedbackService.TPStateFeedbackClient tpsfb = new TPStateFeedbackService.TPStateFeedbackClient(); result = tpsfb.thematicProductStateFeedback(paramXml); return(result); } catch (System.ServiceModel.EndpointNotFoundException e) { System.Windows.Forms.MessageBox.Show("请检查网络情况!"); return(null); } }
private void bt_OrderRetrive_Click(object sender, EventArgs e) { if (dgv_thematicOrder.SelectedRows.Count == 0) { MessageBox.Show("请先选中欲解析的订单"); } if (dgv_thematicOrder.SelectedRows.Count == 1) { DataGridViewRow dgvr = dgv_thematicOrder.SelectedRows[0]; ThematicOrder to = (ThematicOrder)dgvr.DataBoundItem; this.thematicOrder = new ThematicOrder(); this.thematicOrder = to; tb_detailedOrderId.Text = to.Orderid; cb_detailedProductName.Text = to.ProductName; cb_detailedProductType.Text = to.ProductType; tb_detailedEnglishName.Text = to.EnglishName; dtp_detailedStartDate.Text = to.StartDate; dtp_DetailedEndDate.Text = to.EndDate; tb_detailedCoverrage.Text = to.CoverScope; getDataInNeed(to); } }