예제 #1
0
파일: BaseForm.cs 프로젝트: lhxon/Depositor
 /// <summary>
 /// 保存按钮下的事件响应
 /// </summary>
 protected virtual void SaveButtonCall()
 {
     if (IsSavedOK == true)
     {
         IMessageBox.ShowInformationOK("保存成功!");
     }
     else
     {
         IMessageBox.ShowWarning("保存失败");
     }
 }
예제 #2
0
        /// <summary>
        /// 缩短本息
        /// </summary>
        /// <param name="bigRepayAmount">还款金额</param>
        /// <returns></returns>
        public DataTable Recalculate(double bigRepayAmount)
        {
            sumDebtAfterBigRepay  = GlobalObject.Debt.SumDebt;
            sumDebtAfterBigRepay -= bigRepayAmount;
            sumDebtAfterBigRepay -= GlobalObject.Debt.FinishedCapitalSumAt(_bigRepayTime);
            if (sumDebtAfterBigRepay < 0)
            {
                IMessageBox.ShowWarning(string.Format("{0}万元即将全部还清所有贷款!", bigRepayAmount));
                return(new DataTable());
            }

            FillDebtDatagridViewAfterTimeNow();
            return(dataTableAfterNow);
        }
예제 #3
0
        private void DebtAnalysisDlg_Load(object sender, EventArgs e)
        {
            try
            {
                GlobalObject.GetGlobalDebtInstance();

                double finishedAmount = GlobalObject.Debt.FinishedPaymentSumAt(DateTime.Now);
                if (finishedAmount < 0)
                {
                    finishedAmount = 0;
                }
                double unfinishedAmount = GlobalObject.Debt.LeftDebtAt(DateTime.Now);
                if (unfinishedAmount < 0)
                {
                    unfinishedAmount = 0;
                }
                double finishedCapital = GlobalObject.Debt.FinishedCapitalSumAt(DateTime.Now);
                if (finishedCapital < 0)
                {
                    finishedCapital = 0;
                }
                double unfinishedCapital = GlobalObject.Debt.SumDebt - finishedCapital;
                if (unfinishedCapital <= 0)
                {
                    unfinishedCapital = 0;
                }
                double finishedInterest = GlobalObject.Debt.FinishedInterestSumAt(DateTime.Now);
                if (finishedInterest < 0)
                {
                    finishedInterest = 0;
                }
                double unfinishedInterest = GlobalObject.Debt.LeftInterestAt(DateTime.Now);
                if (unfinishedCapital <= 0 || unfinishedInterest < 0)
                {
                    unfinishedInterest = 0;
                }

                this.capInterTxt.Text = string.Format("{0} 元", Math.Round(finishedAmount * 1e4, 0));
                this.capTxt.Text      = string.Format("{0} 元", Math.Round(finishedCapital * 1e4, 0));
                this.interTxt.Text    = string.Format("{0} 元", Math.Round(finishedInterest * 1e4, 0));

                this.unPaidCapInterTxt.Text = string.Format("{0} 元", Math.Round(unfinishedAmount * 1e4, 0));
                this.unPaidCapTxt.Text      = string.Format("{0} 元", Math.Round(unfinishedCapital * 1e4, 0));
                this.unPaidInterTxt.Text    = string.Format("{0} 元", Math.Round(unfinishedInterest * 1e4, 0));
            }
            catch (Exception ex)
            {
                IMessageBox.ShowWarning(ex.Message);
            }
        }
예제 #4
0
 //大额还贷分析
 private void EarlyBigPayToolStripBtn_Click(object sender, EventArgs e)
 {
     try
     {
         closeOpenedForm(typeof(EarlyPayDlg), this);
         EarlyPayDlg earlyDlg = new EarlyPayDlg();
         earlyDlg.MdiParent = this;
         earlyDlg.Dock      = DockStyle.Fill;
         earlyDlg.Show();
     }
     catch (Exception ex)
     {
         IMessageBox.ShowWarning(ex.Message);
     }
 }
