Exemplo n.º 1
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            if (StringUtil.isEmpty(txtAcntNO.Text))
            {
                MessageBox.Show("请填写账户先!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            CustAcnt acnt = new CustAcnt();

            acnt.CustID   = customer.CID__PK;
            acnt.AcntNO   = txtAcntNO.Text;
            acnt.AcntType = StringUtil.Obj2Str(cboxAcntType.SelectedValue);
            string type = StringUtil.Obj2Str(cboxAcntType.SelectedValue);

            if (ACNT_TYPE.BANCK_NO == type)
            {
                acnt.Platform = null;
            }
            else if (ACNT_TYPE.THIRD_PLATFORM == type)
            {
                acnt.Platform = StringUtil.Obj2Str(cboxPlt.SelectedValue);
            }

            if (rbtnInvalid.Checked)
            {
                acnt.St = ST.INVALID;
            }
            else if (rbtnValid.Checked)
            {
                acnt.St = ST.VALID;
            }

            int exCnt = 0;

            try
            {
                if (null != id)
                {
                    acnt.ID__PK = id;
                    exCnt       = manager.UpdateAcnt(acnt);
                }
                else
                {
                    exCnt = manager.AddCustAcnt(acnt);
                }
            }
            catch
            {
                exCnt = 0;
            }

            if (exCnt > 0)
            {
                MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                uptCnt++;
            }
            else
            {
                MessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }