Ejemplo n.º 1
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.º 2
0
        private async void AccConfirm()
        {
            btnAccConfirm.Enabled = false;
            var cardId = Commons.ShowInputDialog(this, "请输入电子帐户号:", "确认开户", 300, new Regex("^\\d*$")).Trim();

            if (cardId == "")
            {
                btnAccConfirm.Enabled = true;
                return;
            }
            if (!Commons.ShowConfirmBox(this, "确认开户吗?", "开户"))
            {
                btnAccConfirm.Enabled = true;
                return;
            }
            var r = new Dictionary <string, object>();

            r["au-id"]   = m_auId;
            r["user-id"] = cardId;
            var p = await InvestOrgs.UpdateRegistry(r);

            if (p.IsOk)
            {
                UpdateTable();
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            btnAccConfirm.Enabled = true;
        }
Ejemplo n.º 3
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.º 4
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.º 5
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.º 6
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;
        }
 private async void DelPrj() {
     btnDelete.Enabled = false;
     if (Commons.ShowConfirmBox(this, string.Format("提前撤销“{0}”,此操作不可恢复,是否继续"
         , myGridViewBinding1.GetSelectedValues<string>("itemName").FirstOrDefault()))) {
         var p = await CreditAssignProjs.CancelProj(myGridViewBinding1.GetSelectedValues<long>("pId").FirstOrDefault());
         if (p.IsOk) {
             UpdateTable1();
         } else {
             Commons.ShowResultErrorBox(this, p);
         }
     }
     btnDelete.Enabled = true;
 }
Ejemplo n.º 8
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 + " 的密码已被重置。");
            }
        }
        private async void Del(IList <string> idArray)
        {
            toolStrip1.Enabled = false;
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "确定清空协议嘛?", "清空"))
            {
                foreach (var id in idArray)
                {
                    await Files.Delete(id, "");
                }
                UpdateTable();
            }

            toolStrip1.Enabled = true;
        }
