Produced by Araxis Merge on 10/5/2018 9:05:45 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MHEDP3_VAOS_VATS_SM_Sept2018.zip\SM 2.4.0\scheduling-manager-web-2.4.0.zip\scheduling-manager\test\selenium-ruby\models | best_time_to_call.rb | Thu Jul 19 16:14:00 2018 UTC |
| 2 | MHEDP3_VAOS_VATS_SM_Sept2018.zip\SM 2.4.0\scheduling-manager-web-2.4.0.zip\scheduling-manager\test\selenium-ruby\models | best_time_to_call.rb | Fri Oct 5 20:09:47 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 222 |
| Changed | 1 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | #This clas s represen ts a best time to ca ll record and includ es related database methods | |
| 2 | ||
| 3 | require 'm ysql' | |
| 4 | ||
| 5 | class Best TimeToCall | |
| 6 | ||
| 7 | #TODO: p ut the dat abase conn ection inf o in a con fig file. | |
| 8 | HOST = ' localhost' | |
| 9 | USER = ' AI ' | |
| 10 | DBPASSWORD = 'A I ' | |
| 11 | SCHEMA = 'HADB' | |
| 12 | ||
| 13 | attr_acc essor :app ointment_r equest_id | |
| 14 | attr_acc essor :bes t_time | |
| 15 | ||
| 16 | def find ByAppointm entRequest Id(ar_id) | |
| 17 | ||
| 18 | #creat e the sql statement from the i ncoming ta rget_date | |
| 19 | begin | |
| 20 | con = Mysql.ne w(HOST, US ER, DBPASS WORD, SCHE MA) | |
| 21 | # co n = Mysql. new(dbconf ig.host, d bconfig.us ername, db config.pas sword, dbc onfig.data base) | |
| 22 | requ est_string = "SELECT * FROM HA DB.BEST_TI ME_TO_CALL where APP OINTMENT_R EQUEST_ID = '#{ar_id }';" | |
| 23 | puts "request_ string: #{ request_st ring}" | |
| 24 | rs = con.query (request_s tring) | |
| 25 | rs.e ach { |res ult| | |
| 26 | pu ts "#{resu lt}" | |
| 27 | # rcd = | |
| 28 | se lf.populat eFromDb(re sult)} | |
| 29 | con. close | |
| 30 | ||
| 31 | rescue Exception => e | |
| 32 | puts "MySQL Ex ception: " + e.to_s | |
| 33 | ||
| 34 | ensure | |
| 35 | puts "select s tatement e xecuted" | |
| 36 | end | |
| 37 | ||
| 38 | # retu rn rcd | |
| 39 | ||
| 40 | end | |
| 41 | ||
| 42 | ||
| 43 | # def po pulateDefa ultTestRec ord() | |
| 44 | # | |
| 45 | # self .appointme nt_request _id ='VAMC 3AR000006' #THIS IS THE SAME I D AS THE T EST AR POP ULATE METH OD WHICH M UST BE KEP T IN SYNC | |
| 46 | # self .best_time = '9 AM - 11 AM' | |
| 47 | # | |
| 48 | # self .insertRec ord(self) | |
| 49 | # puts "inserted record: / n#{self.fi ndAppointm entRequest ById(self. appointmen t_request_ id)}" | |
| 50 | # | |
| 51 | # end | |
| 52 | ||
| 53 | ||
| 54 | def popu lateFromDb (result) | |
| 55 | ||
| 56 | self.a ppointment _request_i d = result [0] | |
| 57 | self.b est_time = result[1] | |
| 58 | ||
| 59 | puts " -values from db: [ ar_dtl_cod e => #{ar_ detail_cod e_id}, dtl _code => # {detail_co de_id}, | |
| 60 | appt_rqst => #{appoi ntment_req uest_id}, created_dt => #{crea ted_date}, user => # {user_id}] " | |
| 61 | ||
| 62 | end | |
| 63 | ||
| 64 | # def in sertRecord (target_re cord) | |
| 65 | # #cre ate the in sert state ment and p ost to the db | |
| 66 | # begi n | |
| 67 | # co n = Mysql. new(HOST, USER, DBPA SSWORD, SC HEMA) | |
| 68 | # # con = Mysq l.new(dbco nfig.host, dbconfig. username, dbconfig.p assword, d bconfig.da tabase) | |
| 69 | # in sert_state ment = "IN SERT INTO `BEST_TIME _TO_CALL` | |
| 70 | # (`APPOIN TMENT_REQU EST_ID`, | |
| 71 | # `BEST_TI ME`) | |
| 72 | # VALUES ( '#{target_ record.app ointment_r equest_id} ', | |
| 73 | # '#{targe t_record.b est_time}' | |
| 74 | # );" | |
| 75 | # | |
| 76 | # pu ts "insert _statement : #{insert _statement }" | |
| 77 | # rs = con.que ry(insert_ statement) | |
| 78 | # rs .each { |r esult| put s "#{resul t}" } | |
| 79 | # co n.close | |
| 80 | # | |
| 81 | # resc ue Excepti on=>e | |
| 82 | # pu ts "MySQL Exception: " + e.to_ s | |
| 83 | # | |
| 84 | # ensu re | |
| 85 | # pu ts "insert statement executed" | |
| 86 | # end | |
| 87 | # | |
| 88 | # end | |
| 89 | ||
| 90 | def dele teRecordBy Id(record_ id) | |
| 91 | #creat e the sql statement from the i ncoming ta rget_date | |
| 92 | begin | |
| 93 | con = Mysql.ne w(HOST, US ER, DBPASS WORD, SCHE MA) | |
| 94 | # co n = Mysql. new(dbconf ig.host, d bconfig.us ername, db config.pas sword, dbc onfig.data base) | |
| 95 | rs = con.query ("Delete F ROM HADB.B EST_TIME_T O_CALL whe re APPOINT MENT_REQUE ST_ID= '#{ record_id} ';") | |
| 96 | rs.e ach { |res ult| | |
| 97 | pu ts "#{resu lt}"} | |
| 98 | con. close | |
| 99 | ||
| 100 | rescue Exception => e | |
| 101 | puts "MySQL Ex ception: " + e.to_s | |
| 102 | ||
| 103 | ensure | |
| 104 | puts "delete s tatement e xecuted" | |
| 105 | end | |
| 106 | end | |
| 107 | ||
| 108 | def dele teRecordBy Appointmen tRequestId (appointme nt_request _id) | |
| 109 | self.f indByAppoi ntmentRequ estId(appo intment_re quest_id) | |
| 110 | puts " record id: appt_rqst _id: #{sel f.appointm ent_reques t_id}; bes t_time: #{ self.best_ time}" | |
| 111 | self.d eleteRecor dById(self .appointme nt_request _id) | |
| 112 | end | |
| 113 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.