private async void SaveData()
        {
            var d = new Dictionary <string, object>();

            d["real-name"]  = tbUserName.Text.Trim();
            d["mobile"]     = tbMobile.Text.Trim();
            d["u-name"]     = tbUName.Text.Trim();
            d["department"] = cbbDepartment.Text;

            var p = await CrmInvestor.CreateAssignOfRegUser(d);

            if (p.IsOk)
            {
                DialogResult = DialogResult.OK;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Exemple #2
0
        private void btnBatchBind_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["real-name"] = gridView.Rows[index].Cells[0].Value.TrimStr();
                d["mobile"]    = gridView.Rows[index].Cells[1].Value.TrimStr();
                d["u-name"]    = gridView.Rows[index].Cells[2].Value.TrimStr();

                return(CrmInvestor.CreateAssignOfRegUser(d).Result);
            };

            if (dlg.ShowDialog(this) == DialogResult.Cancel)
            {
                UpdateTable();
            }
        }