예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         long  phoneNum = Convert.ToInt64(this.textBox6.Text);
         long  orderNum = Convert.ToInt64(this.textBox1.Text);
         Order order    = OrderService.InquiryOrder(orderNum);
         if (!(this.textBox2.Text == ""))
         {
             //检查订单号是否重复
             foreach (Order od in OrderService.allOrders)
             {
                 if (od.OrderNum == Convert.ToInt64(textBox2.Text))
                 {
                     MessageBox.Show("订单号重复!");
                     return;
                 }
             }
             order.OrderNum = Convert.ToInt64(textBox2.Text);
         }
         if (!(this.textBox3.Text == ""))
         {
             order.GoodName = textBox3.Text;
         }
         if (!(this.textBox4.Text == ""))
         {
             order.Client = textBox4.Text;
         }
         if (!(this.textBox5.Text == ""))
         {
             order.OrderSum = Convert.ToDouble(textBox5.Text);
         }
         if (this.textBox2.Text == "" & this.textBox3.Text == "" & this.textBox4.Text == "" & this.textBox5.Text == "" & this.textBox6.Text == "")
         {
             MessageBox.Show("您未修改任何内容!");
         }
         if (Form2.judgePhonenumber(phoneNum))
         {
             order.PhoneNum = Convert.ToInt64(textBox6.Text);
             Form1.form1.comboBox1.DataSource    = null;
             Form1.form1.comboBox1.DataSource    = OrderService.allOrders;
             Form1.form1.comboBox1.DisplayMember = "OrderNum";
             Form1.form1.comboBox1.SelectedIndex = 0;
             this.Close();
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("没有找到此订单或您修改的内容有误!");
     }
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.textBox1.Text == "")
         {
             if (this.textBox2.Text == "")
             {
                 if (this.textBox3.Text == "")
                 {
                     MessageBox.Show("请输入要查询的条件!");
                 }
                 else
                 {
                     string client = this.textBox3.Text;
                     Order  order  = OrderService.InquiryOrder_(client);
                     string str    = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}", order.OrderNum, order.GoodName,
                                                   order.Client, order.OrderSum);
                     MessageBox.Show(str);
                 }
             }
             else
             {
                 string goodName = this.textBox2.Text;
                 Order  order    = OrderService.InquiryOrder(goodName);
                 string str      = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}", order.OrderNum, order.GoodName,
                                                 order.Client, order.OrderSum);
                 MessageBox.Show(str);
             }
         }
         else
         {
             int    orderNum = Convert.ToInt32(this.textBox1.Text);
             Order  order    = OrderService.InquiryOrder(orderNum);
             string str      = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}", order.OrderNum, order.GoodName,
                                             order.Client, order.OrderSum);
             MessageBox.Show(str);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("没有查到此订单!");
     }
 }
예제 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.comboBox1.SelectedItem.ToString() == "")
         {
             if (this.textBox2.Text == "")
             {
                 if (this.textBox3.Text == "")
                 {
                     MessageBox.Show("请输入要查询的条件!");
                 }
                 else
                 {
                     string client = this.textBox3.Text;
                     Order  order  = OrderService.InquiryOrder_(client);
                     string str    = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}   电话号码:{4}", order.OrderNum, order.GoodName,
                                                   order.Client, order.OrderSum, order.PhoneNum);
                     MessageBox.Show(str);
                 }
             }
             else
             {
                 string goodName = this.textBox2.Text;
                 Order  order    = OrderService.InquiryOrder(goodName);
                 string str      = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}   电话号码:{4}", order.OrderNum, order.GoodName,
                                                 order.Client, order.OrderSum, order.PhoneNum);
                 MessageBox.Show(str);
             }
         }
         else
         {
             long   orderNum = Int64.Parse(this.comboBox1.SelectedItem.ToString());
             Order  order    = OrderService.InquiryOrder(orderNum);
             string str      = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}   电话号码:{4}", order.OrderNum, order.GoodName,
                                             order.Client, order.OrderSum, order.PhoneNum);
             MessageBox.Show(str);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("没有查到此订单!");
     }
 }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int   orderNum = Convert.ToInt32(this.textBox1.Text);
                Order order    = OrderService.InquiryOrder(orderNum);


                if (!(this.textBox2.Text == ""))
                {
                    //检查订单号是否重复
                    foreach (Order temp in OrderService.allOrders)
                    {
                        if (temp.OrderNum == Convert.ToInt32(textBox2.Text))
                        {
                            MessageBox.Show("订单号重复!");
                            return;
                        }
                    }
                    order.OrderNum = Convert.ToInt32(textBox2.Text);
                }
                if (!(this.textBox3.Text == ""))
                {
                    order.GoodName = textBox3.Text;
                }
                if (!(this.textBox4.Text == ""))
                {
                    order.Client = textBox4.Text;
                }
                if (!(this.textBox5.Text == ""))
                {
                    order.OrderSum = Convert.ToDouble(textBox5.Text);
                }
                if (!(this.numericUpDown1.Text == ""))
                {
                    phoneNum = Convert.ToInt64(this.numericUpDown1.Text);
                    if (phoneNum < 10000000000)
                    {
                        MessageBox.Show("请输入正确的11位手机号码!");
                        return;
                    }
                    order.PhoneNum = Convert.ToInt64(numericUpDown1.Text);
                }



                if (this.textBox2.Text == "" & this.textBox3.Text == "" & this.textBox4.Text == "" & this.textBox5.Text == "")
                {
                    MessageBox.Show("您未修改任何内容!");
                }
                else
                {
                    Form1.form1.comboBox1.DataSource    = null;
                    Form1.form1.comboBox1.DataSource    = OrderService.allOrders;
                    Form1.form1.comboBox1.DisplayMember = "OrderNum";
                    Form1.form1.comboBox1.SelectedIndex = 0;
                    this.Close();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("没有找到此订单或您修改的内容有误!");
            }
        }
