示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (this.cmbWayOfRepayment.SelectedIndex == 0)
            {
                MessageBox.Show("请选择还款方式!");
                return;
            }

            Model.BillModel billModel            = GetBillModel();
            List <Model.BillDetailModel> details = WayOfRepayment.GetDetailsByBillInfo(ref billModel);

            if (details != null && details.Count > 0)
            {
                ShowList(details);
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.cmbWayOfRepayment.SelectedIndex == 0)
            {
                MessageBox.Show("请选择还款方式!");
                return;
            }

            Model.BillModel billModel            = GetBillModel();
            List <Model.BillDetailModel> details = WayOfRepayment.GetDetailsByBillInfo(ref billModel);

            StringBuilder builder = new StringBuilder();

            builder.Append("Insert into billInfo (BillID ,SiteName,SiteUserName,TotalMoney,YearRete,Deadline,DeadlineType,ReceivedPeriod,ReceivablePeriod,ReceivablePrincipalAndInterest,ReceivedPrincipalAndInterest,WayOfRepayment,Reward,BeginDay,EndDay,YuQiCount,Deleted,Flag,Remark,UpdateTime,Createtime)");
            builder.Append(string.Format("Values('{0}','{1}','{2}',{3},{4},{5},{6},0,{7},{8},{9},{10},{11},'{12}','{13}',{14},{15},{16},'{17}','{18}','{19}')",
                                         billModel.BillID, billModel.SiteName, billModel.SiteUserName, billModel.TotalMoney, billModel.YearRete,
                                         billModel.Deadline, billModel.DeadlineType, billModel.ReceivablePeriod, billModel.ReceivablePrincipalAndInterest,
                                         billModel.ReceivedPrincipalAndInterest, (int)billModel.WayOfRepayment, billModel.Reward, billModel.BeginDay,
                                         billModel.EndDay, billModel.YuQiCount, billModel.Deleted, billModel.Deleted, billModel.Remark,
                                         billModel.UpdateTime.ToString("s"), billModel.CreateTime.ToString("s")));

            for (int i = 0; i < details.Count; i++)
            {
                builder.Append("|");    //语句分隔符
                builder.Append("Insert into billdetail( BillDetailID,BillID,Periods,ReceivableDay,ReceivedDay,ReceivablePrincipalAndInterest,ReceivableInterest,ReceivedPrincipalAndInterest,IsYuQi,Deleted,Flag,UpdateTime,CreateTime)");
                builder.Append(string.Format("Values('{0}','{1}','{2}','{3}','{4}',{5},{6},{7},{8},{9},{10},'{11}','{12}')",
                                             details[i].BillDetailID, details[i].BillID, details[i].Periods, details[i].ReceivableDay,
                                             details[i].ReceivedDay, details[i].ReceivablePrincipalAndInterest,
                                             details[i].ReceivableInterest, details[i].ReceivedPrincipalAndInterest,
                                             details[i].IsYuQi, details[i].Deleted, details[i].Flag, details[i].UpdateTime.ToString("s"),
                                             details[i].CreateTime.ToString("s")));
            }


            bool flag = SQLiteHelper.UpdateData(builder.ToString(), true);

            if (flag)
            {
                AppInfo.Instance.IsChanged = true;
                MessageBox.Show("添加成功!");
            }
            else
            {
                MessageBox.Show("添加失败!");
            }
        }
示例#3
0
        private void button4_Click(object sender, EventArgs e)
        {
            int    qixian     = int.Parse(textBox1.Text.Trim());
            double totalmoney = double.Parse(txtjine.Text.Trim());
            double pref       = double.Parse(textBox2.Text.Trim());

            double[][] infos = WayOfRepayment.MonthInterestSeasonCapital(qixian, totalmoney, pref);

            StringBuilder builder = new StringBuilder();

            builder.Append("按月还息按季还本\r\n");
            builder.Append("期数  回款金额    利息\r\n");
            for (int i = 0; i < qixian; i++)
            {
                builder.Append(string.Format("{0}      {1}       {2}\r\n", i + 1, infos[0][i], infos[1][i]));
            }
            this.richTextBox1.Text = builder.ToString();
        }
示例#4
0
        private void button4_Click(object sender, EventArgs e)
        {
            var list = WayOfRepayment.GetDetailsByMonthInterestSeasonCapital(this.GetBillModel());

            ShowList(list);
        }
示例#5
0
        private void button2_Click(object sender, EventArgs e)
        {
            var list = WayOfRepayment.GetDetailsByEveragePrincipalAndInterest(this.GetBillModel());

            ShowList(list);
        }