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("数据输入有误!");
            }
        }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (GoodId != 0)
            {
                hash ^= GoodId.GetHashCode();
            }
            if (GoodNum != 0)
            {
                hash ^= GoodNum.GetHashCode();
            }
            if (IsLock != false)
            {
                hash ^= IsLock.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }