public OutSummaryPQR GetSummaryPQR(string executiveID) { var response = new OutSummaryPQR(); try { PqrDAO dao = new PqrDAO(); response = dao.GetSummaryPQR(executiveID); } catch (Exception ex) { //escribir en el log LogHelper.WriteLog("Models", "ManagerPQR", "GetSummaryPQR", ex, ""); } return(response); }
public OutSummaryPQR GetSummaryPQR(string executiveID) { string connectionString = DataBaseHelper.GetConnectionString("DLG"); OutSummaryPQR response = new OutSummaryPQR(); List <SummaryPQR> summaryList = new List <SummaryPQR>(); var ora = new OracleServer(connectionString); string command = string.Empty; try { command = "SELECT TO_CHAR(BBS_LIQCOM_V_PQRS.FECHA_INSERTA_SYS,'MM/YYYY') AS MES, BBS_LIQCOM_V_PQRS.NOMBRE_PROCESO, BBS_LIQCOM_V_PQRS.ESTADO, " + "BBS_LIQCOM_V_PQRS.NOMBRE_ESTADO, COUNT(*) AS NRO_ACLARACIONES FROM BBS_LIQCOM_V_PQRS "; command = command + string.Format(" WHERE CEDULA = '{0}'", executiveID); command = command + "GROUP BY TO_CHAR(BBS_LIQCOM_V_PQRS.FECHA_INSERTA_SYS, 'MM/YYYY'), BBS_LIQCOM_V_PQRS.NOMBRE_PROCESO, "; command = command + "BBS_LIQCOM_V_PQRS.ESTADO, BBS_LIQCOM_V_PQRS.NOMBRE_ESTADO ORDER BY TO_CHAR(BBS_LIQCOM_V_PQRS.FECHA_INSERTA_SYS,'MM/YYYY'), "; command = command + "BBS_LIQCOM_V_PQRS.NOMBRE_PROCESO, BBS_LIQCOM_V_PQRS.ESTADO"; var rdr = ora.ExecuteCommand(command); while (rdr.Read()) { SummaryPQR summary = new SummaryPQR(); summary.month = DBNull.Value.Equals(rdr["MES"]) ? string.Empty : rdr["MES"].ToString(); summary.processName = DBNull.Value.Equals(rdr["NOMBRE_PROCESO"]) ? string.Empty : rdr["NOMBRE_PROCESO"].ToString(); summary.status = DBNull.Value.Equals(rdr["ESTADO"]) ? 0 : double.Parse(rdr["ESTADO"].ToString()); summary.stateName = DBNull.Value.Equals(rdr["NOMBRE_ESTADO"]) ? string.Empty : rdr["NOMBRE_ESTADO"].ToString(); summary.PQRNumber = DBNull.Value.Equals(rdr["NRO_ACLARACIONES"]) ? 0 : double.Parse(rdr["NRO_ACLARACIONES"].ToString()); summaryList.Add(summary); } rdr.Close(); response.lstSummaryPQR = summaryList; response.msg = new Response(); response.msg.errorCode = "200"; response.msg.errorMessage = "OK"; } catch (Exception ex) { throw new Exception("PqrDAO.GetLoanResume", ex); } finally { ora.Dispose(); } return(response); }