Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            BAL.DP_Form Land = new BAL.DP_Form();

            decimal flBalance = 0;

            string strNumber = "";

            flBalance = Convert.ToDecimal(Land.GetDataTable(IDText.Text.ToString()).Rows[0][1]);

            strNumber = Convert.ToString(Land.GetDataTable(IDText.Text.ToString()).Rows[0][0]);

            if (flBalance >= 5)
            {
                if (Land.UpdataSQL_Land(RowIndex + 1, strNumber, NameText.Text.ToString(), IDText.Text.ToString(), flBalance) == true)
                {
                    MessageBox.Show("成功");

                    charg ChargForm = (charg)this.Owner;

                    ChargForm.SourceBind(RowIndex);

                    ChargForm.SettingTime();
                }
                else
                {
                    MessageBox.Show("不成功");
                }
            }
            else
            {
                if (flBalance <= 0)
                {
                    MessageBox.Show("余额剩余为 0" + "元,请及时充值");
                }
                else
                {
                    MessageBox.Show("余额剩余不到 " + flBalance + "元,请及时充值");
                    if (Land.UpdataSQL_Land(RowIndex + 1, strNumber, NameText.Text.ToString(), IDText.Text.ToString(), flBalance) == true)
                    {
                        MessageBox.Show("成功");

                        charg ChargForm = (charg)this.Owner;

                        ChargForm.SourceBind(RowIndex);

                        ChargForm.SettingTime();
                    }
                    else
                    {
                        MessageBox.Show("不成功");
                    }
                }
            }
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            charg charg = new charg();

            charg.Show();
        }