/// <summary> /// Сохранение введённых данных /// </summary> /// <param name="n">Срок кредита</param> /// <param name="type">Тип платежа</param> /// <param name="sPayment">Размер комиссии</param> /// <param name="s">Размер кредита</param> /// <param name="p">Годовая ставка</param> /// <param name="date">Дата получения кредита</param> /// <param name="equalPayment">Величина уплаты при платеже равными суммами</param> public void SaveData(double s, double p, int n, ServicePaymentType type = ServicePaymentType.NoFee, double sPayment = 0, DateTime date = default(DateTime), double equalPayment = 0) { var data = new Data(s, n, p / 100, type, sPayment) { StartDate = date, EqualPayment = equalPayment }; _data = data; }
/// <summary> /// Сохранение данных /// </summary> /// <param name="s">Сумма кредита</param> /// <param name="n">Количество месяцев</param> /// <param name="p">Годовая ставка</param> /// <param name="type">Тип платежа</param> /// <param name="sp">Величина комиссии</param> public Data(double s, int n, double p, ServicePaymentType type, double sp) { S = s; N = n; P = p; ServicePaymentType = type; SpValue = sp; Sp = new double[N]; PaymentLeft = new double[N]; GeneralPayment = new double[N]; this.p = new double[N]; Payment = new double[N]; Dates = new DateTime[N]; }