Exemplo n.º 1
0
        /// <summary>
        /// 获取配置的贷款实例
        /// </summary>
        public static void GetGlobalDebtInstance()
        {
            var xmlTools = new XMLTools();

            //加载贷款设置数据
            xmlTools.ReadFromXML("DebtSetting.xml", typeof(MDebt));
            var debtDict = xmlTools.XmlAttributeDict;
            var mobject  = ConvertDictToMObject(xmlTools.XmlAttributeDict, debtDict["DebtType"].ToString());

            if (((MDebt)mobject).DebtType == DebtType.MEqualCaptial)
            {
                debt = (MEqualCaptial)mobject;
            }
            else
            {
                debt = (MEqualInterest)mobject;
            }
        }
Exemplo n.º 2
0
        public DebtAnalysis()
        {
            if (GlobalObject.Debt.DebtType == DebtType.MEqualCaptial)
            {
                idebt = new MEqualCaptial();
            }
            else
            {
                idebt = new MEqualInterest();
            }

            idebt = GlobalObject.Debt;
            if (idebt == null)
            {
                throw new ArgumentException("请先进行贷款设置!");
            }
            debtTime = idebt.OnDebtTime;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 为贷款分析表填充数据
 /// </summary>
 public void FillDebtDatagridViewBeforeTimeNow(DataGridView debtDgview)
 {
     dateTableBeforeNow = new DataTable();
     idebt = GlobalObject.Debt;
     setTableStructure();
     dateTableBeforeNow.Columns.AddRange(columns);
     for (int i = 1; i < idebt.TimeLengthMonth + 1; i++)
     {
         var row  = dateTableBeforeNow.NewRow();
         var time = debtTime.AddMonths(i);
         if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01")) < DateTime.Parse(time.ToString("yyyy-MM-01")))
         {
             break;
         }
         setRowData(row, i, time);
         dateTableBeforeNow.Rows.Add(row);
     }
     debtDgview.DataSource = dateTableBeforeNow;
 }