public List <CashflowDTO> GetExstingloandetails(string applicationid, string ConnectionString) { lstCashflow = new List <CashflowDTO>(); try { using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "SELECT LOANNAME,CASE WHEN LOANPAYIN='Daily' THEN INSTALMENTAMOUNT*365 WHEN LOANPAYIN='Weakly' THEN INSTALMENTAMOUNT*58 WHEN LOANPAYIN='Monthly' THEN INSTALMENTAMOUNT*12 WHEN LOANPAYIN='Queatrly' THEN INSTALMENTAMOUNT*4 WHEN LOANPAYIN='Half Yearly' THEN INSTALMENTAMOUNT*2 ELSE INSTALMENTAMOUNT END AS INSTALMENTAMOUNT FROM TABAPPLICATIONEXISTINGLOANS WHERE VCHAPPLICATIONID='" + applicationid + "' and statusid=1 ;")) while (dr.Read()) { CashflowDTO objSavingdetails = new CashflowDTO(); objSavingdetails.pLoanname = dr["LOANNAME"].ToString(); objSavingdetails.pInstalmentamount = Convert.ToDecimal(dr["INSTALMENTAMOUNT"]); lstCashflow.Add(objSavingdetails); } } catch (Exception ex) { throw ex; } return(lstCashflow); }
public List <CashflowDTO> GetSavingdetails(string applicationid, string ConnectionString) { lstCashflow = new List <CashflowDTO>(); try { using (NpgsqlDataReader dr = NPGSqlHelper.ExecuteReader(ConnectionString, CommandType.Text, "select tci.applicantype||'-'||Tms.name||' '||tms.surname AS NAME,(COALESCE(netannualincome,0)-COALESCE(AVERAGEANNUALEXPENSES,0)) AS SAVINGS from TABAPPLICATIONPERSONALINCOMEDETAILS tci join tblmstcontact tms on tci.contactreferenceid=tms.contactreferenceid WHERE VCHAPPLICATIONID = '" + applicationid + "'")) while (dr.Read()) { CashflowDTO objSavingdetails = new CashflowDTO(); objSavingdetails.pName = dr["NAME"].ToString(); objSavingdetails.pSavingsamount = Convert.ToDecimal(dr["SAVINGS"]); lstCashflow.Add(objSavingdetails); } } catch (Exception ex) { throw ex; } return(lstCashflow); }