Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            memberInfoBLL   bll     = new memberInfoBLL();
            memberToUpModel model   = new memberToUpModel();
            bool            result  = false;
            bool            result1 = false;

            if (textBox9.Text.Trim() == "计次卡")
            {
                model.czMoney  = textBox6.Text.Trim();;
                model.czyMoney = "0";
                model.czCount  = textBox3.Text.Trim();
                model.czyCount = textBox2.Text.Trim();
            }
            else if (textBox9.Text.Trim() == "储值卡")
            {
                model.czCount  = textBox3.Text.Trim();
                model.czyCount = "0";
                model.czMoney  = textBox6.Text.Trim();
                model.czyMoney = textBox2.Text.Trim();
            }
            else if (textBox9.Text.Trim() == "折扣卡")
            {
                model.czCount  = textBox3.Text.Trim();
                model.czyCount = "0";
                model.czMoney  = textBox6.Text.Trim();
                model.czyMoney = textBox2.Text.Trim();
            }
            model.czNo      = textBox4.Text.Trim();
            model.czName    = textBox1.Text;
            model.czType    = textBox12.Text.Trim() + "-" + textBox9.Text.Trim();;
            model.czDate    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            model.czSaleman = comboBox1.Text == "" ? FilterClass.DianPu1.LoginName : comboBox1.Text;
            double m1 = Convert.ToDouble(textBox3.Text.Trim());
            double m2 = Convert.ToDouble(textBox2.Text.Trim());
            double m3 = m1 + m2;

            result  = bll.hyczMoney(textBox4.Text.Trim(), m3);
            result1 = bll1.addModel(model);
            if (result1 && result1)
            {
                MessageBox.Show("充值成功!");
                bind();
                //充值成功之后,打印小票
                PirentDocumentClass.PrintToUpMoney(model, textBox7.Text);
                this.Close();
            }
            else
            {
                MessageBox.Show("出现错误!");
            }
        }