private async void Delete(IList <long> idArray) { btnDelete.Enabled = false; var ss = idArray.JoinSome(); if (Commons.ShowConfirmBox(this, "删除以下借款机构:" + ss + " 此操作不可恢复!确认吗?")) { string suc = ""; foreach (var id in idArray) { var p = await PrjBorOrgs.Delete(id); if (p.IsOk) { suc += id + ","; myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "bpmoId"); } else { Commons.ShowResultErrorBox(this, p); } } if (suc != "") { Commons.ShowInfoBox(this, "借款机构:" + suc.TrimEnd(',') + " 已被删除。"); } } btnDelete.Enabled = true; }
private async void SaveData() { btnOk.Enabled = false; try { var r = new Dictionary <string, object>(); r["bbo-id"] = m_bboId; //机构信息 r["org-name"] = tbName.Text.Trim(); r["show-org-name"] = tbShowName.Text.Trim(); r["registered-fund"] = tbRegFunds.Text.Trim(); r["registered-show-fund"] = tbShowRegFunds.Text.Trim(); r["registered-date"] = dtpRegisterDate.Value; r["address"] = tbAddress.Text.Trim(); r["show-address"] = tbShowAddress.Text.Trim(); r["social-credit-code"] = tbSocialCreditCode.Text.Trim(); r["show-social-credit-code"] = tbShowSocialCreditCode.Text.Trim(); //法人信息 r["legal-person-name"] = tbLawName.Text.Trim(); r["legal-person-show-name"] = tbShowLawName.Text.Trim(); r["legal-id-card"] = tbLawIdCard.Text.Trim(); r["mobile"] = tbLawMobile.Text.Trim(); r["email"] = tbLawEmail.Text.Trim(); r["fax"] = tbLawFax.Text.Trim(); r["wchat"] = tbLawWechat.Text.Trim(); //联系人信息 r["linkman-name"] = tbLinkManName.Text.Trim(); r["linkman-show-name"] = tbShowLinkManName.Text.Trim(); r["linkman-id-card"] = tbLinkManIdCard.Text.Trim(); r["linkman-mobile"] = tbLinkManMobile.Text.Trim(); r["linkman-email"] = tbLinkManEmail.Text.Trim(); r["linkman-wchat"] = tbLinkManWeChat.Text.Trim(); r["linkman-address"] = tbLinkManAddress.Text.Trim(); r["linkman-show-address"] = tbShowLinkManAddress.Text.Trim(); r["linkman-fax"] = tbLinkManFax.Text.Trim(); //介绍 r["intro"] = tbIntro.Text.Trim(); IResult p; if (m_bboId == 0) { p = await PrjBorOrgs.Create(r); } else { p = await PrjBorOrgs.Update(r); } if (p.IsOk) { DlgResult = p; DialogResult = DialogResult.OK; } else { Commons.ShowResultErrorBox(this, p); } } finally { btnOk.Enabled = true; } }
private async void UpdateData() { var r = await PrjBorOrgs.GetOrg(m_bboId); if (r.IsOk) { var d = r.AsDictionary; //机构信息 tbName.Text = d.GetOrDefault <string>("orgName"); tbShowName.Text = d.GetOrDefault <string>("showOrgName"); dtpRegisterDate.Value = Commons.FromTimestamp(d.GetOrDefault <long>("registeredDate")); tbRegFunds.Text = d.GetOrDefault <string>("registeredFund"); tbShowRegFunds.Text = d.GetOrDefault <string>("registeredShowFund"); tbAddress.Text = d.GetOrDefault <string>("address"); tbShowAddress.Text = d.GetOrDefault <string>("showAddress"); tbSocialCreditCode.Text = d.GetOrDefault <string>("socialCreditCode"); tbShowSocialCreditCode.Text = d.GetOrDefault <string>("showSocialCreditCode"); cbbIndustry.Text = d.GetOrDefault <string>("industry"); tbWorkAddress.Text = d.GetOrDefault <string>("workAddress"); tbShowWorkAddress.Text = d.GetOrDefault <string>("showWorkAddress"); tbShareholderInfo.Text = d.GetOrDefault <string>("shareholderInfo"); tbShowShareholderInfo.Text = d.GetOrDefault <string>("showShareholderInfo"); tbOperateArea.Text = d.GetOrDefault <string>("operateArea"); tbOtherInfo.Text = d.GetOrDefault <string>("otherInfo"); //法人信息 tbLawName.Text = d.GetOrDefault <string>("legalPersonName"); tbShowLawName.Text = d.GetOrDefault <string>("legalPersonShowName"); tbLawIdCard.Text = d.GetOrDefault <string>("legalIdCard"); tbLawMobile.Text = d.GetOrDefault <string>("mobile"); tbLawEmail.Text = d.GetOrDefault <string>("email"); tbLawFax.Text = d.GetOrDefault <string>("fax"); tbLawWechat.Text = d.GetOrDefault <string>("wchat"); //联系人信息 tbLinkManName.Text = d.GetOrDefault <string>("linkmanName"); tbShowLinkManName.Text = d.GetOrDefault <string>("linkmanShowName"); tbLinkManIdCard.Text = d.GetOrDefault <string>("linkmanIdCard"); tbLinkManMobile.Text = d.GetOrDefault <string>("linkmanMobile"); tbLinkManEmail.Text = d.GetOrDefault <string>("linkmanEmail"); tbLinkManWeChat.Text = d.GetOrDefault <string>("linkmanWchat"); tbLinkManAddress.Text = d.GetOrDefault <string>("linkmanAddress"); tbShowLinkManAddress.Text = d.GetOrDefault <string>("linkmanShowAddress"); tbLinkManFax.Text = d.GetOrDefault <string>("linkmanFax"); //介绍 tbIntro.Text = d.GetOrDefault <string>("intro"); } else { Commons.ShowResultErrorBox(this, r); } }
private async void UpdateTable1() { btnSearch.Enabled = false; var p = new Dictionary <string, object>(); p["start-time"] = startDate.Value.TruncToStart(); p["end-time"] = endDate.Value.TruncToEnd(); p["key"] = tbKey.Text.Trim(); var r = await PrjBorOrgs.GetOrgs(p); if (r.IsOk) { this.myGridViewBinding1.BindTo(r); } else { Commons.ShowResultErrorBox(this, r); } btnSearch.Enabled = true; }
private async void UpdateData() { btnSearch.Enabled = false; listView1.Items.Clear(); var p = new Dictionary <string, object>(); p["key"] = tbKey.Text.Trim(); var r = await PrjBorOrgs.GetOrgs(p); if (r.IsOk) { var dl = JArray.Parse(r.AsString).ToList(); foreach (var d in dl) { var lvi = new ListViewItem(); lvi.Text = d["bpmoId"].ToStdString(); if (SelMgrId.ToString() == lvi.Text) { lvi.Checked = true; } lvi.SubItems.Add(d["orgName"].ToStdString()); lvi.SubItems.Add(d["legalPersonName"].ToStdString()); lvi.SubItems.Add(d["address"].ToStdString()); lvi.SubItems.Add(d["registeredShowFund"].ToStdString()); listView1.Items.Add(lvi); } m_maxRow = listView1.Items.Count; } else { Commons.ShowResultErrorBox(this, r); } if (listView1.CheckedItems.Count == 0) { SelMgrId = -1; } btnSearch.Enabled = true; }