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 | ar_detail_code.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 | ar_detail_code.rb | Fri Oct 5 20:09:25 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 234 |
| 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 ArDe tailCode | |
| 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 :ar_ detail_cod e_id | |
| 14 | attr_acc essor :det ail_code_i d | |
| 15 | attr_acc essor :app ointment_r equest_id | |
| 16 | attr_acc essor :cre ated_date | |
| 17 | attr_acc essor :use r_id | |
| 18 | ||
| 19 | def find ByAppointm entRequest Id(ar_id) | |
| 20 | ||
| 21 | #creat e the sql statement from the i ncoming ta rget_date | |
| 22 | begin | |
| 23 | con = Mysql.ne w(HOST, US ER, DBPASS WORD, SCHE MA) | |
| 24 | # co n = Mysql. new(dbconf ig.host, d bconfig.us ername, db config.pas sword, dbc onfig.data base) | |
| 25 | requ est_string = "SELECT * FROM HA DB.AR_DETA IL_CODE wh ere APPOIN TMENT_REQU EST_ID = ' #{ar_id}'; " | |
| 26 | puts "request_ string: #{ request_st ring}" | |
| 27 | rs = con.query (request_s tring) | |
| 28 | rs.e ach { |res ult| | |
| 29 | pu ts "#{resu lt}" | |
| 30 | # rcd = | |
| 31 | se lf.populat eFromDb(re sult)} | |
| 32 | con. close | |
| 33 | ||
| 34 | rescue Exception => e | |
| 35 | puts "MySQL Ex ception: " + e.to_s | |
| 36 | ||
| 37 | ensure | |
| 38 | puts "select s tatement e xecuted" | |
| 39 | end | |
| 40 | ||
| 41 | # retu rn rcd | |
| 42 | ||
| 43 | end | |
| 44 | ||
| 45 | ||
| 46 | # def po pulateDefa ultTestRec ord() | |
| 47 | # | |
| 48 | # 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 | |
| 49 | # self .best_time = '9 AM - 11 AM' | |
| 50 | # | |
| 51 | # self .insertRec ord(self) | |
| 52 | # puts "inserted record: / n#{self.fi ndAppointm entRequest ById(self. appointmen t_request_ id)}" | |
| 53 | # | |
| 54 | # end | |
| 55 | ||
| 56 | ||
| 57 | def popu lateFromDb (result) | |
| 58 | ||
| 59 | self.a r_detail_c ode_id = r esult[0] | |
| 60 | self.d etail_code _id = resu lt[1] | |
| 61 | self.a ppointment _request_i d = result [2] | |
| 62 | self.c reated_dat e = result [3] | |
| 63 | self.u ser_id = r esult[4] | |
| 64 | ||
| 65 | puts " -values from db: [ ar_dtl_cod e => #{ar_ detail_cod e_id}, dtl _code => # {detail_co de_id}, | |
| 66 | appt_rqst => #{appoi ntment_req uest_id}, created_dt => #{crea ted_date}, user => # {user_id}] " | |
| 67 | ||
| 68 | end | |
| 69 | ||
| 70 | # def in sertRecord (target_re cord) | |
| 71 | # #cre ate the in sert state ment and p ost to the db | |
| 72 | # begi n | |
| 73 | # co n = Mysql. new(HOST, USER, DBPA SSWORD, SC HEMA) | |
| 74 | # # con = Mysq l.new(dbco nfig.host, dbconfig. username, dbconfig.p assword, d bconfig.da tabase) | |
| 75 | # in sert_state ment = "IN SERT INTO `BEST_TIME _TO_CALL` | |
| 76 | # (`APPOIN TMENT_REQU EST_ID`, | |
| 77 | # `BEST_TI ME`) | |
| 78 | # VALUES ( '#{target_ record.app ointment_r equest_id} ', | |
| 79 | # '#{targe t_record.b est_time}' | |
| 80 | # );" | |
| 81 | # | |
| 82 | # pu ts "insert _statement : #{insert _statement }" | |
| 83 | # rs = con.que ry(insert_ statement) | |
| 84 | # rs .each { |r esult| put s "#{resul t}" } | |
| 85 | # co n.close | |
| 86 | # | |
| 87 | # resc ue Excepti on=>e | |
| 88 | # pu ts "MySQL Exception: " + e.to_ s | |
| 89 | # | |
| 90 | # ensu re | |
| 91 | # pu ts "insert statement executed" | |
| 92 | # end | |
| 93 | # | |
| 94 | # end | |
| 95 | ||
| 96 | def dele teRecordBy Id(record_ id) | |
| 97 | #creat e the sql statement from the i ncoming ta rget_date | |
| 98 | begin | |
| 99 | con = Mysql.ne w(HOST, US ER, DBPASS WORD, SCHE MA) | |
| 100 | # co n = Mysql. new(dbconf ig.host, d bconfig.us ername, db config.pas sword, dbc onfig.data base) | |
| 101 | rs = con.query ("Delete F ROM HADB.A R_DETAIL_C ODE where AR_DETAIL_ CODE_ID= ' #{record_i d}';") | |
| 102 | rs.e ach { |res ult| | |
| 103 | pu ts "#{resu lt}"} | |
| 104 | con. close | |
| 105 | ||
| 106 | rescue Exception => e | |
| 107 | puts "MySQL Ex ception: " + e.to_s | |
| 108 | ||
| 109 | ensure | |
| 110 | puts "delete s tatement e xecuted" | |
| 111 | end | |
| 112 | end | |
| 113 | ||
| 114 | def dele teRecordBy Appointmen tRequestId (appointme nt_request _id) | |
| 115 | self.f indByAppoi ntmentRequ estId(appo intment_re quest_id) | |
| 116 | puts " record id: #{self.ar _detail_co de_id}; ap pt_rqst_id : #{self.a ppointment _request_i d}" | |
| 117 | self.d eleteRecor dById(self .ar_detail _code_id) | |
| 118 | end | |
| 119 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.