Ejemplo n.º 10
0
        private async void ClosePrj()
        {
            btnPrjClose.Enabled = false;
            var temp = await Projects.Bonus(m_pId);

            string tips = "";

            if (temp.IsOk)
            {
                var dl = JArray.Parse(temp.AsString).ToList();
                if (dl.Count > 0)
                {
                    decimal unpaidAmt = 0;
                    foreach (var d in dl)
                    {
                        unpaidAmt += d["amt"].ToDecimal() - d["paidAmt"].ToDecimal();
                    }
                    if (unpaidAmt != 0)
                    {
                        tips = string.Format("尚有 {0:N} 元未还款,", unpaidAmt);
                    }
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, temp);
                btnPrjClose.Enabled = true;
                return;
            }

            if (Commons.ShowConfirmBox(this, tips + "确定结清此企业贷吗?", "结清"))
            {
                var p = await Projects.Complete(m_pId);

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

            btnPrjClose.Enabled = true;
        }
Ejemplo n.º 11
0
        private async void CancelAssign()
        {
            btnCancelAssign.Enabled = false;
            if (Commons.ShowConfirmBox(this, "确定取消该客户经理?"))
            {
                var p = await CrmInvestor.UnBindMgr(m_ciId);

                if (p.IsOk)
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            }
            btnCancelAssign.Enabled = true;
        }
Ejemplo n.º 12
0
        private async void Del()
        {
            var delMgr = treeView1.SelectedNode.Text;

            if (Commons.ShowConfirmBox(this, string.Format("确认删除{0}吗?此操作无法被撤销。", delMgr)))
            {
                var p = await CrmInvestor.DeleteManager(delMgr);

                if (p.IsOk)
                {
                    UpdateTable1();
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            }
        }
Ejemplo n.º 13
0
        private async void UnLock()
        {
            btnUnLock.Enabled = false;
            if (Commons.ShowConfirmBox(this, "确定解锁该账户吗?"))
            {
                var p = await InvestBase.Unlock(m_auId);

                if (p.IsOk)
                {
                    UpdateTable();
                    Commons.ShowInfoBox(this, "解锁成功");
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            }
            btnUnLock.Enabled = true;
        }
Ejemplo n.º 14
0
        private async void DelFile()
        {
            btnDel.Enabled = false;
            if (Commons.ShowConfirmBox(this, "确定删除此上传文件吗?", "删除"))
            {
                var p = await Projects.LoanFileDelete(myGridViewBinding1.GetSelectedValues <long>("tlhId").FirstOrDefault()
                                                      , myGridViewBinding1.GetSelectedValues <long>("batch").FirstOrDefault());

                if (p.IsOk)
                {
                    myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "tlhId");
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            }
            btnDel.Enabled = true;
        }
Ejemplo n.º 15
0
        private async void CancelTenders()
        {
            if (!Commons.ShowConfirmBox(this, "将“整个项目”中途流标,此操作无法撤销!确认吗?"))
            {
                return;
            }
            btnCancelTenders.Enabled = false;
            var p = new Dictionary <string, object>();

            p["pid"]    = m_pId;
            p["remark"] = "流标";
            var r = await Projects.BusVpStopRaising(p);

            if (!r.IsOk)
            {
                Commons.ShowResultErrorBox(this, r);
            }
            UpdateTable();
            btnCancelTenders.Enabled = true;
        }
Ejemplo n.º 16
0
        private async void DelFile()
        {
            btnUpdate.Enabled = false;
            if (Commons.ShowConfirmBox(this, "确定删除此上传文件吗?", "删除"))
            {
                var r = new Dictionary <string, object>();
                var p = await Projects.RepayFileDelete(myGridViewBinding1.GetSelectedValues <long>("trhId").FirstOrDefault()
                                                       , myGridViewBinding1.GetSelectedValues <long>("batch").FirstOrDefault());

                if (p.IsOk)
                {
                    UpdateTable();
                }
                else
                {
                    Commons.ShowResultErrorBox(this, p);
                }
            }
            btnUpdate.Enabled = true;
        }
Ejemplo n.º 17
0
        private async void Del(IList <Tuple <string, string> > delInfo)
        {
            toolStrip1.Enabled = false;
            var ss = delInfo.JoinSome();

            if (Commons.ShowConfirmBox(this, "确定清空协议嘛?", "清空"))
            {
                foreach (var single in delInfo)
                {
                    var d = new Dictionary <string, object>();
                    d["p-id"]      = m_pId;
                    d["file-name"] = single.Item1;
                    d["file-type"] = ALL_AGREEMENTS.FindByText(single.Item2);
                    await PrjSignAgreements.deleteAgreements(d);
                }
                UpdateTable();
            }

            toolStrip1.Enabled = true;
        }
Ejemplo n.º 18
0
        private async void ExecuteRepay() {
            if (!Commons.ShowConfirmBox(this, "确认执行吗?", "执行")) {
                return;
            }

            toolStrip1.Enabled = false;

            var d = new Dictionary<string, object>();
            d["p-id"] = m_pId;
            d["pbd-id"] = m_pbdId;
            d["tran-type"] = m_tranType;
            var r = await Projects.ExecuteRepays(d);
            if (r.IsOk) {
                UpdateData();
            } else {
                Commons.ShowResultErrorBox(this, r);
            }

            toolStrip1.Enabled = true;
        }
Ejemplo n.º 19
0
        private async void CancelTenders2()
        {
            btnCancelTenders2.Enabled = false;
            decimal totalAmt = 0;
            var     ttIds    = new List <long>();

            for (int i = 0; i < myGridViewBinding1.View.SelectedRows.Count; ++i)
            {
                totalAmt += Convert.ToDecimal(myGridViewBinding1.GetCellValue(myGridViewBinding1.View.SelectedRows[i].Index, "amt"));
                ttIds.Add(Convert.ToInt64(myGridViewBinding1.GetCellValue(myGridViewBinding1.View.SelectedRows[i].Index, "ttId")));
            }

            if (!Commons.ShowConfirmBox(this, string.Format("撤销选中的投标,共计{0:N}元,此操作无法撤销!确认吗?", totalAmt)))
            {
                btnCancelTenders2.Enabled = true;
                return;
            }

            foreach (var ttId in ttIds)
            {
                var p = new Dictionary <string, object>();
                p["tt-id"]  = ttId;
                p["remark"] = "撤销订单";

                var r = await Projects.CreateCancelTender(p);

                if (r.IsOk)
                {
                    var d = JObject.Parse(r.AsString);
                    var c = new JsonResult(d["ttId"].ToString());
                    myGridViewBinding1.BindTo(c, Commons.BindFlag.Delete, "ttId");
                }
                else
                {
                    Commons.ShowResultErrorBox(this, r);
                }
            }

            btnCancelTenders2.Enabled = true;
        }
Ejemplo n.º 20
0
        private async void Del(List <Tuple <string, string, string> > idArray)
        {
            string tips = "";

            for (int i = 0; i < idArray.Count; ++i)
            {
                tips += idArray[i].Item1;
                tips += i == (idArray.Count - 1) ? "," : "、";
            }

            if (Commons.ShowConfirmBox(this, "删除以下文件:" + tips + "此操作不可恢复!确认吗?"))
            {
                foreach (var id in idArray)
                {
                    await Files.Delete(id.Item2, id.Item3);
                }
                UpdateTable();
                listView1.SelectedItems.Clear();
                Commons.ShowInfoBox(this, "文件:" + tips + "已被删除");
            }
            btnDel.Enabled = true;
        }
Ejemplo n.º 21
0
        private async void ForbidRepay()
        {
            var pbdId = myGridViewBinding2.GetSelectedValues <long>("pbdId").FirstOrDefault();

            if (!Commons.ShowConfirmBox(this, string.Format("禁用还款明细 {0} 吗?禁用的还款明细不能再执行还款。", pbdId)))
            {
                return;
            }
            btnCancel.Enabled = false;
            var r = await Projects.DeleteBonusDetail(m_pId, pbdId);

            if (r.IsOk)
            {
                UpdateTable1();
                UpdateTable2();
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }
            btnCancel.Enabled = true;
        }
Ejemplo n.º 22
0
        private async void DeleteBorPer(IList <long> idArray)
        {
            var ss = idArray.JoinSome();

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

                    if (p.IsOk)
                    {
                        myGridViewBinding3.BindTo(p, Commons.BindFlag.Delete, "bpmpId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                Commons.ShowInfoBox(this, "借款人:" + ss + " 已被删除。");
            }
        }
Ejemplo n.º 23
0
        private async void ExecuteLoan()
        {
            if (!Commons.ShowConfirmBox(this, "确认执行吗?", "执行"))
            {
                return;
            }

            toolStrip1.Enabled = false;

            var r = await Projects.ExecuteLoan(m_pId);

            if (r.IsOk)
            {
                UpdateData();
            }
            else
            {
                Commons.ShowResultErrorBox(this, r);
            }

            toolStrip1.Enabled = true;
        }
Ejemplo n.º 24
0
        private async void Delete(IList <long> idArray)
        {
            var ss = idArray.JoinSome();

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

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "bpmpId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                Commons.ShowInfoBox(this, "借款人:" + ss + " 已被删除。");
            }
            btnDelete.Enabled = true;
        }
Ejemplo n.º 25
0
        private async void Del(IList <long> idArray)
        {
            btnDel.Enabled = false;
            var ss = idArray.JoinSome();

            if (Commons.ShowConfirmBox(this, "删除以下商户转帐:" + ss + " 此操作不可恢复!确认吗?"))
            {
                foreach (var id in idArray)
                {
                    var p = await BusinessTransfers.Delete(id);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "tbdId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
            }
            btnDel.Enabled = true;
        }
Ejemplo n.º 26
0
        private async void EditRcode()
        {
            string newRcode = "";

            if (Commons.ShowConfirmBox(this, "确认修改编号嘛?", "编号"))
            {
                newRcode = Commons.ShowInputDialog(this, "请输入新编号(只能输入大写字母和数字):", "修改编号", 300, new Regex("^[A-Z\\d]{0,11}$"));
            }
            if (newRcode == "")
            {
                return;
            }

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

            d["u-name"] = treeView1.SelectedNode.Text;
            d["r-code"] = newRcode;

            var p = await CrmInvestor.EditRCode(d);

            if (p.IsOk)
            {
                if (Convert.ToBoolean(p.AsString))
                {
                    UpdateTable1();
                    Commons.ShowInfoBox(this, "修改成功");
                }
                else
                {
                    Commons.ShowInfoBox(this, "修改失败");
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }
Ejemplo n.º 27
0
        private async void DeleteGuaranteePers(IList <long> idArray)
        {
            btnGuaranteePerDel.Enabled = false;
            var ss = idArray.JoinSome();

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

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "pgpId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                Commons.ShowInfoBox(this, "担保人:" + ss + " 已被删除。");
            }
            btnGuaranteePerDel.Enabled = true;
        }
Ejemplo n.º 28
0
        private async void Delete(IList <string> userNames)
        {
            btnDelete.Enabled = false;
            var ss = userNames.JoinSome();

            if (Commons.ShowConfirmBox(this, "删除以下用户:" + ss + " 此操作不可恢复!确认吗?"))
            {
                foreach (var userName in userNames)
                {
                    var p = await Security.Users.DeleteUser(userName);

                    if (p.IsOk)
                    {
                        myGridViewBinding1.BindTo(p, Commons.BindFlag.Delete, "userName");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                Commons.ShowInfoBox(this, "用户:" + ss + " 已被删除。");
            }
            btnDelete.Enabled = true;
        }
Ejemplo n.º 29
0
        private async void DeleteBorOrg(IList <long> idArray)
        {
            btnBorOrgDel.Enabled = false;
            var ss = idArray.JoinSome();

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

                    if (p.IsOk)
                    {
                        myGridViewBinding4.BindTo(p, Commons.BindFlag.Delete, "bpmoId");
                    }
                    else
                    {
                        Commons.ShowResultErrorBox(this, p);
                    }
                }
                Commons.ShowInfoBox(this, "借款机构:" + ss + " 已被删除。");
            }
            btnBorOrgDel.Enabled = true;
        }
Ejemplo n.º 30
0
        private async void SaveData()
        {
            var amt  = nudAmt.Value;
            var eAmt = Convert.ToDecimal(tbExpectedAmt.Text);

            if (amt <= 0)
            {
                Commons.ShowInfoBox(this, "还款金额必须大于零");
                nudAmt.Focus();
                return;
            }
            var dAmt = eAmt - amt;

            if (dAmt < 0)
            {
                Commons.ShowInfoBox(this, "差额不能小于零");
                nudAmt.Focus();
                return;
            }
            var tranNo   = myGridViewBinding1.GetSelectedValues <int>("tranNo").FirstOrDefault();
            var tranType = myGridViewBinding1.GetSelectedValues <string>("tranType").FirstOrDefault();
            var payType  = rbNormal.Checked ? 1 : rbNominal.Checked ? 3 : rbReverse.Checked ? 2 : 0;
            var sPayType = payType == 1 ? "正常还款" : payType == 3 ? "名义借款人还款" : payType == 2 ? "保证金还款" : "";

            if (Commons.ShowConfirmBox(this, string.Format(
                                           "来源:{0:N}\r\n" +
                                           "金额:{1:N}\r\n" +
                                           "差额:{2:N}\r\n" +
                                           "还款时间:{3:G}\r\n" +
                                           "期数:{4}\r\n" +
                                           "类型:{5}\r\n" +
                                           "\n发起还款么?", sPayType, nudAmt.Value, tbDiffAmt.Text, dtpDatePoint.Value,
                                           tranNo, TRAN_TYPES.FindByValue(tranType))))
            {
                string vf = "";
                var    r  = new Dictionary <string, object>();
                r.AddVF("pid", m_pId, ref vf)
                .AddVF("tran-no", tranNo, ref vf)
                .AddVF("tran-type", tranType, ref vf)
                .AddVF("pay-type", payType, ref vf)
                .AddVF("amt", amt, ref vf)
                .AddVF("paid-time", dtpDatePoint.Value, ref vf)
                .AddVF("remark", tbComments.Text.LeftStr(2000), ref vf);
                r["signature"] = Verification.GetSha1(vf);

                var p = await Projects.SaveBonusDetail(r);

                if (p.IsOk)
                {
                    panel1.Visible = false;
                    UpdateTable1();
                    UpdateTable2();

                    if (dAmt > 0 && tranType == "0")
                    {
                        Commons.ShowWarnBox(this, "刚才发起的还息不是足额还款。如果是提前还款,请执行还息后立刻足额还本");
                    }
                    var p2 = await Projects.RepayFileUploadTime();

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