예제 #1
0
        public JiborListForm(AppData source)
        {
            InitializeComponent();
            this.data = source;

            CalendarColumn col = new CalendarColumn();

            col.HeaderText = "Tanggal";
            col.CellTemplate.Style.Format = "yyyy-MM-dd";

            DataGridViewCellStyle ds = new DataGridViewCellStyle();

            ds.Format = "N2";

            dataGridViewJiborList.Columns.Add(col);
            dataGridViewJiborList.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "Rate JIBOR", Width = 180, DefaultCellStyle = ds
            });
            dataGridViewJiborList.EditMode = DataGridViewEditMode.EditOnF2;
            //dataGridViewJiborList.AllowUserToAddRows = false;
            dataGridViewJiborList.AllowUserToOrderColumns = false;

            //List<Jibor> jiborList = data.JiborList.ToList();

            foreach (DataGridViewRow row in this.dataGridViewJiborList.Rows)
            {
                row.Cells[0].Value = null;
            }
            //dataGridViewJiborList.RowCount = 1;
        }
예제 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            CalendarColumn col = new CalendarColumn();

            this.dataGridView1.Columns.Add(col);
            this.dataGridView1.RowCount = 5;
            foreach (DataGridViewRow row in this.dataGridView1.Rows)
            {
                row.Cells[0].Value = DateTime.Now;
            }
        }
예제 #3
0
        public LoanForm()
        {
            InitializeComponent();

            CalendarColumn col = new CalendarColumn();

            col.HeaderText = "Tanggal";

            DataGridViewCellStyle ds = new DataGridViewCellStyle();

            ds.Format = "N2";

            dataGridViewPenarikan.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "Jumlah", Width = 180, DefaultCellStyle = ds
            });
            dataGridViewPenarikan.Columns.Add(col);
            dataGridViewPenarikan.EditMode                = DataGridViewEditMode.EditOnF2;
            dataGridViewPenarikan.AllowUserToAddRows      = false;
            dataGridViewPenarikan.AllowUserToOrderColumns = false;

            col            = new CalendarColumn();
            col.HeaderText = "Tanggal";
            dataGridViewPembayaran.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "Jumlah", Width = 180, DefaultCellStyle = ds
            });
            dataGridViewPembayaran.Columns.Add(col);
            dataGridViewPembayaran.EditMode                = DataGridViewEditMode.EditOnF2;
            dataGridViewPembayaran.AllowUserToAddRows      = false;
            dataGridViewPembayaran.AllowUserToOrderColumns = false;

            foreach (DataGridViewRow row in this.dataGridViewPenarikan.Rows)
            {
                row.Cells[0].Value = null;
            }
            dataGridViewPenarikan.RowCount = 1;

            foreach (DataGridViewRow row in this.dataGridViewPembayaran.Rows)
            {
                row.Cells[0].Value = null;
            }
            dataGridViewPembayaran.RowCount      = 1;
            dateTimePickerFirstRepayment.Enabled = false;

            dateTimePickerStartDate.Value = DateTime.Now;
        }
예제 #4
0
        public LoanForm(Loan loan)
        {
            InitializeComponent();
            CalendarColumn col = new CalendarColumn();

            col.HeaderText = "Tanggal";

            DataGridViewCellStyle ds = new DataGridViewCellStyle();

            ds.Format = "N2";

            dataGridViewPenarikan.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "Jumlah", Width = 180, DefaultCellStyle = ds
            });
            dataGridViewPenarikan.Columns.Add(col);
            dataGridViewPenarikan.EditMode                = DataGridViewEditMode.EditOnF2;
            dataGridViewPenarikan.AllowUserToAddRows      = false;
            dataGridViewPenarikan.AllowUserToOrderColumns = false;

            col            = new CalendarColumn();
            col.HeaderText = "Tanggal";
            dataGridViewPembayaran.Columns.Add(new DataGridViewTextBoxColumn()
            {
                HeaderText = "Jumlah", Width = 180, DefaultCellStyle = ds
            });
            dataGridViewPembayaran.Columns.Add(col);
            dataGridViewPembayaran.EditMode                = DataGridViewEditMode.EditOnF2;
            dataGridViewPembayaran.AllowUserToAddRows      = false;
            dataGridViewPembayaran.AllowUserToOrderColumns = false;

            if (loan.ListPenarikan == null)
            {
                loan.ListPenarikan = new List <Penarikan>();
            }

            if (loan.ListPenarikan.Count() > 0)
            {
                foreach (var penarikan in loan.ListPenarikan)
                {
                    dataGridViewPenarikan.Rows.Add(penarikan.Jumlah, penarikan.Tanggal);
                }
            }
            else
            {
                foreach (DataGridViewRow row in this.dataGridViewPenarikan.Rows)
                {
                    row.Cells[0].Value = null;
                }
                dataGridViewPenarikan.RowCount = 1;
            }

            foreach (DataGridViewRow row in this.dataGridViewPembayaran.Rows)
            {
                row.Cells[0].Value = null;
            }
            dataGridViewPembayaran.RowCount = 1;

            textBoxProfileName.Text       = loan.Name;
            textBoxBankName.Text          = loan.BankName;
            dateTimePickerStartDate.Value = loan.StartDate;
            numericGracePeriod.Value      = loan.GracePeriod;
            numericInterest.Value         = loan.InterestMonth;
            numericInterestRate.Value     = (decimal)loan.InterestRate;
            numericLimit.Value            = (decimal)loan.Limit;
            numericMargin.Value           = (decimal)loan.Margin;
            numericRepayment.Value        = loan.RepaymentMonth;
            numericTenor.Value            = loan.Tenor;
            if (loan.FirstRepaymentDate != null && loan.IsUsingFirstRepaymentDate)
            {
                dateTimePickerFirstRepayment.Value = loan.FirstRepaymentDate;
                checkBoxUseFirstRepayment.Checked  = loan.IsUsingFirstRepaymentDate;
            }
        }