private async void UpdateTable1() { btnSearch.Enabled = false; var dateType = cbDateType.ComboBox.GetSelectedValue(); var keyType = cbKeyType.ComboBox.GetSelectedValue(); var p = new Dictionary <string, object>(); switch (dateType) { case "1": p["start-create-time"] = startDate.Value.TruncToStart(); p["end-create-time"] = endDate.Value.TruncToEnd(); break; case "2": p["start-update-time"] = startDate.Value.TruncToStart(); p["end-update-time"] = endDate.Value.TruncToEnd(); break; } switch (keyType) { case "1": p["real-name"] = tbKey.Text.Trim(); break; case "2": p["mobile"] = tbKey.Text.Trim(); break; case "3": p["company"] = tbKey.Text.Trim(); break; case "4": p["creator"] = tbKey.Text.Trim(); break; case "5": p["updater"] = tbKey.Text.Trim(); break; } var r = await PrjBorPersons.GetAll(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["real-name"] = tbKey.Text.Trim(); var r = await PrjBorPersons.GetAll(p); if (r.IsOk) { var dl = JArray.Parse(r.AsString).ToList(); foreach (var d in dl) { ListViewItem lvi = new ListViewItem(); lvi.Text = d["bpmpId"].ToStdString(); if (SelMgrId.ToString() == lvi.Text) { lvi.Checked = true; } lvi.SubItems.Add(d["realName"].ToStdString()); lvi.SubItems.Add(d["qualification"].ToStdString()); lvi.SubItems.Add(d["mobile"].ToStdString()); lvi.SubItems.Add(d["company"].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; }