private void cboBranch_SelectedIndexChanged(object sender, EventArgs e) { try { dgvDetailList.Rows.Clear(); decimal _totalAmountDue = 0; decimal _totalRunningBalance = 0; decimal _totalCollection = 0; decimal _totalVariance = 0; decimal _totalLoanRelease = 0; decimal _totalServiceFee = 0; foreach (DataRow _dr in loLoanApplicationDetail.getEODLoanApplicationDetail(dtpDate.Value, cboBranch.SelectedValue.ToString()).Rows) { int i = dgvDetailList.Rows.Add(); dgvDetailList.Rows[i].Cells["CollectorId"].Value = _dr["CollectorId"].ToString(); dgvDetailList.Rows[i].Cells["CollectorName"].Value = _dr["Collector Name"].ToString(); dgvDetailList.Rows[i].Cells["TotalAmountDue"].Value = string.Format("{0:n}", decimal.Parse(_dr["Total Running Balance"].ToString())); dgvDetailList.Rows[i].Cells["TotalRunningBalance"].Value = string.Format("{0:n}", decimal.Parse(_dr["Total New Balance"].ToString())); dgvDetailList.Rows[i].Cells["TotalCollection"].Value = string.Format("{0:n}", decimal.Parse(_dr["Total Collection"].ToString())); dgvDetailList.Rows[i].Cells["TotalVariance"].Value = string.Format("{0:n}", decimal.Parse(_dr["Total Variance"].ToString())); //get Release Amount decimal _LoanAmount = 0; decimal _ServiceFeeAmount = 0; foreach (DataRow _drR in loLoanApplication.getForReleaseSheet(dtpDate.Value, _dr["CollectorId"].ToString()).Rows) { _LoanAmount += decimal.Parse(_drR["Loan Amount"].ToString()); _ServiceFeeAmount += decimal.Parse(_drR["Service Fee Amount"].ToString()); } dgvDetailList.Rows[i].Cells["TotalLoanRelease"].Value = string.Format("{0:n}", _LoanAmount); dgvDetailList.Rows[i].Cells["TotalServiceFee"].Value = string.Format("{0:n}", _ServiceFeeAmount); dgvDetailList.Rows[i].Cells["Remarks"].Value = ""; _totalAmountDue += decimal.Parse(_dr["Total Running Balance"].ToString()); _totalRunningBalance += decimal.Parse(_dr["Total New Balance"].ToString()); _totalCollection += decimal.Parse(_dr["Total Collection"].ToString()); _totalVariance += decimal.Parse(_dr["Total Variance"].ToString()); _totalLoanRelease += _LoanAmount; _totalServiceFee += _ServiceFeeAmount; } txtTotalAmountDue.Text = string.Format("{0:n}", _totalAmountDue); txtTotalRunningBalance.Text = string.Format("{0:n}", _totalRunningBalance); txtTotalCollection.Text = string.Format("{0:n}", _totalCollection); txtTotalVariance.Text = string.Format("{0:n}", _totalVariance); txtTotalLoanRelease.Text = string.Format("{0:n}", _totalLoanRelease); txtTotalServiceFee.Text = string.Format("{0:n}", _totalServiceFee); } catch { } }
private void getList() { try { dgvCollectionList.DataSource = loLoanApplicationDetail.getDailyCollectionSheet(dtpDate.Value, cboCollector.SelectedValue.ToString()); } catch { dgvCollectionList.DataSource = null; } try { dgvForRelease.DataSource = loLoanApplication.getForReleaseSheet(dtpDate.Value, cboCollector.SelectedValue.ToString()); } catch { dgvForRelease.DataSource = null; } }
public DataTable getForReleaseSheet(DateTime pReleaseDate, string pCollectorId) { return(loLoanApplication.getForReleaseSheet(pReleaseDate, pCollectorId)); }