Ejemplo n.º 1
0
        private async void SaveData()
        {
            var remark = tbRemark.Text.Trim().LeftStr(2000);
            var action = cbbFollowRecord.GetSelectedValue();

            if (action == "")
            {
                if (remark == "")
                {
                    Commons.ShowInfoBox(this, "备注不能为空");
                    return;
                }
            }

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

            d["remark"] = remark;
            d["action"] = action == "" ? "-1" : action;

            var p = await CrmInvestor.SaveRemark(m_ciId, d);

            if (p.IsOk)
            {
                if (p.AsInt > 0)
                {
                    UpdateTable();
                    tbRemark.Clear();
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Ejemplo n.º 2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            var ids = new List <long>();

            for (int i = 0; i < myGridViewBinding1.View.RowCount; ++i)
            {
                if (Convert.ToInt32(STATUS.FindByText(Convert.ToString(myGridViewBinding1.GetCellValue(i, "done")))) != -1)
                {
                    continue;
                }
                ids.Add(Convert.ToInt64(myGridViewBinding1.GetCellValue(i, "jvpId")));
            }

            if (ids.Count == 0)
            {
                Commons.ShowInfoBox(this, "无可操作记录");
                return;
            }

            var dlg = new BatchProcessDlg(ids);

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.RunSingle    += (id) => {
                var p = BusinessTransfers.ExecuteInvestBonus(m_tbdId, id).Result;
                myGridViewBinding1.BindTo(p, Commons.BindFlag.Update, "jvpId");
                return(p);
            };
            dlg.ShowDialog();
            //UpdateTable1();
        }
Ejemplo n.º 3
0
        private async void Delete(IList <long> idArray)
        {
            btnDelete.Enabled = false;
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "删除以下投资客户:" + ss + " 此操作不可恢复!确认吗?"))
            {
                foreach (var id in idArray)
                {
                    var p = await CrmInvestor.DelAccount(id);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "ciId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }

                Commons.ShowInfoBox(this, "投资客户:" + ss + " 已被删除。");
            }
            btnDelete.Enabled = true;
        }
Ejemplo n.º 4
0
        private async void SaveData()
        {
            if (m_auId == 0)
            {
                btnMatch.Focus();
                Commons.ShowInfoBox(this, "未选择收件人");
                return;
            }
            if (string.IsNullOrWhiteSpace(m_mdText))
            {
                Commons.ShowInfoBox(this, "不能发送空消息");
                return;
            }
            var r = new Dictionary <string, object>();

            r["au-id"]   = m_auId;
            r["title"]   = tbTitle.Text.Trim();
            r["brief"]   = tbBrief.Text.Trim();
            r["content"] = m_mdText;
            r["type"]    = 1;

            var p = await Messages.SaveMessage(r);

            if (p.IsOk)
            {
                DlgResult    = p;
                DialogResult = DialogResult.OK;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Ejemplo n.º 5
0
        private async void MatchInvest()
        {
            btnMatch.Enabled = false;
            var d = new Dictionary <string, object>();

            d["key"] = tbTarget.Text;
            var p = await Messages.MatchInvest(d);

            if (p.IsOk)
            {
                var dl = JArray.Parse(p.AsString).ToList();
                if (dl.Count != 0)
                {
                    m_auId        = dl[0]["auId"].ToInt64();
                    tbTarget.Text = string.Format("{0}({1})", dl[0]["loginName"].ToStdString(), dl[0]["realName"].ToStdString());
                }
                else
                {
                    m_auId        = 0;
                    tbTarget.Text = "";
                    tbTarget.Focus();
                    Commons.ShowInfoBox(this, "未匹配到收件人!");
                }
            }
            else
            {
                m_auId        = 0;
                tbTarget.Text = "";
                tbTarget.Focus();
                Commons.ShowResultErrorBox(this, p);
            }
            btnMatch.Enabled = true;
        }
Ejemplo n.º 6
0
        private async void SaveData()
        {
            btnOK.Enabled = false;
            try {
                var amt = nudAmt.Value;
                if (amt <= 0)
                {
                    Commons.ShowInfoBox(this, "转帐金额必须大于0!");
                    return;
                }

                var r = new Dictionary <string, object>();
                r["tbd-id"]     = m_tbdId;
                r["login-name"] = tbLoginName.Text.Trim();
                r["real-name"]  = tbRealName.Text.Trim();
                r["amt"]        = nudAmt.Value;
                r["remark"]     = m_remark;

                var p = await BusinessTransfers.SaveInvestBonus(r);

                if (p.IsOk)
                {
                    DlgResult    = p;
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            } finally {
                btnOK.Enabled = true;
            }
        }
Ejemplo n.º 7
0
        private async void CheckBank()
        {
            var idCard = tbIdCard.Text.Trim();

            idCard = Commons.ShowInputDialog(this, "请输入身份证号:", "检查银行开户", 300, new Regex("^\\d{18}$|^\\d{17}(X|x)$|^\\d{15}$"), false, idCard).Trim();
            if (idCard == "")
            {
                return;
            }
            btnCheckBank.Enabled = false;
            var d = new Dictionary <string, object>();

            d["au-id"]   = m_auId;
            d["id-card"] = idCard;
            var p = await InvestPersons.CheckBank(d);

            if (p.IsOk)
            {
                if (p.AsBoolean)
                {
                    UpdateTable();
                    Commons.ShowInfoBox(this, "已开户");
                }
                else
                {
                    Commons.ShowInfoBox(this, "未开户");
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnCheckBank.Enabled = true;
        }
Ejemplo n.º 8
0
        private async void SaveData()
        {
            if (tbNewPassword1.Text.Trim() != tbNewPassword2.Text.Trim())
            {
                Commons.ShowInfoBox(this, "两次输入的密码必须一致!");
                tbNewPassword2.Focus();
                return;
            }

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

            d["old-password"] = tbOldPassword.Text.Trim();
            d["new-password"] = tbNewPassword1.Text.Trim();

            var p = await Users.ChangePwd(d);

            if (p.IsOk)
            {
                if (p.AsBoolean)
                {
                    Commons.ShowInfoBox(this, "修改成功,请重新登录!");
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    Commons.ShowInfoBox(this, "修改密码失败!");
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
        private async void SaveData()
        {
            if (m_bgoId == 0 || m_bgoId == -1)
            {
                Commons.ShowInfoBox(this, "请选择一个担保机构!");
                btnSelGuarantee.Focus();
                return;
            }

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

            p["pid"]                    = m_pId;
            p["bgo-id"]                 = m_bgoId;
            p["form"]                   = cbbTypes.Text.Trim();
            p["range"]                  = cbbRange.Text.Trim();
            p["limit"]                  = cbbLimit.Text.Trim();
            p["last-year-income"]       = (int)nudLastYearIncome.Value;
            p["relation-ship"]          = cbbRelationShip.Text.Trim();
            p["guarantee-right-man"]    = tbGuaRightMan.Text.Trim();
            p["guarantee-right-man-no"] = tbGuaRightManNo.Text.Trim();
            p["order-no"]               = (int)nudOrder.Value;
            p["visible"]                = cbbVisible.GetSelectedValue();

            var r = await Projects.GuaranteeOrgPut(p);

            if (r.IsOk)
            {
                DlgResult    = r;
                DialogResult = DialogResult.OK;
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Ejemplo n.º 10
0
        private void btnAssignManager_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode == null || string.IsNullOrWhiteSpace(treeView1.SelectedNode.Text))
            {
                Commons.ShowInfoBox(this, "请选择一位新的客户经理");
                return;
            }

            var newMgr = treeView1.SelectedNode.Text;

            var dlg = new BatchProcessDlg(m_ids);

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.RunSingle    += (id) => {
                if (m_type)
                {
                    var d = new Dictionary <string, object>();
                    d["au-id"]  = id;
                    d["u-name"] = newMgr;
                    return(CrmInvestor.BindMgrWithRegUser(d).Result);
                }
                else
                {
                    var d = new Dictionary <string, object>();
                    d["ci-id"]  = id;
                    d["u-name"] = newMgr;
                    return(CrmInvestor.BindMgr(d).Result);
                }
            };
            dlg.ShowDialog(this);

            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 11
0
        private async void Del(IList <string> idArray)
        {
            btnDel.Enabled = false;
            var ss = idArray.JoinSome(" ");

            if (Commons.ShowConfirmBox(this, "删除以下角色:" + ss + " 此操作不可恢复!确认吗?"))
            {
                foreach (var id in idArray)
                {
                    if (id == "administrators")
                    {
                        Commons.ShowInfoBox(this, "不能删除角色:administrators !");
                        continue;
                    }
                    var p = await Roles.Delete(id);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "name");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                var adminIndex = ss.IndexOf("administrators");
                if (adminIndex != -1)
                {
                    ss = ss.Remove(adminIndex, "administrators".Length);
                }
                Commons.ShowInfoBox(this, "角色:" + ss + " 已被删除。");
            }
            btnDel.Enabled = true;
        }
Ejemplo n.º 12
0
        private async void Delete(IList <long> idArray)
        {
            btnPrjDel.Enabled = false;
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "删除以下项目:" + ss + " 此操作不可恢复!确认吗?"))
            {
                foreach (var id in idArray)
                {
                    var p = await Projects.DeleteProj(id);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "pId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }

                UpdateTable1();

                Commons.ShowInfoBox(this, "项目:" + ss + " 已被删除。");
            }
            btnPrjDel.Enabled = true;
        }
Ejemplo n.º 13
0
        private async void UploadFiles()
        {
            if (m_maxCount > 0)
            {
                if (listView1.Items.Count >= m_maxCount)
                {
                    Commons.ShowInfoBox(this, string.Format("最多只能上传 {0} 个文件,请删除后再上传!", m_maxCount));
                }
            }

            using (var oFile = new OpenFileDialog()) {
                oFile.Filter = m_filter;
                if (oFile.ShowDialog() == DialogResult.OK)
                {
                    if (m_fileType == 37)
                    {
                        if (!oFile.FileName.StartsWith("intermediary_") && !oFile.FileName.StartsWith("loan_"))
                        {
                            Commons.ShowInfoBox(this, "上传文件应以“intermediary_”或“loan_”开头");
                            return;
                        }
                    }
                    FileStream fileStream;
                    try {
                        fileStream = new FileStream(oFile.FileName, FileMode.Open);
                    } catch (Exception e) {
                        Commons.ShowInfoBox(this, e.Message);
                        return;
                    }
                    if (fileStream.Length > m_maxSize * MB)
                    {
                        Commons.ShowInfoBox(this, string.Format("文件 {0} 太大,大小不能超过 {1} MB", oFile.FileName, m_maxSize));
                        return;
                    }
                    btnUpload.Enabled = false;

                    var data = new byte[fileStream.Length];
                    try {
                        fileStream.Read(data, 0, data.Length);
                    } catch (Exception e) {
                        Commons.ShowInfoBox(this, e.Message);
                        btnUpload.Enabled = true;
                        return;
                    }
                    var p = await Files.Upload(oFile.FileName, data, m_objectId, m_fileType);

                    if (p.IsOk)
                    {
                        UpdateTable();
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }

                    fileStream.Close();
                    btnUpload.Enabled = true;
                }
            }
        }
Ejemplo n.º 14
0
        private async void SaveData()
        {
            if (m_bpmoId == 0 || m_bpmoId == -1)
            {
                Commons.ShowInfoBox(this, "请选择一个借款机构!");
                btnSelBorOrg.Focus();
                return;
            }
            var p = new Dictionary <string, object>();

            p["pid"]               = m_pId;
            p["bpmo-id"]           = m_bpmoId;
            p["loan-purposes"]     = tbLoanPurpose.Text.Trim();
            p["loan-bal"]          = (int)nudLoanBal.Value;
            p["other-loan-bal"]    = (int)nudOtherLoanBal.Value;
            p["overdue-num"]       = tbOverDueNum.Text.Trim();
            p["other-overdue-num"] = tbOtherOverDueNum.Text.Trim();
            p["overdue-amt"]       = nudOverDueAmt.Value;
            p["other-overdue-amt"] = nudOtherOverDueAmt.Text.Trim();
            p["visible"]           = cbbVisible.GetSelectedValue();
            p["order-no"]          = (int)nudOrder.Value;
            p["loan-intro"]        = tbSituation.Text.LeftStr(2000);

            var r = await Projects.BorrowOrgPut(p);

            if (r.IsOk)
            {
                DlgResult    = r;
                DialogResult = DialogResult.OK;
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
        }
Ejemplo n.º 15
0
        private async void Delete(IList <long> idArray)
        {
            btnDelete.Enabled = false;
            var ss = idArray.JoinSome();

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

                    if (p.IsOk)
                    {
                        suc += id + ",";
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "bgoId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                if (suc != "")
                {
                    Commons.ShowInfoBox(this, "担保公司:" + suc.TrimEnd(',') + " 已被删除。");
                }
            }
            btnDelete.Enabled = true;
        }
Ejemplo n.º 16
0
        private async void SaveData()
        {
            var perms = new List <string>();

            foreach (DictionaryEntry ckb in m_allCheckBoxs)
            {
                if (((CheckBox)ckb.Value).Checked)
                {
                    perms.Add(Convert.ToString(ckb.Key));
                }
            }

            if (perms.Count == 0)
            {
                Commons.ShowInfoBox(this, "请至少设定一个权限");
                return;
            }

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

            d["role-name"] = m_roleName;
            d["perms"]     = string.Join(",", perms);
            var p = await Roles.AssignPerms(d);

            if (p.IsOk)
            {
                DialogResult = DialogResult.OK;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Ejemplo n.º 17
0
        private async void ChangeLevel()
        {
            var level = Commons.ShowComboboxInputDialog(this, INVESTOR_LEVEL, "请选择账户级别:",
                                                        string.Format("修改级别-{0}", m_auId), INVESTOR_LEVEL.FindByText(tbInvestorLevel.Text), 300);

            if (level == "-1")
            {
                return;
            }

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

            d["au-id"] = m_auId;
            d["lev"]   = level;

            var p = await InvestPersons.UpdateLevel(d);

            if (p.IsOk)
            {
                UpdateTable();
                Commons.ShowInfoBox(this, "修改成功");
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Ejemplo n.º 18
0
        private async void DelFreeze(IList <string> idArray)
        {
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "解除订单号为:" + ss + " 的冻结资金吗?"))
            {
                foreach (var id in idArray)
                {
                    var d = new Dictionary <string, object>();
                    d["old-order-id"] = id;
                    var p = await FreezeMoney.DelFreeze(d);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "buyDate");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                UpdateTable2();
                Commons.ShowInfoBox(this, "解除订单号为:" + ss + " 已被删除。");
            }
            btnDel.Enabled = true;
        }
Ejemplo n.º 19
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            var ids = new List <long>();

            for (int i = 0; i < myGridViewBinding1.View.SelectedRows.Count; ++i)
            {
                if (Convert.ToBoolean(myGridViewBinding1.View.SelectedRows[i].Tag))
                {
                    continue;
                }
                ids.Add(Convert.ToInt64(myGridViewBinding1.GetCellValue(myGridViewBinding1.View.SelectedRows[i].Index, "tctId")));
            }

            if (ids.Count == 0)
            {
                Commons.ShowInfoBox(this, "至少选中一项投标记录");
                return;
            }
            btnExecute.Enabled = false;
            var dlg = new BatchProcessDlg(ids);

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.RunSingle    += (id) => Projects.CancelTenders(id).Result;
            dlg.ShowDialog();
            UpdateTable1();
            btnExecute.Enabled = true;
        }
Ejemplo n.º 20
0
        private async void UpdateTable1()
        {
            btnSearch.Enabled            = false;
            wbDataStatistic.DocumentText = "";
            var r = new Dictionary <string, object>();

            r["datepoint"] = dtpSearchDate.Value;
            r["limit-amt"] = nudAmt.Value;

            var p = await DataStatistic.VipStatistic(r);

            if (p.IsOk)
            {
                var    rows = JArray.Parse(p.AsString).ToList();
                string info;
                info = string.Format(@"<table border=1 cellspacing=0 align=center>
                        <tr><th width=80 {0}>ID</th>
                        <th width=100 {0}>帐户名</th>
                        <th width=100 {0}>真实姓名</th>
                        <th width=150 {0}>当前客户经理</th>
                        <th width=120 {0}>手机</th>
                        <th width=100 {0}>当月投资额</th>
                        <th width=100 {0}>投资余额</th>
                        <th width=150 {0}>当月买入债权额</th></tr>", "bgcolor=#A9A9A9");

                if (rows.Count == 0)
                {
                    info += "</table>";
                    wbDataStatistic.DocumentText = info;
                    btnSearch.Enabled            = true;
                    Commons.ShowInfoBox(this, "未查询到数据!");
                    return;
                }

                foreach (var row in rows)
                {
                    info += string.Format(@"<tr><td {0}>&nbsp;{1}</td>
                    <td {0}>&nbsp;{2}</td>
                    <td {0}>&nbsp;{3}</td>
                    <td {0}>&nbsp;{4}</td>
                    <td {0}>&nbsp;{5}</td>
                    <td align=right valign=middle>&nbsp;{6}</td>
                    <td align=right valign=middle>&nbsp;{7}</td>
                    <td align=right valign=middle>&nbsp;{8}</td></tr>"
                                          , "align=center valign=middle", row["auId"].ToStdString(), row["loginName"].ToStdString()
                                          , row["realName"].ToStdString(), row["uName"].ToStdString(), row["mobile"].ToStdString(), row["monthSumAmt"].ToMoney()
                                          , row["blanceAmt"].ToMoney(), row["monthSumCredit"].ToMoney());
                }

                info += "</table>";

                wbDataStatistic.DocumentText = info;
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnSearch.Enabled = true;
        }
Ejemplo n.º 21
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (tbRCode.Text.Trim() == "")
     {
         Commons.ShowInfoBox(this, "必须输入推广代号");
         return;
     }
     tbRAddress.Text   = tbRegisterBaseAddress.Text + HttpUtility.UrlEncode(tbRCode.Text.Trim(), Encoding.UTF8);
     pictureBox1.Image = GetQRCodeBitmap(tbRAddress.Text);
 }
Ejemplo n.º 22
0
        private void btnCreateAssign_Click(object sender, EventArgs e)
        {
            var dlg = new CrmAssignRegUserDlg();

            dlg.StartPosition = FormStartPosition.CenterParent;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                Commons.ShowInfoBox(this, "分配成功!");
                UpdateTable();
            }
        }
Ejemplo n.º 23
0
        private void btnWorkDetails_Click(object sender, EventArgs e)
        {
            if (CrmCommons.IsAll(m_selUName) || CrmCommons.IsNone(m_selUName))
            {
                Commons.ShowInfoBox(this, "请选择一个客户经理");
                return;
            }
            var dlg = new CrmTodoDlg(m_selUName);

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.ShowDialog(this);
        }
Ejemplo n.º 24
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;
        }
Ejemplo n.º 25
0
        private async void ResetPwd(IList <string> userNames)
        {
            var ss = userNames.JoinSome();

            if (Commons.ShowConfirmBox(this, "重置以下用户的密码:" + ss + " 确认吗?"))
            {
                foreach (var userName in userNames)
                {
                    await Security.Users.ResetPwd(userName);
                }
                UpdateTable1();
                Commons.ShowInfoBox(this, "用户:" + ss + " 的密码已被重置。");
            }
        }
Ejemplo n.º 26
0
        private async void UpdateTable1()
        {
            if (m_selUName == CrmCommons.ALL_VALUE && string.IsNullOrWhiteSpace(tbKey.Text))
            {
                Commons.ShowInfoBox(this, "请输入关键字");
                return;
            }
            btnSearch.Enabled = false;
            var prLevel = cbbPrLevels.ComboBox.GetSelectedValue();
            var age     = cbbAge.ComboBox.GetSelectedValue();
            var gender  = cbbGenders.ComboBox.GetSelectedValue();
            var status  = cbbAccStatus.ComboBox.GetSelectedValue();

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

            p["u-name"]       = m_selUName;
            p["assign-time1"] = startDate.Value.TruncToStart();
            p["assign-time2"] = endDate.Value.TruncToEnd();
            p["search-key"]   = tbKey.Text.Trim();
            p["origin-type"]  = cbbCustomerSource.Text.Trim();
            if (prLevel != Commons.AllValue)
            {
                p["pr-level"] = prLevel;
            }
            if (age != Commons.AllValue)
            {
                p["age"] = age;
            }
            if (gender != Commons.AllValue)
            {
                p["gender"] = gender;
            }
            if (status != Commons.AllValue)
            {
                p["status"] = status;
            }

            var r = await CrmInvestor.MyInvestors(p);

            if (r.IsOk)
            {
                this.myGridViewBinding1.BindTo(r);
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
            btnSearch.Enabled = true;
        }
Ejemplo n.º 27
0
 private async void SaveData()
 {
     if (string.IsNullOrWhiteSpace(tbIntro.Text))
     {
         Commons.ShowInfoBox(this, "介绍不能为空!");
         return;
     }
     btnOK.Enabled = false;
     try {
         var r = new Dictionary <string, object>();
         r["bco-id"]             = m_bcoId;
         r["name"]               = tbName.Text.Trim();
         r["show-name"]          = tbShowName.Text.Trim();
         r["ent-nature"]         = cbbEntNature.Text.Trim();
         r["ent-quality"]        = cbbEntQuality.Text.Trim();
         r["ent-strength"]       = cbbEntStrength.Text.Trim();
         r["registered-date"]    = dtpRegisterDate.Value;
         r["reg-years"]          = tbRegYear.Text.Trim();
         r["show-reg-years"]     = tbShowRegYear.Text.Trim();
         r["reg-funds"]          = tbRegFunds.Text.Trim();
         r["show-reg-funds"]     = tbShowRegFunds.Text.Trim();
         r["lasted-area"]        = tbLastedArea.Text.Trim();
         r["lasted-output"]      = tbLastedOutput.Text.Trim();
         r["qualification"]      = cbbQualification.Text.Trim();
         r["nation-prize-count"] = tbNationPrizeCount.Text.Trim();
         r["provin-prize-count"] = tbProvinPrizeCount.Text.Trim();
         r["intro"]              = tbIntro.Text.LeftStr(2000);
         IResult p;
         if (m_bcoId == 0)
         {
             p = await PrjCtors.Create(r);
         }
         else
         {
             p = await PrjCtors.Update(r);
         }
         if (p.IsOk)
         {
             DlgResult    = p;
             DialogResult = DialogResult.OK;
         }
         else
         {
             Commons.ShowResultErrorBox(this, p);
         }
     } finally {
         btnOK.Enabled = true;
     }
 }
        private async void AssignManager()
        {
            if (treeView1.SelectedNode == null || string.IsNullOrWhiteSpace(treeView1.SelectedNode.Text))
            {
                Commons.ShowInfoBox(this, "请选择一位新的客户经理");
                return;
            }
            btnAssignManager.Enabled = false;
            var newMgr = treeView1.SelectedNode.Text;

            if (newMgr == CrmCommons.SELF_TEXT)
            {
                newMgr = CrmCommons.SELF_VALUE;
            }

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

            Rpc.IResult p;
            if (m_type)
            {
                d["au-id"]  = m_id;
                d["u-name"] = newMgr;
                p           = await CrmInvestor.BindMgrWithRegUser(d);
            }
            else
            {
                d["ci-id"]  = m_id;
                d["u-name"] = newMgr;
                p           = await CrmInvestor.BindMgr(d);
            }

            if (p.IsOk)
            {
                if (p.AsInt == 0)
                {
                    Commons.ShowInfoBox(this, "绑定客户经理失败!");
                }
                else
                {
                    DialogResult = DialogResult.OK;
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnAssignManager.Enabled = true;
        }
Ejemplo n.º 29
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (pictureBox1.Image != null)
     {
         var sFile = new SaveFileDialog();
         if (sFile.ShowDialog() == DialogResult.OK)
         {
             sFile.Filter = "图片|*.jpg;*.png;*.gif;*.bmp;*.jpeg|所有文件(*.*)|*.*";
             pictureBox1.Image.Save(sFile.FileName);
         }
     }
     else
     {
         Commons.ShowInfoBox(this, "无二维码保存");
     }
 }
Ejemplo n.º 30
0
        private async void CommitInfo()
        {
            btnCommitInfo.Enabled = false;
            var d = new Dictionary <string, object>();

            d["au-id"]         = m_auId;
            d["org-name"]      = tbOrgName.Text.Trim();
            d["buss-lic"]      = tbBussLic.Text.Trim();
            d["org-code-no"]   = tbOrgCodeNo.Text.Trim();
            d["law-name"]      = tbLawName.Text.Trim();
            d["law-id-card"]   = tbLawIdCard.Text.Trim();
            d["acc-user-name"] = tbAccUserName.Text.Trim();
            d["account"]       = tbAccount.Text.Trim();
            d["account-bank"]  = tbAccBank.Text.Trim();
            d["real-name"]     = tbRealName.Text.Trim();
            d["position"]      = tbPosition.Text.Trim();
            d["id-card"]       = tbIdCard.Text.Trim();
            d["company"]       = tbCompany.Text.Trim();
            d["company-type"]  = tbCompanyType.Text.Trim();
            d["address"]       = tbAddress.Text.Trim();
            d["postal-code"]   = tbPostalCode.Text.Trim();
            d["home-phone"]    = tbHomeNo.Text.Trim();
            d["qq-number"]     = tbQQ.Text.Trim();
            d["email"]         = tbEmail.Text.Trim();

            var p = await InvestOrgs.UpdateInfo(d);

            if (p.IsOk)
            {
                if (p.AsBoolean)
                {
                    UpdateTable();
                    Commons.ShowInfoBox(this, "资料提交成功");
                }
                else
                {
                    Commons.ShowInfoBox(this, "资料提交失败");
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }

            btnCommitInfo.Enabled = true;
        }