Esempio n. 1
0
        private async void UpdateTable()
        {
            btnSearch.Enabled = false;
            var department = cbbDepartment.ComboBox.Text;

            if (department == "全部")
            {
                department = "*";
            }
            else if (department == "无")
            {
                department = "";
            }

            if (m_selUName == CrmCommons.ALL_VALUE && department == "*")
            {
                if (string.IsNullOrWhiteSpace(tbKey.Text))
                {
                    Commons.ShowInfoBox(this, "请输入关键字!");
                    btnSearch.Enabled = true;
                    return;
                }
            }

            var status = cbbJxStatus.ComboBox.GetSelectedValue();

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

            d["u-name"]      = m_selUName;
            d["department"]  = department;
            d["start-date1"] = startDate.Value.TruncToStart();
            d["end-date1"]   = endDate.Value.TruncToEnd();
            d["search-key"]  = tbKey.Text.Trim();
            if (status != Commons.AllValue)
            {
                d["jx-status"] = status;
            }

            var p = await CrmInvestor.RegUsers(d);

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