Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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();
            }
        }
Ejemplo n.º 4
0
        private void button3_Click(object sender, EventArgs e)     //修改订单
        {
            try
            {
                ChangeOrder changeOrder = new ChangeOrder();

                changeOrder.ShowDialog();
                if (changeOrder.OK)
                {
                    OrderService.list[changeOrder.Num - 1].OrderQuantity = changeOrder.cOrder.OrderQuantity;
                    OrderService.list[changeOrder.Num - 1].ProductName   = changeOrder.cOrder.ProductName;
                    OrderService.list[changeOrder.Num - 1].Client        = changeOrder.cOrder.Client;
                    //_orderService.AddOrder(changeOrder.cOrder);
                }
            }catch (Exception ex)
            {
                ErrorScene errorScene = new ErrorScene();
                errorScene.ShowDialog();
            }
            //if (!this.textBox2.Text.Equals("输入有误!!!"))
            //{
            //    NewOrder newOrder = new NewOrder();
            //    newOrder.ShowDialog();
            //    OrderService.list[_number - 1].OrderQuantity = newOrder.od.OrderQuantity;
            //    OrderService.list[_number - 1].ProductName = newOrder.od.ProductName;
            //}
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         OK     = true;
         Num    = int.Parse(this.textBox1.Text);
         cOrder = new OrderDetatils
         {
             OrderNumber   = Order.NumToString(Num),
             OrderQuantity = int.Parse(this.textBox2.Text),
             ProductName   = this.textBox3.Text,
             Client        = this.textBox4.Text
         };
     }
     catch (Exception ex)
     {
         ErrorScene errorScene = new ErrorScene();
         errorScene.ShowDialog();
     }
 }
Ejemplo n.º 7
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         od.OrderQuantity = int.Parse(this.textBox1.Text);
         od.ProductName   = (this.textBox1.Text);
         od.Client        = (this.textBox1.Text);
         OK = true;
         this.button1.Text = "操作成功";
         for (int i = 3; i > 0; i--)
         {
             Thread.Sleep(1000);
             this.button1.Text = "此页面将在" + i + "秒钟关闭";
         }
         this.Close();
     }
     catch (Exception ex)
     {
         ErrorScene errorScene = new ErrorScene();
         errorScene.ShowDialog();
     }
 }
Ejemplo n.º 8
0
        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();
            }
        }