Ejemplo n.º 1
0
 private void btn_del_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("确认删除", "确认删除?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
     {
         return;
     }
     if (GoodsMSHelper.Del_goods_by_goodsId(txt_goodsid.Text.Trim()))
     {
         MessageBox.Show("删除成功");
     }
     else
     {
         MessageBox.Show("删除失败");
     }
 }
Ejemplo n.º 2
0
        private void btn_post_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认提交?", "确认提交?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            ArrayList arr = new ArrayList();

            foreach (KeyValuePair <GoodsMenu, int> x in list)
            {
                GoodsMenu menu = x.Key;
                int       type = x.Value;
                string    cmd1 = "", cmd2 = "";
                if (type == 0)  // in
                {
                    cmd1 = GoodsMSHelper.entry_goods(menu);
                    cmd2 = GoodsMSHelper.Update_goods_number(menu.Goods, menu.Number, 0);
                }
                else if (type == 1) // out
                {
                    cmd1 = GoodsMSHelper.come_goods(menu);
                    cmd2 = GoodsMSHelper.Update_goods_number(menu.Goods, menu.Number, 1);
                }
                arr.Add(cmd1);
                arr.Add(cmd2);
            }
            if (arr.Count == 0)
            {
                MessageBox.Show("订单为空");
                return;
            }
            if (GoodsMSHelper.multy_post_menu(arr))
            {
                MessageBox.Show("操作提交成功");
                lis_menu.Items.Clear();
                list.Clear();
            }
            else
            {
                MessageBox.Show("操作提交失败");
            }
        }
Ejemplo n.º 3
0
        private void btn_select_Click(object sender, EventArgs e)
        {
            if (txt_goodsid.Text.Length == 0)
            {
                return;
            }
            Goods goods = new Goods();

            goods = GoodsMSHelper.Select_goods_by_goodsId(txt_goodsid.Text.Trim());
            if (goods != null)
            {
                txt_goodsname.Text = goods.Goods_name;
                txt_goodsSize.Text = goods.Goods_size;
                txt_GoodsUnit.Text = goods.Goods_unit;
                txt_GoodsNum.Text  = goods.Goods_num;
                txt_other.Text     = goods.Others;
            }
            else
            {
                MessageBox.Show("不存在该编号的物品");
            }
        }
Ejemplo n.º 4
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认添加", "确认添加?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            if (txt_goodsid.Text.Trim().Length == 0)
            {
                MessageBox.Show("货物代码不能为空");
                return;
            }
            if (!Checker.Check_Number(txt_GoodsNum.Text.Trim()))
            {
                MessageBox.Show("数量格式不正确");
                return;
            }
            Goods goods = new Goods();

            goods.Goods_id   = txt_goodsid.Text.Trim();
            goods.Goods_name = txt_goodsname.Text.Trim();
            goods.Goods_size = txt_goodsSize.Text.Trim();
            goods.Goods_num  = txt_GoodsNum.Text.Trim();
            goods.Goods_unit = txt_GoodsUnit.Text.Trim();
            goods.Others     = txt_other.Text.Trim();
            if (goods.Check_Msg_Complete() == false)
            {
                MessageBox.Show("输入数据不完整");
                return;
            }
            if (GoodsMSHelper.Add_Goods_Msg(goods))
            {
                MessageBox.Show("插入成功");
            }
            else
            {
                MessageBox.Show("插入失败");
            }
        }