private void button3_Click(object sender, EventArgs e) { int CountOfI = 0; for (int i = 0; i < OrderService.list.Count; i++) { int CountOfJ = 0; for (int j = i + 1; j < OrderService.list.Count; j++) { if (!OrderService.list[i].OrderNumber.Equals(OrderService.list[j].OrderNumber)) { CountOfJ++; } } if ((i + CountOfJ + 1) == OrderService.list.Count) { CountOfI++; } } if (CountOfI == OrderService.list.Count) { SucessScene sucessScene = new SucessScene(); sucessScene.ShowDialog(); } else { ErrorScene errorScene = new ErrorScene(); errorScene.ShowDialog(); } }
private void button2_Click(object sender, EventArgs e) { int Count = 0; for (int i = 0; i < OrderService.list.Count; i++) { int iOrder = OrderService.list[i].OrderQuantity; if (iOrder < 10000) { Count++; } else { ErrorOrder.Add(OrderService.list[i]); } } if (Count == OrderService.list.Count) { SucessScene sucessScene = new SucessScene(); sucessScene.ShowDialog(); } else { ErrorScene errorScene = new ErrorScene(); errorScene.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { string OrderN = "[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9]{3}"; int Count = 0; for (int i = 0; i < OrderService.list.Count; i++) { string s = OrderService.list[i].OrderNumber; if (Regex.IsMatch(s, OrderN)) { Count++; } else { ErrorOrder.Add(OrderService.list[i]); //ErrorOrder[ErrorOrder.Count-1]. } } if (Count == OrderService.list.Count) { SucessScene sucessScene = new SucessScene(); sucessScene.ShowDialog(); } else { ErrorScene errorScene = new ErrorScene(); errorScene.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { try { this.Num = int.Parse(this.textBox1.Text); this.OK = true; SucessScene sucessScene = new SucessScene(); sucessScene.ShowDialog(); //sucessScene.Shown() Thread.Sleep(1500); this.Close(); } catch (Exception ex) { ErrorScene errorScene = new ErrorScene(); errorScene.ShowDialog(); } }
private void button2_Click(object sender, EventArgs e) //生成HTML { try { /* * 生成XML文件 */ XmlSerializer serializer = new XmlSerializer(OrderService.list.GetType()); TextWriter writerXml = new StreamWriter(@".\List.xml");//, FileMode.Open,FileAccess.Write); serializer.Serialize(writerXml, OrderService.list); writerXml.Close(); /* * 依据XSLT生成HTML */ XmlDocument doc = new XmlDocument(); doc.Load(@".\List.xml"); XPathNavigator nav = doc.CreateNavigator(); nav.MoveToRoot(); XslCompiledTransform xt = new XslCompiledTransform(); xt.Load(@".\OrderXslt.xslt"); FileStream outFileStream = File.OpenWrite(@".\ListT.html"); XmlTextWriter writerHtml = new XmlTextWriter(outFileStream, System.Text.Encoding.UTF8); xt.Transform(nav, null, writerHtml); SucessScene sucess = new SucessScene(); sucess.ShowDialog(); } catch (Exception ex) { ErrorScene errorScene = new ErrorScene(); errorScene.ShowDialog(); } }