Пример #1
0
        private async void UpdateTable()
        {
            var p = await CrmInvestor.Account(m_ciId);

            if (p.IsOk)
            {
                var d = p.AsDictionary;
                tbRealName.Text = d.GetOrDefault <string>("realName");
                tbMobile.Text   = d.GetOrDefault <string>("mobile");
                tbCompany.Text  = d.GetOrDefault <string>("company");
                tbPosition.Text = d.GetOrDefault <string>("position");
                tbCity.Text     = d.GetOrDefault <string>("city");
                if (m_ciId == 0)
                {
                    nudAge.Value = nudAge.Minimum;
                }
                else
                {
                    nudAge.SetValue(DateTime.Now.Year - Commons.FromTimestamp(d.GetOrDefault <long>("birth")).Year);
                }
                cbbGender.SetSelectedValue(d.GetOrDefault <string>("gender"));
                tbSourceType.Text = d.GetOrDefault <string>("originType");
                cbbPrLevel.SetSelectedValue(d.GetOrDefault <string>("prLevel"));
                tbRemark.Text = d.GetOrDefault <string>("remark");
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Пример #2
0
        private async void UpdateData()
        {
            var r = await PrjCtors.GetCtor(m_bcoId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                tbName.Text     = d.GetOrDefault <string>("name");
                tbShowName.Text = d.GetOrDefault <string>("showName");
                cbbEntNature.SetSelectedValue(d.GetOrDefault <string>("entNature"));
                cbbEntQuality.SetSelectedValue(d.GetOrDefault <string>("entQuality"));
                cbbEntStrength.SetSelectedValue(d.GetOrDefault <string>("entStrength"));
                dtpRegisterDate.Value = Commons.FromTimestamp(d.GetOrDefault <long>("registeredDate"));
                tbRegYear.Text        = d.GetOrDefault <string>("regYears");
                tbShowRegYear.Text    = d.GetOrDefault <string>("showRegYears");
                tbRegFunds.Text       = d.GetOrDefault <string>("regFunds");
                tbShowRegFunds.Text   = d.GetOrDefault <string>("showRegFunds");
                tbLastedArea.Text     = d.GetOrDefault <string>("lastedArea");
                tbLastedOutput.Text   = d.GetOrDefault <string>("lastedOutput");
                cbbQualification.SetSelectedValue(d.GetOrDefault <string>("qualification"));
                tbNationPrizeCount.Text = d.GetOrDefault <string>("nationPrizeCount");
                tbProvinPrizeCount.Text = d.GetOrDefault <string>("provinPrizeCount");
                tbIntro.Text            = d.GetOrDefault <string>("intro");
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Пример #3
0
        private async void UpdateData()
        {
            var r = await PrjBorOrgs.GetOrg(m_bboId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                //机构信息
                tbName.Text                 = d.GetOrDefault <string>("orgName");
                tbShowName.Text             = d.GetOrDefault <string>("showOrgName");
                dtpRegisterDate.Value       = Commons.FromTimestamp(d.GetOrDefault <long>("registeredDate"));
                tbRegFunds.Text             = d.GetOrDefault <string>("registeredFund");
                tbShowRegFunds.Text         = d.GetOrDefault <string>("registeredShowFund");
                tbAddress.Text              = d.GetOrDefault <string>("address");
                tbShowAddress.Text          = d.GetOrDefault <string>("showAddress");
                tbSocialCreditCode.Text     = d.GetOrDefault <string>("socialCreditCode");
                tbShowSocialCreditCode.Text = d.GetOrDefault <string>("showSocialCreditCode");
                cbbIndustry.Text            = d.GetOrDefault <string>("industry");
                tbWorkAddress.Text          = d.GetOrDefault <string>("workAddress");
                tbShowWorkAddress.Text      = d.GetOrDefault <string>("showWorkAddress");
                tbShareholderInfo.Text      = d.GetOrDefault <string>("shareholderInfo");
                tbShowShareholderInfo.Text  = d.GetOrDefault <string>("showShareholderInfo");
                tbOperateArea.Text          = d.GetOrDefault <string>("operateArea");
                tbOtherInfo.Text            = d.GetOrDefault <string>("otherInfo");
                //法人信息
                tbLawName.Text     = d.GetOrDefault <string>("legalPersonName");
                tbShowLawName.Text = d.GetOrDefault <string>("legalPersonShowName");
                tbLawIdCard.Text   = d.GetOrDefault <string>("legalIdCard");
                tbLawMobile.Text   = d.GetOrDefault <string>("mobile");
                tbLawEmail.Text    = d.GetOrDefault <string>("email");
                tbLawFax.Text      = d.GetOrDefault <string>("fax");
                tbLawWechat.Text   = d.GetOrDefault <string>("wchat");
                //联系人信息
                tbLinkManName.Text        = d.GetOrDefault <string>("linkmanName");
                tbShowLinkManName.Text    = d.GetOrDefault <string>("linkmanShowName");
                tbLinkManIdCard.Text      = d.GetOrDefault <string>("linkmanIdCard");
                tbLinkManMobile.Text      = d.GetOrDefault <string>("linkmanMobile");
                tbLinkManEmail.Text       = d.GetOrDefault <string>("linkmanEmail");
                tbLinkManWeChat.Text      = d.GetOrDefault <string>("linkmanWchat");
                tbLinkManAddress.Text     = d.GetOrDefault <string>("linkmanAddress");
                tbShowLinkManAddress.Text = d.GetOrDefault <string>("linkmanShowAddress");
                tbLinkManFax.Text         = d.GetOrDefault <string>("linkmanFax");

                //介绍
                tbIntro.Text = d.GetOrDefault <string>("intro");
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Пример #4
0
        private static IList <object> ToDataTableRow(IDictionary <string, object> dict, IList <MyGridColumn> columns)
        {
            NotNull(dict, "dict");
            NotNull(columns, "columns");

            return(columns.Select <MyGridColumn, object>(gc => {
                var origin = dict.ContainsKey(gc.DataKey) ? dict[gc.DataKey].TrimStr() : "";
                if (origin.Length == 0)
                {
                    return null;
                }
                switch (gc.Type)
                {
                case MyGridColumnType.Text:
                    return origin;

                case MyGridColumnType.Number:
                    return Convert.ToInt64(origin);

                case MyGridColumnType.Money:
                    return Commons.ToDecimal(origin);

                case MyGridColumnType.IntMoney:
                    return decimal.Floor(Commons.ToDecimal(origin));

                case MyGridColumnType.Percent:
                    return Convert.ToDouble(origin);

                case MyGridColumnType.Date:
                case MyGridColumnType.DateTime: {
                    var dateTime = Commons.FromTimestamp(Convert.ToInt64(origin));
                    if (dateTime.Year >= 3000)
                    {
                        return null;
                    }
                    else
                    {
                        return dateTime;
                    }
                }

                case MyGridColumnType.Boolean:
                    return Commons.ToBoolean(origin);

                default:
                    return origin;
                }
            }).ToList());
        }
Пример #5
0
        private async void UpdateData()
        {
            var r = await PrjEngineers.GetEngineer(m_bpeId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                tbEngName.Text     = d.GetOrDefault <string>("name");
                tbShowEngName.Text = d.GetOrDefault <string>("engShowName");
                tbAddress.Text     = d.GetOrDefault <string>("address");
                tbShowAddress.Text = d.GetOrDefault <string>("engShowAddress");
                cbbMgrOrgLevel.SetSelectedValue(d.GetOrDefault <string>("mgrOrgLevel"));
                tbMgrOrg.Text     = d.GetOrDefault <string>("mgrOrg");
                tbShowMgrOrg.Text = d.GetOrDefault <string>("showMgrOrg");
                cbbDesignOrgLevel.SetSelectedValue(d.GetOrDefault <string>("designOrgLevel"));
                tbDesignOrg.Text     = d.GetOrDefault <string>("designOrg");
                tbShowDesignOrg.Text = d.GetOrDefault <string>("showDesignOrg");
                cbbEngType.SetSelectedValue(d.GetOrDefault <string>("engType"));
                tbAllOrg.Text     = d.GetOrDefault <string>("allOrg");
                tbShowAllOrg.Text = d.GetOrDefault <string>("showAllOrg");
                tbArea.Text       = d.GetOrDefault <string>("area");
                cbbShowArea.SetSelectedValue(d.GetOrDefault <string>("showArea"));
                dtpPrjStart.Value = Commons.FromTimestamp(d.GetOrDefault <long>("prjStartTime"));
                dtpPrjEnd.Value   = Commons.FromTimestamp(d.GetOrDefault <long>("prjEndTime"));
                tbProIntro.Text   = d.GetOrDefault <string>("proIntro");

                tbMgrRealName.Text = d.GetOrDefault <string>("mgrRealName");
                tbShowMgrName.Text = d.GetOrDefault <string>("mgrShowName");
                tbAge.Text         = d.GetOrDefault <string>("mgrAge");
                tbShowAge.Text     = d.GetOrDefault <string>("mgrShowAge");
                cbbGenders.SetSelectedValue(d.GetOrDefault <int>("mgrGender"));
                tbQualification.Text = d.GetOrDefault <string>("qualification");
                tbMgrIntro.Text      = d.GetOrDefault <string>("mgrIntro");
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Пример #6
0
        private async void UpdateData()
        {
            var r = await PrjGuaranteeOrgs.GetGuarantee(m_bgoId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                tbName.Text           = d.GetOrDefault <string>("name");
                tbShowName.Text       = d.GetOrDefault <string>("showName");
                dtpRegisterDate.Value = Commons.FromTimestamp(d.GetOrDefault <long>("registeredDate"));
                tbRegYear.Text        = d.GetOrDefault <string>("regYears");
                tbRegFunds.Text       = d.GetOrDefault <string>("regFunds");
                tbRegAddress.Text     = d.GetOrDefault <string>("regAddress");
                tbPostCode.Text       = d.GetOrDefault <string>("postcode");
                tbLinkMan.Text        = d.GetOrDefault <string>("linkman");
                tbMobile.Text         = d.GetOrDefault <string>("mobile");
                tbRanking.Text        = d.GetOrDefault <string>("ranking");
                tbGetPrize.Text       = d.GetOrDefault <string>("getPrize");
                tbOrgWebSite.Text     = d.GetOrDefault <string>("orgWebSite");

                tbQualification.Text       = d.GetOrDefault <string>("qualification");
                tbShowRegAddress.Text      = d.GetOrDefault <string>("showRegAddress");
                tbLegalIdCard.Text         = d.GetOrDefault <string>("legalIdCard");
                tbLegalPersonName.Text     = d.GetOrDefault <string>("legalPersonName");
                tbLegalPersonShowName.Text = d.GetOrDefault <string>("legalPersonShowName");

                tbSocialCreditCode.Text     = d.GetOrDefault <string>("socialCreditCode");
                tbShowSocialCreditCode.Text = d.GetOrDefault <string>("showSocialCreditCode");

                tbIntro.Text = d.GetOrDefault <string>("intro");
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Пример #7
0
        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);
            }
        }
Пример #8
0
        private async void UpdateData1()
        {
            var r = await Projects.Prj(m_pId);

            if (r.IsOk)
            {
                var d = r.AsDictionary;
                tbItemName.Text       = d.GetOrDefault <string>("itemName");
                tbItemShowName.Text   = d.GetOrDefault <string>("itemShowName");
                tbItemNo.Text         = d.GetOrDefault <string>("itemNo");
                tbDeputy.Text         = d.GetOrDefault <string>("outProxy");
                tbFinanceManager.Text = d.GetOrDefault <string>("inProxy");
                tbFinancier.Text      = d.GetOrDefault <string>("financier");
                tbPrjSource.Text      = d.GetOrDefault <string>("src");
                tbLoanPurpose.Text    = d.GetOrDefault <string>("loanPurposes");
                nudAmt.SetValue(d.GetOrDefault <decimal>("amt"));
                nudPerInvestMaxAmt.Maximum = nudAmt.Value;
                nudRate.SetValue(d.GetOrDefault <decimal>("rate"));
                nudExtensionRate.SetValue(d.GetOrDefault <decimal>("extensionRate"));
                nudTimeoutRate.SetValue(d.GetOrDefault <decimal>("timeOutRate"));
                nudDepositRatio.SetValue(d.GetOrDefault <decimal>("depositRatio"));
                nudBorrowDays.SetValue(d.GetOrDefault <decimal>("borrowDays"));
                nudExtensionDay.SetValue(d.GetOrDefault <decimal>("extensionDays"));
                nudBuyRate.SetValue(d.GetOrDefault <decimal>("costFee"));
                dtpInTime.Value       = Commons.FromTimestamp(d.GetOrDefault <long>("inTime"));
                dtpOutTime.Value      = Commons.FromTimestamp(d.GetOrDefault <long>("outTime"));
                ckbInEqualOut.Checked = dtpInTime.Value.Date == dtpOutTime.Value.Date;
                nudFinanceDays.SetValue(d.GetOrDefault <decimal>("financingDays"));
                dtpExpecteBorTime.Value = Commons.FromTimestamp(d.GetOrDefault <long>("expectedBorrowTime"));
                nudPerInvestMinAmt.SetValue(d.GetOrDefault <decimal>("perInvestMinAmt"));
                nudPerInvestAmt.SetValue(d.GetOrDefault <decimal>("perInvestAmt"));
                nudFeeRate.SetValue(d.GetOrDefault <decimal>("feeRate"));
                cbbPrjType.SetSelectedValue(d.GetOrDefault <string>("type"));
                visible         = d.GetOrDefault <bool>("visible");
                tbPrjIntro.Text = d.GetOrDefault <string>("prjIntro");
                var investMaxAmtRatio = d.GetOrDefault <decimal>("investMaxAmtRatio");
                var investMaxAmt      = d.GetOrDefault <decimal>("investMaxAmt");
                var perMaxMoney       = d.GetOrDefault <decimal>("perInvestMaxAmt");
                if (investMaxAmtRatio > 0)
                {
                    ckbLimitMoneyRate.Checked = true;
                    nudInvestMaxAmtRatio.SetValue(investMaxAmtRatio);
                }
                if (investMaxAmt > 0)
                {
                    ckbLimitMoney.Checked = true;
                    nudInvestMaxAmt.SetValue(investMaxAmt);
                }
                if (perMaxMoney > 0)
                {
                    ckbPerMaxMoney.Checked = true;
                    nudPerInvestMaxAmt.SetValue(perMaxMoney);
                }

                UpdateTotalInterest();

                var contract = d.GetOrDefault <int>("contract");
                ckbContract1.Checked = Convert.ToBoolean(contract & 1);
                ckbContract2.Checked = Convert.ToBoolean(contract & 2);
                ckbContract8.Checked = Convert.ToBoolean(contract & 8);
                tbKeys.Text          = d.GetOrDefault <string>("key");

                var flags = d.GetOrDefault <int>("flags");
                ckbFlagNewer.Checked = Convert.ToBoolean(flags & 0x0001);
                ckbFlagJcb.Checked   = Convert.ToBoolean(flags & 0x0010);
                ckbFlagBx.Checked    = Convert.ToBoolean(flags & 0x0040);

                cbbWaterMark.Text = d.GetOrDefault <string>("waterMark");

                btnDelayCollect.Enabled = d.GetOrDefault <int>("status") == 40;
                tbRemark.Text           = d.GetOrDefault <string>("remark");
                if (m_pId == 0)
                {
                    btnDelayCollect.Visible = false;
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }