Produced by Araxis Merge on 12/8/2017 1:33:40 PM Central Standard 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 | PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\src\app\tools\station-maintenance\addZipCode | station-maintenance-add-zip-code.component.ts | Fri Dec 8 17:53:08 2017 UTC |
| 2 | PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\src\app\tools\station-maintenance\addZipCode | station-maintenance-add-zip-code.component.ts | Fri Dec 8 18:37:09 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 630 |
| Changed | 1 | 2 |
| 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 | import { C omponent, OnInit, Vi ewChild } from '@ang ular/core' ; | |
| 2 | import { N gForm } fr om '@angul ar/forms'; | |
| 3 | import { R outer } fr om '@angul ar/router' ; | |
| 4 | ||
| 5 | import { C olumnMetad ata } from '../../.. /shared/ta ble/cols.m odel'; | |
| 6 | ||
| 7 | import { S tationMain tenanceAdd ZipCodeSer vice } fro m './stati on-mainten ance-add-z ip-code.se rvice'; | |
| 8 | import { E ditStation Service } from '../e dit-statio n/station- edit-maint enance.ser vice'; | |
| 9 | ||
| 10 | @Component ({ | |
| 11 | selector : 'app-sta tion-maint enance-add -zip-code' , | |
| 12 | template Url: './st ation-main tenance-ad d-zip-code .component .html', | |
| 13 | styleUrl s: ['./sta tion-maint enance-add -zip-code. component. scss'] | |
| 14 | }) | |
| 15 | export cla ss Station Maintenanc eAddZipCod eComponent implement s OnInit { | |
| 16 | received DataStatio n = null; | |
| 17 | aStation = null; | |
| 18 | ||
| 19 | selected Active = ' Yes'; | |
| 20 | selected ZipCode = ''; | |
| 21 | selected FipsCounty Code = ''; | |
| 22 | selected UrbanIndic ator = ''; | |
| 23 | selected FipsStateC ode = ''; | |
| 24 | ||
| 25 | addZipCo deErrorMes sage = ''; | |
| 26 | ||
| 27 | existent ZipCode = false; // boolean th at will to ggle to in dicate if Zip Code a lready exi sts for St ation | |
| 28 | ||
| 29 | f: NgFor m; | |
| 30 | @ViewChi ld('f') cu rrentForm: NgForm; | |
| 31 | ||
| 32 | construc tor( | |
| 33 | privat e stationM aintenance AddZipCode Service: S tationMain tenanceAdd ZipCodeSer vice, | |
| 34 | privat e editStat ionService : EditStat ionService , | |
| 35 | privat e router: Router | |
| 36 | ) {} | |
| 37 | ||
| 38 | ngOnInit () { | |
| 39 | // con sole.log(' Inside of StationMai ntenanceAd dZipCodeCo mponent.ng OnInit!'); | |
| 40 | ||
| 41 | this.s electedAct ive = 'Yes '; | |
| 42 | ||
| 43 | this.s tationMain tenanceAdd ZipCodeSer vice.getSt ation().su bscribe(da ta => { | |
| 44 | // c onsole.log (' data = ' + JSON. stringify( data)); | |
| 45 | this .receivedD ataStation = data; | |
| 46 | ||
| 47 | this .aStation = { | |
| 48 | st ationId: ' ', | |
| 49 | sh ortName: ' ', | |
| 50 | na me: '', | |
| 51 | ty pe: '', | |
| 52 | vi sn: '', | |
| 53 | al lowReroute : 'false', | |
| 54 | ag edDefiniti on: '', | |
| 55 | pa rentStatio n: '', | |
| 56 | cr eatedBy: ' ', | |
| 57 | da teCreated: '' | |
| 58 | }; | |
| 59 | ||
| 60 | if ( data.stati on) { | |
| 61 | th is.aStatio n.stationI d = data.s tation; | |
| 62 | } | |
| 63 | ||
| 64 | if ( data.short Name) { | |
| 65 | th is.aStatio n.shortNam e = data.s hortName; | |
| 66 | } | |
| 67 | ||
| 68 | if ( data.stati onName) { | |
| 69 | th is.aStatio n.name = d ata.statio nName; | |
| 70 | } | |
| 71 | ||
| 72 | if ( data.stati onType) { | |
| 73 | th is.aStatio n.type = d ata.statio nType; | |
| 74 | } | |
| 75 | ||
| 76 | if ( data.visnN umber) { | |
| 77 | th is.aStatio n.visn = d ata.visnNu mber; | |
| 78 | } | |
| 79 | ||
| 80 | if ( data.allow Reroute) { | |
| 81 | th is.aStatio n.allowRer oute = Str ing(data.a llowRerout e); | |
| 82 | } | |
| 83 | ||
| 84 | if ( data.agedD ef) { | |
| 85 | th is.aStatio n.agedDefi nition = S tring(data .agedDef); | |
| 86 | } | |
| 87 | ||
| 88 | if ( data.paren tStation) { | |
| 89 | th is.aStatio n.parentSt ation = da ta.parentS tation; | |
| 90 | } | |
| 91 | ||
| 92 | if ( data.creat edBy) { | |
| 93 | th is.aStatio n.createdB y = String (data.crea tedBy); | |
| 94 | } | |
| 95 | ||
| 96 | if ( data.dateC reated) { | |
| 97 | th is.aStatio n.dateCrea ted = data .dateCreat ed.split(' ')[0]; | |
| 98 | } | |
| 99 | }); | |
| 100 | ||
| 101 | // Deb ug Code Be low. | |
| 102 | /* | |
| 103 | this .station = [ | |
| 104 | { | |
| 105 | 'stationId ': '999', | |
| 106 | 'shortName ': 'GENHOS P', | |
| 107 | 'name': 'G eneral Hos pital', | |
| 108 | 'type': 'H OSP', | |
| 109 | 'visn': '9 ', | |
| 110 | 'allowRero ute': 'tru e', | |
| 111 | 'agedDefin ition': '' , | |
| 112 | 'parentSta tion': '', | |
| 113 | 'createdBy ': ' DNS MBAIAH', | |
| 114 | 'dateCreat ed': '01/0 1/2017 12: 59 PM' | |
| 115 | } | |
| 116 | ]; | |
| 117 | */ | |
| 118 | } | |
| 119 | ||
| 120 | zipCodeK eyPress(ev ent: any) { | |
| 121 | // con sole.log(' Inside of StationMai ntenanceAd dZipCodeCo mponent.zi pCodeKeyPr ess !'); | |
| 122 | ||
| 123 | // con st pattern = /[0-9]/ ; | |
| 124 | const inputChar = String.f romCharCod e(event.ch arCode); | |
| 125 | // con sole.log(' inputCha r = ' + in putChar); | |
| 126 | ||
| 127 | /* | |
| 128 | if ( !pattern.t est(inputC har)) { | |
| 129 | // invalid c haracter, prevent in put | |
| 130 | ev ent.preven tDefault() ; | |
| 131 | } | |
| 132 | */ | |
| 133 | ||
| 134 | const latestValu e = this.s electedZip Code + inp utChar; | |
| 135 | if (la testValue. length > 5 ) { | |
| 136 | // i f (latestV alue.lengt h > 10) { | |
| 137 | // i nvalid num ber of cha racters, p revent inp ut | |
| 138 | even t.preventD efault(); | |
| 139 | } | |
| 140 | ||
| 141 | if (la testValue. length < 5 ) { | |
| 142 | // i f (latestV alue.lengt h < 1) { | |
| 143 | this .existentZ ipCode = f alse; | |
| 144 | } | |
| 145 | ||
| 146 | // con sole.log(' existent ZipCode = ' + this.e xistentZip Code); | |
| 147 | } | |
| 148 | ||
| 149 | zipCodeC hange(newZ ipCodeValu e) { | |
| 150 | // con sole.log(' Inside of StationMai ntenanceAd dZipCodeCo mponent.zi pCodeChang e !'); | |
| 151 | // con sole.log(' newZipC odeValue = ' + newZi pCodeValue ); | |
| 152 | // con sole.log(' this.se lectedZipC ode = ' + this.selec tedZipCode ); | |
| 153 | ||
| 154 | if (ne wZipCodeVa lue.length < 6) { | |
| 155 | // i f (newZipC odeValue.l ength < 11 ) { | |
| 156 | this .selectedZ ipCode = n ewZipCodeV alue; | |
| 157 | } | |
| 158 | ||
| 159 | if (th is.selecte dZipCode.l ength < 5) { | |
| 160 | // i f (this.se lectedZipC ode.length < 1) { | |
| 161 | this .existentZ ipCode = f alse; | |
| 162 | } | |
| 163 | ||
| 164 | // if (this.sele ctedZipCod e.length = == 5) { | |
| 165 | if (th is.selecte dZipCode.l ength > 0) { | |
| 166 | this .onZipCode BlurCheck( ); | |
| 167 | } | |
| 168 | ||
| 169 | // con sole.log(' this.se lectedZipC ode = ' + this.selec tedZipCode ); | |
| 170 | } | |
| 171 | ||
| 172 | onZipCod eBlurCheck () { | |
| 173 | // con sole.log( | |
| 174 | // ' StationMai ntenanceAd dZipCodeCo mponent.on ZipCodeBlu rCheck: se lectedZipC ode = ' + | |
| 175 | // this.sele ctedZipCod e | |
| 176 | // ); | |
| 177 | // if (this.sele ctedZipCod e.length = == 5) { | |
| 178 | if (th is.selecte dZipCode.l ength > 0) { | |
| 179 | // c onsole.log (' 5 dig its!'); | |
| 180 | ||
| 181 | this .stationMa intenanceA ddZipCodeS ervice | |
| 182 | .z ipCodeChec k(this.sel ectedZipCo de) | |
| 183 | .s ubscribe(d ata => { | |
| 184 | // console .log(' re sponse dat a ' + JSON .stringify (data)); | |
| 185 | // console .log(' re sponse dat a.result = ' + data. result); | |
| 186 | // console .log(' re sponse dat a.error_co de = ' + d ata.error_ code); | |
| 187 | // console .log( | |
| 188 | // ' re sponse dat a.error_de scription = ' + data .error_des cription | |
| 189 | // ); | |
| 190 | ||
| 191 | if (data.r esult !== null && da ta.result !== undefi ned) { | |
| 192 | this.exi stentZipCo de = data. result; | |
| 193 | } else { | |
| 194 | this.exi stentZipCo de = true; | |
| 195 | } | |
| 196 | ||
| 197 | // console .log( | |
| 198 | // ' fr om respons e data: ex istentZipC ode = ' + this.exist entZipCode | |
| 199 | // ); | |
| 200 | }) ; | |
| 201 | } else { | |
| 202 | this .existentZ ipCode = f alse; | |
| 203 | } | |
| 204 | ||
| 205 | // con sole.log(' existent ZipCode = ' + this.e xistentZip Code); | |
| 206 | } | |
| 207 | ||
| 208 | fipsCoun tyCodeKeyP ress(event : any) { | |
| 209 | const pattern = /[A-Za-z0- 9]/; | |
| 210 | const inputChar = String.f romCharCod e(event.ch arCode); | |
| 211 | ||
| 212 | if (!p attern.tes t(inputCha r)) { | |
| 213 | // i nvalid cha racter, pr event inpu t | |
| 214 | even t.preventD efault(); | |
| 215 | } | |
| 216 | ||
| 217 | const latestValu e = this.s electedFip sCountyCod e + inputC har; | |
| 218 | if (la testValue. length > 3 ) { | |
| 219 | // i nvalid num ber of cha racters, p revent inp ut | |
| 220 | even t.preventD efault(); | |
| 221 | } | |
| 222 | } | |
| 223 | ||
| 224 | fipsStat eCodeKeyPr ess(event: any) { | |
| 225 | const pattern = /[A-Za-z0- 9]/; | |
| 226 | const inputChar = String.f romCharCod e(event.ch arCode); | |
| 227 | ||
| 228 | if (!p attern.tes t(inputCha r)) { | |
| 229 | // i nvalid cha racter, pr event inpu t | |
| 230 | even t.preventD efault(); | |
| 231 | } | |
| 232 | ||
| 233 | const latestValu e = this.s electedFip sStateCode + inputCh ar; | |
| 234 | if (la testValue. length > 2 ) { | |
| 235 | // i nvalid num ber of cha racters, p revent inp ut | |
| 236 | even t.preventD efault(); | |
| 237 | } | |
| 238 | } | |
| 239 | ||
| 240 | urbanInd icatorCode KeyPress(e vent: any) { | |
| 241 | const pattern = /[A-Za-z0- 9]/; | |
| 242 | const inputChar = String.f romCharCod e(event.ch arCode); | |
| 243 | ||
| 244 | if (!p attern.tes t(inputCha r)) { | |
| 245 | // i nvalid cha racter, pr event inpu t | |
| 246 | even t.preventD efault(); | |
| 247 | } | |
| 248 | ||
| 249 | const latestValu e = this.s electedUrb anIndicato r + inputC har; | |
| 250 | if (la testValue. length > 1 0) { | |
| 251 | // i nvalid num ber of cha racters, p revent inp ut | |
| 252 | even t.preventD efault(); | |
| 253 | } | |
| 254 | } | |
| 255 | ||
| 256 | onSubmit () { | |
| 257 | // con sole.log(' Inside of StationMai ntenanceAd dZipCodeCo mponent.on Submit()!' ); | |
| 258 | ||
| 259 | if (th is.existen tZipCode) { | |
| 260 | // c onsole.log (' No Su bmit becau se existen tZipCode = ' + this. existentZi pCode); | |
| 261 | retu rn; | |
| 262 | } | |
| 263 | ||
| 264 | // con sole.log( | |
| 265 | // ' Submit to be done because e xistentZip Code = ' + this.exis tentZipCod e | |
| 266 | // ); | |
| 267 | ||
| 268 | let ac tiveValue = false; | |
| 269 | if (th is.selecte dActive == = 'Yes') { | |
| 270 | acti veValue = true; | |
| 271 | } | |
| 272 | ||
| 273 | const body = { | |
| 274 | appU serName: s essionStor age.getIte m('userNam e'), | |
| 275 | vaFa cilityCd: this.aStat ion.statio nId, | |
| 276 | zip_ code: this .selectedZ ipCode, | |
| 277 | urba n_indicato r: this.se lectedUrba nIndicator , | |
| 278 | fips _county_co de: this.s electedFip sCountyCod e, | |
| 279 | fips _state_cod e: this.se lectedFips StateCode, | |
| 280 | acti ve: active Value | |
| 281 | }; | |
| 282 | ||
| 283 | // Deb ug Code | |
| 284 | // bod y.zip_code = '32765' ; | |
| 285 | // con sole.log(' request body = ' + JSON.str ingify(bod y)); | |
| 286 | ||
| 287 | this.a ddZipCodeE rrorMessag e = ''; | |
| 288 | ||
| 289 | this.s tationMain tenanceAdd ZipCodeSer vice | |
| 290 | .zip CodeSave(b ody) | |
| 291 | .sub scribe(dat a => { | |
| 292 | // console.l og(' res ponse data = ' + JSO N.stringif y(data)); | |
| 293 | // console.l og(' res ponse data = ' + dat a); | |
| 294 | ||
| 295 | if (data.res ult) { | |
| 296 | this.editS tationServ ice.setAdd ZipCodeSuc cessMessag e( | |
| 297 | 'Add ZIP Code Succ ess: ' + t his.select edZipCode | |
| 298 | ); | |
| 299 | this.editS tationServ ice.setCur rentStatio n( | |
| 300 | this.rec eivedDataS tation.sta tion | |
| 301 | ); | |
| 302 | this.route r.navigate (['station MaintanceE dit']); | |
| 303 | } else { | |
| 304 | this.addZi pCodeError Message = data.messa ge; | |
| 305 | } | |
| 306 | }); | |
| 307 | } | |
| 308 | ||
| 309 | onClickC ancel() { | |
| 310 | // con sole.log(' Inside of StationMai ntenanceAd dZipCodeCo mponent.on ClickCance l()!'); | |
| 311 | // con sole.log(' receive dDataStati on = ' + J SON.string ify(this.r eceivedDat aStation)) ; | |
| 312 | ||
| 313 | this.e ditStation Service.se tCurrentSt ation(this .receivedD ataStation .station); | |
| 314 | this.r outer.navi gate(['sta tionMainta nceEdit']) ; | |
| 315 | } | |
| 316 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.