public OutAccumulatedLoan GetAccumulatedLoan(string executiveID) { OutAccumulatedLoan data = new OutAccumulatedLoan(); try { ComplianceGoalDAO dao = new ComplianceGoalDAO(); data = dao.GetAccumulatedLoan(executiveID); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManageComplianceGoal", "GetAccumulatedLoan", ex, ""); } return(data); }
public OutAccumulatedLoan GetAccumulatedLoan(string executiveID) { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutAccumulatedLoan response = new OutAccumulatedLoan(); var ora = new OracleServer(connectionString); AccumulatedLoan accumulated; List <AccumulatedLoan> list = new List <AccumulatedLoan>(); string command = string.Empty; try { command = "SELECT BBS_LIQCOM_V_COLOCA.CEDULA_ASESOR, BBS_LIQCOM_V_COLOCA.MES, BBS_LIQCOM_V_COLOCA.MONTO, BBS_LIQCOM_V_COLOCA.NRO_CREDITOS "; command = command + string.Format(" FROM BBS_LIQCOM_V_COLOCA WHERE BBS_LIQCOM_V_COLOCA.CEDULA_ASESOR = '{0}' ", executiveID); var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { accumulated = new AccumulatedLoan(); accumulated.amount = DBNull.Value.Equals(rdr["MONTO"]) ? 0 : double.Parse(rdr["MONTO"].ToString()); accumulated.executiveID = DBNull.Value.Equals(rdr["CEDULA_ASESOR"]) ? string.Empty : rdr["CEDULA_ASESOR"].ToString(); accumulated.month = DBNull.Value.Equals(rdr["MES"]) ? string.Empty : rdr["MES"].ToString(); accumulated.loanCount = DBNull.Value.Equals(rdr["NRO_CREDITOS"]) ? 0 : double.Parse(rdr["NRO_CREDITOS"].ToString()); list.Add(accumulated); } rdr.Close(); response.lstAccumulatedLoan = list; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("ComplianceGoalDAO.GetBalancesCommissions", ex); } finally { ora.Dispose(); } return(response); }