private void btnCreateBatch_Click(object sender, EventArgs e)
        {
            var dlg = new ImportWizardDlg(new List <Tuple <string, CellType, bool> >()
            {
                ImportWizardDlg.MakeColumn("登录名", CellType.Text, true),
                ImportWizardDlg.MakeColumn("姓名", CellType.Text, true),
                ImportWizardDlg.MakeColumn("金额", CellType.Text, true)
            });

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.RunSingle    += (index, gridView) => {
                var d = new Dictionary <string, object>();
                d["tbd-id"]     = m_tbdId;
                d["login-name"] = gridView.Rows[index].Cells[0].Value.TrimStr();
                d["real-name"]  = gridView.Rows[index].Cells[1].Value.TrimStr();
                d["amt"]        = gridView.Rows[index].Cells[2].Value.TrimStr();
                var p = BusinessTransfers.SaveInvestBonus(d).Result;
                if (p.IsOk)
                {
                    myGridViewBinding1.BindTo(p, Commons.BindFlag.Update, "jvpId");
                }

                return(p);
            };
            dlg.ShowDialog(this);
        }
Example #2
0
        private async void SaveData()
        {
            btnOK.Enabled = false;
            try {
                var amt = nudAmt.Value;
                if (amt <= 0)
                {
                    Commons.ShowInfoBox(this, "转帐金额必须大于0!");
                    return;
                }

                var r = new Dictionary <string, object>();
                r["tbd-id"]     = m_tbdId;
                r["login-name"] = tbLoginName.Text.Trim();
                r["real-name"]  = tbRealName.Text.Trim();
                r["amt"]        = nudAmt.Value;
                r["remark"]     = m_remark;

                var p = await BusinessTransfers.SaveInvestBonus(r);

                if (p.IsOk)
                {
                    DlgResult    = p;
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            } finally {
                btnOK.Enabled = true;
            }
        }