Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (sumtextBox.Text.Trim() == "")
            {
                MessageBox.Show("数量不能为空!");
                return;
            }
            GoodInfo gd = new GoodInfo()
            {
                Gname   = nametextBox.Text.ToString(),
                Gno     = notextBox.Text.ToString(),
                Gprice  = Convert.ToDecimal(pricetextBox.Text),
                Gbid    = Convert.ToDecimal(bidtextBox.Text.Trim() == "" ? "0" : bidtextBox.Text),
                Gremark = remarktextBox.Text.ToString(),
                Gsum    = Convert.ToInt32(sumtextBox.Text),
                Gstock  = Convert.ToInt32(sumtextBox.Text),
                Gtype   = typetextBox.Text.ToString()
            };

            if (gdbll.Add(gd))
            {
                sp._load();
                Loadevent();
                MessageBox.Show("增加成功");
                if (!checkBox1.Checked)
                {
                    this.Close();
                }
                else
                {
                    nametextBox.Text          = "";
                    bidtextBox.Text           = "";
                    typetextBox.SelectedIndex = 0;
                    pricetextBox.Text         = "";
                    sumtextBox.Text           = "";
                    remarktextBox.Text        = "";
                    GoodInfo gd1   = null;
                    string   numno = (1 + gdbll.getNumber()).ToString();
                    int      lenth = numno.Length;
                    for (int i = 0; i < (4 - lenth); i++)
                    {
                        numno = "0" + numno;
                    }
                    notextBox.Text    = numno;
                    checkBox1.Checked = true;
                }
            }
            else
            {
                MessageBox.Show("插入失败!");
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            GoodInfo gd = new GoodInfo()
            {
                Gno     = notextBox.Text.ToString(),
                Gname   = nametextBox.Text.ToString(),
                Gbid    = Convert.ToDecimal(bidtextBox.Text),
                Gprice  = Convert.ToDecimal(pricetextBox.Text),
                Gtype   = typetextBox.Text.ToString(),
                Gremark = remarktextBox.Text.ToString()
            };

            if (gdbll.Alter(gd))
            {
                sp._load();
                Loadevent();
                MessageBox.Show("修改成功!");
                this.Close();
            }
        }
Example #3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            GoodInfo gd = new GoodInfo()
            {
                Gname   = nametextBox.Text.ToString(),
                Gno     = notextBox.Text.ToString(),
                Gprice  = Convert.ToDecimal(pricetextBox.Text),
                Gbid    = Convert.ToDecimal(bidtextBox.Text),
                Gremark = remarktextBox.Text.ToString(),
                Gtype   = typetextBox.Text.ToString(),
                //目前剩余的商品数量
                Gstock = Convert.ToInt32(sumtextBox.Text),
                Gsum   = Convert.ToInt32(label9.Text.Trim())
            };

            if (gdbll.Adds(Convert.ToInt32(addtextBox.Text), gd))
            {
                sp._load();
                Loadevent();
                InHuoTJ jinhuo = new InHuoTJ()
                {
                    HuoCount    = addtextBox.Text.Trim(),
                    HuoDate     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    HuoDianName = FilterClass.DianPu1.UserName.Trim(),
                    HuoMoney    = bidtextBox.Text.Trim(),
                    HuoName     = nametextBox.Text.ToString().Trim(),
                    HuoNumber   = notextBox.Text.ToString().Trim(),
                    HuoSale     = FilterClass.DianPu1.LoginName.Trim(),
                    HuoSum      = sumtextBox.Text.Trim(),
                    HuoType     = typetextBox.Text.ToString().Trim()
                };
                tjbbbll.AddIteam(jinhuo);
                MessageBox.Show("补货成功!");
                this.Close();
            }
        }