Ejemplo n.º 1
0
        private void addItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (GoodName.Text == "" || GoodPrice.Text == "")
                {
                    MessageBox.Show("请完善订单信息");
                    return;
                }
                else
                {
                    int goodnum   = int.Parse(GoodNum.Text);
                    int goodPrice = int.Parse(GoodPrice.Text);
                    int id        = int.Parse(GoodID.Text);


                    string    goodName = GoodName.Text;
                    OrderItem theItem  = new OrderItem(id, goodName, goodnum, goodPrice);

                    orderItemList.Add(theItem);
                    GoodName.Clear();
                    GoodPrice.Clear();
                    GoodNum.Clear();
                    GoodID.Clear();
                    MessageBox.Show("Item添加成功");
                }
            }
            catch (FormatException fe)
            {
                MessageBox.Show("数据输入有误!");
            }
        }
 protected bool CanExecuteModifySelectedStorageCommandDo()
 {
     if (GoodBatch.Equals("") || GoodModel.Equals("") ||
         _goodCount == 0 || GoodName.Equals(""))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     return(GoodName.GetHashCode());
 }