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 PrjOwners.Delete(id); if (p.IsOk) { suc += id + ","; myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "boId"); } else { Commons.ShowResultErrorBox(this, p); } } if (suc != "") { Commons.ShowInfoBox(this, "项目业主:" + suc.TrimEnd(',') + " 已被删除。"); } } btnDelete.Enabled = true; }
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 PrjOwners.GetOwners(p); if (r.IsOk) { this.myGridViewBinding1.BindTo(r); } else { Commons.ShowResultErrorBox(this, r); } btnSearch.Enabled = true; }
private async void SaveData() { btnOk.Enabled = false; try { var r = new Dictionary <string, object>(); r["bo-id"] = m_boId; r["owner-name"] = tbName.Text.Trim(); r["owner-show-name"] = tbShowName.Text.Trim(); r["registered-date"] = dtpRegisterDate.Value; r["reg-years"] = tbRegYear.Text.Trim(); r["reg-funds"] = tbRegFunds.Text.Trim(); r["show-reg-funds"] = tbShowRegFunds.Text.Trim(); r["ent-industry"] = cbbEntIndustry.Text.Trim(); r["owner-nature"] = cbbOwnerNature.Text.Trim(); r["owner-strength"] = cbbOwnerStrength.Text.Trim(); r["owner-quality"] = cbbOwnerQuality.Text.Trim(); r["intro"] = tbIntro.Text.LeftStr(2000); IResult p; if (m_boId == 0) { p = await PrjOwners.Create(r); } else { p = await PrjOwners.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 PrjOwners.GetOwner(m_boId); if (r.IsOk) { var d = r.AsDictionary; tbName.Text = d.GetOrDefault <string>("ownerName"); tbShowName.Text = d.GetOrDefault <string>("ownerShowName"); dtpRegisterDate.Value = Commons.FromTimestamp(d.GetOrDefault <long>("registeredDate")); tbRegYear.Text = d.GetOrDefault <string>("regYears"); tbRegFunds.Text = d.GetOrDefault <string>("regFunds"); tbShowRegFunds.Text = d.GetOrDefault <string>("showRegFunds"); cbbEntIndustry.Text = d.GetOrDefault <string>("entIndustry"); cbbOwnerNature.Text = d.GetOrDefault <string>("ownerNature"); cbbOwnerStrength.Text = d.GetOrDefault <string>("ownerStrength"); cbbOwnerQuality.Text = d.GetOrDefault <string>("ownerQuality"); tbIntro.Text = d.GetOrDefault <string>("intro"); } else { Commons.ShowResultErrorBox(this, r); } }