private void btnBatchImport_Click(object sender, EventArgs e) { var dlg = new ImportWizardDlg(new List <Tuple <string, CellType, bool> >() { ImportWizardDlg.MakeColumn("登录名", CellType.Text, true), ImportWizardDlg.MakeColumn("手机号码", CellType.Mobile, true) }); dlg.StartPosition = FormStartPosition.CenterParent; dlg.RunSingle += (index, gridView) => { var d = new Dictionary <string, object>(); d["pid"] = m_pId; d["login-name"] = gridView.Rows[index].Cells[0].Value.TrimStr(); d["mobile"] = gridView.Rows[index].Cells[1].Value.TrimStr(); var p = Projects.AddAllowInvest(d).Result; if (p.IsOk) { myGridViewBinding1.BindTo(p, Commons.BindFlag.Update, "auId"); } return(p); }; dlg.ShowDialog(this); }
private async void SaveData() { btnOk.Enabled = false; var r = new Dictionary <string, object>(); r["pid"] = m_pId; r["login-name"] = tbLoginName.Text.Trim(); r["mobile"] = tbMobile.Text.Trim(); var p = await Projects.AddAllowInvest(r); if (p.IsOk) { DlgResult = p; DialogResult = DialogResult.OK; } else { Commons.ShowResultErrorBox(this, p); } btnOk.Enabled = true; }