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); }
private void bt_RegisterLocalThematicOrder_Click(object sender, EventArgs e) { if (this.thematicOrder != null) { ThematicOrderRegister tor = new ThematicOrderRegister(); string result = tor.RegistThematicOrder(this.thematicOrder); if (result.Contains("成功")) { XmlUtility xmlUtility = new XmlUtility(); this.thematicOrder.Orderid = xmlUtility.GetOrderIdForLocalOrder(result); tb_detailedOrderId.Text = this.thematicOrder.Orderid; MessageBox.Show("注册成功,定单ID为:" + this.thematicOrder.Orderid); //TODO:将定单写入数据库 } } else { MessageBox.Show("请首先查看数据需求!"); } }