예제 #5
0
 //贷款分析
 private void DebtAnalysisToolStripBtn_Click(object sender, EventArgs e)
 {
     try
     {
         closeOpenedForm(typeof(DebtAnalysisDlg), this);
         DebtAnalysisDlg debtAnaDlg = new DebtAnalysisDlg();
         debtAnaDlg.MdiParent = this;
         debtAnaDlg.Dock      = DockStyle.Fill;
         debtAnaDlg.Show();
     }
     catch (Exception ex)
     {
         IMessageBox.ShowWarning(ex.Message);
     }
 }
예제 #6
0
 protected override void SaveButtonCall()
 {
     try
     {
         BuildInvestModelInstance();
         xmlTools.UpdateXML("InvestmentSetting.xml", earnings);
         GlobalObject.Investment = earnings;
         IsSavedOK = true;
     }
     catch (Exception ex)
     {
         IsSavedOK = false;
         IMessageBox.ShowWarning(ex.Message);
     }
     base.SaveButtonCall();
 }
예제 #7
0
        // Load事件
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                GlobalObject.GetGlobalDebtInstance();
                debtAnal = new DebtAnalysis();

                var startPage = new StartPageForm();
                startPage.MdiParent = this;
                startPage.Dock      = DockStyle.Fill;
                startPage.Show();
            }
            catch (Exception ex)
            {
                IMessageBox.ShowWarning(ex.Message);
            }
        }
예제 #8
0
 protected override void SaveButtonCall()
 {
     try
     {
         BuildDebtModelInstance();
         xmlTools.UpdateXML("DebtSetting.xml", debt);
         IsSavedOK = true;
         DebtAnalysisDlg debtAnaDlg = new DebtAnalysisDlg();
         debtAnaDlg.MdiParent = GlobalObject.MainForm;
         debtAnaDlg.Dock      = DockStyle.Fill;
         debtAnaDlg.Show();
     }
     catch (Exception ex)
     {
         IsSavedOK = false;
         IMessageBox.ShowWarning(ex.Message);
     }
     base.SaveButtonCall();
 }
예제 #9
0
        private void calcuBtn_Click(object sender, EventArgs e)
        {
            try
            {
                GlobalObject.GetGlobalDebtInstance();

                updateInterfaceImplemation();

                if (iearyDebt == null)
                {
                    IMessageBox.ShowWarning("请选择一种还款方式!");
                    return;
                }
                if (string.IsNullOrEmpty(planBigPayAmountTxt.Text))
                {
                    IMessageBox.ShowWarning("请填写计划还款金额!");
                    return;
                }

                if (DateTime.Parse(this.planBigRepayTimeDTP.Value.ToString("yyyy-MM-01")) < DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")))
                {
                    IMessageBox.ShowWarning("计划还贷时间早于当前时间!请设置一个以后的时间");
                    return;
                }

                detailTable = iearyDebt.Recalculate(Convert.ToDouble(planBigPayAmountTxt.Text));

                this.capInterTxt.Text = string.Format("{0} 元", (Math.Round(iearyDebt.LeftSumCapitalInterest, 2) * 1e4).ToString());
                this.capTxt.Text      = string.Format("{0} 元", (Math.Round(iearyDebt.LeftSumCapital, 2) * 1e4).ToString());
                this.interTxt.Text    = string.Format("{0} 元", (Math.Round(iearyDebt.LeftSumInterest, 2) * 1e4).ToString());
                double saveInter = GlobalObject.Debt.LeftInterestAt(DateTime.Now) - iearyDebt.LeftSumInterest;
                this.savedInterestTxt.Text = string.Format("{0} 元", (Math.Round(saveInter, 2) * 1e4).ToString());

                fillChart(this.chart1);
            }
            catch (Exception ex)
            {
                IMessageBox.ShowWarning(ex.Message);
            }
        }
예제 #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="box"></param>
 /// <param name="msg"></param>
 public static void ShowWarning(this IMessageBox box, string msg)
 {
     box.ShowWarning(msg, "警告");
 }