示例#1
0
        private async void Delete(IList <long> idArray)
        {
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "删除以下借款人:" + ss + " 此操作不可恢复!确认吗?"))
            {
                string suc = "";
                foreach (var id in idArray)
                {
                    var p = await PrjBorPersons.Delete(id);

                    if (p.IsOk)
                    {
                        suc += id + ",";
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "bpmpId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                if (suc != "")
                {
                    Commons.ShowInfoBox(this, "借款人:" + suc.TrimEnd(',') + " 已被删除。");
                }
            }
            btnDelete.Enabled = true;
        }
示例#2
0
        private async void SaveData()
        {
            btnOk.Enabled = false;
            try {
                var data = new Dictionary <string, object>();
                data["bpm-id"] = m_bpmId;
                //借款人信息
                data["real-name"]            = tbRealName.Text.Trim();
                data["show-name"]            = tbShowName.Text.Trim();
                data["mobile"]               = tbMobile.Text.Trim();
                data["gender"]               = cbbGenders.GetSelectedValue();
                data["age"]                  = tbAge.Text.Trim();
                data["show-age"]             = tbShowAge.Text.Trim();
                data["id-card"]              = tbIdCard.Text.Trim();
                data["id-card-address-prov"] = tbProvince.Text.Trim();
                data["id-card-address-city"] = tbCity.Text.Trim();
                data["email"]                = tbEmail.Text.Trim();
                data["address"]              = tbAddress.Text.Trim();
                data["show-address"]         = tbShowAddress.Text.Trim();
                data["company"]              = tbCompany.Text.Trim();
                data["position"]             = tbPosition.Text.Trim();
                data["work-years"]           = tbWorkYear.Text.Trim();
                data["fax"]                  = tbFax.Text.Trim();
                data["wchat"]                = tbWechat.Text.Trim();

                //联系人信息
                data["linkman-name"]         = tbLinkManName.Text.Trim();
                data["linkman-show-name"]    = tbShowLinkManName.Text.Trim();
                data["linkman-mobile"]       = tbLinkManMobile.Text.Trim();
                data["linkman-email"]        = tbLinkManEmail.Text.Trim();
                data["linkman-wchat"]        = tbLinkManWeChat.Text.Trim();
                data["linkman-fax"]          = tbLinkManFax.Text.Trim();
                data["linkman-id-card"]      = tbLinkManIdCard.Text.Trim();
                data["linkman-address"]      = tbLinkManAddress.Text.Trim();
                data["linkman-show-address"] = tbShowLinkManAddress.Text.Trim();

                data["intro"] = tbIntro.Text.Trim();
                IResult r;
                if (m_bpmId == 0)
                {
                    r = await PrjBorPersons.Create(data);
                }
                else
                {
                    r = await PrjBorPersons.Update(data);
                }
                if (r.IsOk)
                {
                    DlgResult    = r;
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    Commons.ShowResultErrorBox(this, r);
                }
            } finally {
                btnOk.Enabled = true;
            }
        }
示例#3
0
        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;
        }
示例#4
0
        private async void UpdateData()
        {
            var r = await PrjBorPersons.GetById(m_bpmId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                //借款人信息
                tbRealName.Text = d.GetOrDefault <string>("realName");
                tbShowName.Text = d.GetOrDefault <string>("showName");
                tbAge.Text      = d.GetOrDefault <string>("age");
                tbShowAge.Text  = d.GetOrDefault <string>("showAge");
                tbMobile.Text   = d.GetOrDefault <string>("mobile");
                tbEmail.Text    = d.GetOrDefault <string>("email");
                cbbGenders.SetSelectedValue(d.GetOrDefault <int>("gender"));
                tbIdCard.Text      = d.GetOrDefault <string>("idCard");
                tbProvince.Text    = d.GetOrDefault <string>("idCardAddressProv");
                tbCity.Text        = d.GetOrDefault <string>("idCardAddressCity");
                tbAddress.Text     = d.GetOrDefault <string>("address");
                tbCompany.Text     = d.GetOrDefault <string>("company");
                tbPosition.Text    = d.GetOrDefault <string>("position");
                tbWorkYear.Text    = d.GetOrDefault <string>("workYears");
                tbWechat.Text      = d.GetOrDefault <string>("wchat");
                tbFax.Text         = d.GetOrDefault <string>("fax");
                tbShowAddress.Text = d.GetOrDefault <string>("showAddress");
                tbIndustry.Text    = d.GetOrDefault <string>("industry");
                cbbWorkNature.Text = d.GetOrDefault <string>("workNature");
                tbOtherInfo.Text   = d.GetOrDefault <string>("otherInfo");

                //联系人信息
                tbLinkManName.Text        = d.GetOrDefault <string>("linkmanName");
                tbShowLinkManName.Text    = d.GetOrDefault <string>("linkmanShowName");
                tbLinkManAddress.Text     = d.GetOrDefault <string>("linkmanAddress");
                tbShowLinkManAddress.Text = d.GetOrDefault <string>("linkmanShowAddress");
                tbLinkManEmail.Text       = d.GetOrDefault <string>("linkmanEmail");
                tbLinkManFax.Text         = d.GetOrDefault <string>("linkmanFax");
                tbLinkManIdCard.Text      = d.GetOrDefault <string>("linkmanIdCard");
                tbLinkManMobile.Text      = d.GetOrDefault <string>("linkmanMobile");
                tbLinkManWeChat.Text      = d.GetOrDefault <string>("linkmanWchat");

                //介绍
                tbIntro.Text = d.GetOrDefault <string>("intro");
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
示例#5
0
        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;
        }