예제 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int   orderNum = Convert.ToInt32(this.textBox1.Text);
                Order order    = OrderService.InquiryOrder(orderNum);
                Order order2   = new Order(order.OrderNum, order.GoodName, order.Client, order.OrderSum);

                if (!(this.textBox2.Text == ""))
                {
                    order.OrderNum = Convert.ToInt32(textBox2.Text);
                }
                if (!(this.textBox3.Text == ""))
                {
                    order.GoodName = textBox3.Text;
                }
                if (!(this.textBox4.Text == ""))
                {
                    order.Client = textBox4.Text;
                }
                if (!(this.textBox5.Text == ""))
                {
                    order.OrderSum = Convert.ToDouble(textBox5.Text);
                }



                if (this.textBox2.Text == "" & this.textBox3.Text == "" & this.textBox4.Text == "" & this.textBox5.Text == "")
                {
                    MessageBox.Show("您未修改任何内容!");
                }
                else
                {
                    this.Close();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("没有找到此订单或您修改的内容有误!");
            }


            //while (count <10)
            //{
            //    if (this.textBox2.Text == "")
            //    {
            //        if (this.textBox3.Text == "")
            //        {
            //            if (this.textBox4.Text == "")
            //            {
            //                if (this.textBox5.Text == "")
            //                {
            //                    MessageBox.Show("您未修改任何内容!");
            //                    break;
            //                }
            //                else
            //                {
            //                    order.OrderSum = Convert.ToDouble(textBox5.Text);
            //                }
            //            }
            //            else
            //            {
            //                order.Client = textBox4.Text;
            //                break;
            //            }
            //        }
            //        else
            //        {
            //            order.GoodName = textBox3.Text;
            //        }
            //    }
            //    else
            //    {
            //        order.OrderNum = Convert.ToInt32(textBox2.Text);
            //    }

            //    count++;
            //}
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int   orderNum = Convert.ToInt32(this.textBox1.Text);
                Order order    = OrderService.InquiryOrder(orderNum);
                Order order2   = new Order(order.OrderNum, order.GoodName, order.Client, order.OrderSum);

                if (!(this.textBox2.Text == ""))
                {
                    order.OrderNum = Convert.ToInt32(textBox2.Text);
                }
                if (!(this.textBox3.Text == ""))
                {
                    order.GoodName = textBox3.Text;
                }
                if (!(this.textBox4.Text == ""))
                {
                    order.Client = textBox4.Text;
                }
                if (!(this.textBox5.Text == ""))
                {
                    order.OrderSum = Convert.ToDouble(textBox5.Text);
                }



                if (this.textBox2.Text == "" & this.textBox3.Text == "" & this.textBox4.Text == "" & this.textBox5.Text == "")
                {
                    MessageBox.Show("您未修改任何内容!");
                }
                else
                {
                    string str = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}", order2.OrderNum, order2.GoodName,
                                               order2.Client, order2.OrderSum);
                    int cF = Form1.form1.comboBox1.FindString(str);
                    Form1.form1.comboBox1.Items.RemoveAt(cF);
                    str = String.Format("订单号:{0}   商品名称:{1}   客户:{2}   金额:{3}", order.OrderNum, order.GoodName,
                                        order.Client, order.OrderSum);
                    Form1.form1.comboBox1.Items.Add(str);
                    Form1.form1.comboBox1.SelectedIndex = 0;
                    this.Close();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("没有找到此订单或您修改的内容有误!");
            }


            //while (count <10)
            //{
            //    if (this.textBox2.Text == "")
            //    {
            //        if (this.textBox3.Text == "")
            //        {
            //            if (this.textBox4.Text == "")
            //            {
            //                if (this.textBox5.Text == "")
            //                {
            //                    MessageBox.Show("您未修改任何内容!");
            //                    break;
            //                }
            //                else
            //                {
            //                    order.OrderSum = Convert.ToDouble(textBox5.Text);
            //                }
            //            }
            //            else
            //            {
            //                order.Client = textBox4.Text;
            //                break;
            //            }
            //        }
            //        else
            //        {
            //            order.GoodName = textBox3.Text;
            //        }
            //    }
            //    else
            //    {
            //        order.OrderNum = Convert.ToInt32(textBox2.Text);
            //    }

            //    count++;
            //}
        }