Ejemplo n.º 1
0
        private async void UpdateTable1()
        {
            if (m_selUName == CrmCommons.ALL_VALUE && string.IsNullOrWhiteSpace(tbKey.Text))
            {
                Commons.ShowInfoBox(this, "请输入关键字");
                return;
            }
            btnSearch.Enabled = false;
            var dateType = cbDateTypes.ComboBox.GetSelectedValue();
            var prLevel  = cbPrLevels.ComboBox.GetSelectedValue();

            var p = new Dictionary <string, object>();

            p["u-name"] = m_selUName;
            if (dateType == "1")
            {
                p["start-date1"] = startDate.Value.TruncToStart();
                p["end-date1"]   = endDate.Value.TruncToEnd();
            }
            else
            {
                p["start-date2"] = startDate.Value.TruncToStart();
                p["end-date2"]   = endDate.Value.TruncToEnd();
            }
            if (prLevel != Commons.AllValue)
            {
                p["pr-levels"] = prLevel;
            }
            p["search-key"] = tbKey.Text.Trim();

            var r = await CrmInvestor.GetAccounts(p);

            if (r.IsOk)
            {
                this.myGridViewBinding1.BindTo(r);
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
            btnSearch.Enabled = true;
        }