Produced by Araxis Merge on 1/19/2019 1:19:02 PM Eastern 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 | VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Service | AHOBPR.cs | Thu Jan 17 17:39:56 2019 UTC |
| 2 | VIRP_Build_6_Dec_2018_CG.zip\Registries VIRP Service | AHOBPR.cs | Sat Jan 19 17:41:30 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 2750 |
| Changed | 2 | 6 |
| 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 | using Syst em; | |
| 2 | using Syst em.IO; | |
| 3 | using Syst em.Linq; | |
| 4 | using Syst em.Collect ions.Gener ic; | |
| 5 | using Syst em.Text.Re gularExpre ssions; | |
| 6 | using Syst em.Web.Con figuration ; | |
| 7 | using Syst em.Web.Ser vices; | |
| 8 | using Syst em.Service Model; | |
| 9 | using Syst em.Service Model.Web; | |
| 10 | using Syst em.Service Model.Acti vation; | |
| 11 | using Syst em.Web.Scr ipt.Serial ization; | |
| 12 | using VIRP ; | |
| 13 | using VIRP .AHOBPR.BL L; | |
| 14 | using VIRP .AHOBPR.BO ; | |
| 15 | ||
| 16 | namespace VIRP_SERVI CE | |
| 17 | { | |
| 18 | [WebServic e(Namespac e = "http: // DNS ")] | |
| 19 | [WebSe rviceBindi ng(Conform sTo = WsiP rofiles.Ba sicProfile 1_1)] | |
| 20 | [WebServic eBindingAt tribute(Na me = "AHOB PR", Names pace = "ht tp:// DNS ")] | |
| 21 | [ServiceCo ntract(Nam e = "AHOBP R", Namesp ace = "htt p:// DNS ")] | |
| 22 | [Syste m.Componen tModel.Too lboxItem(f alse)] | |
| 23 | [AspNe tCompatibi lityRequir ements(Req uirementsM ode = AspN etCompatib ilityRequi rementsMod e.Allowed) ] | |
| 24 | [Servi ceBehavior (InstanceC ontextMode = Instanc eContextMo de.Single) ] | |
| 25 | public partial c lass AHOBP R : System .Web.Servi ces.WebSer vice | |
| 26 | { | |
| 27 | #r egion soap | |
| 28 | ||
| 29 | // [WebMethod ] | |
| 30 | // public boo l AddEdipi ForUpdate( string edi pi) | |
| 31 | // { | |
| 32 | // bool r esult = fa lse; | |
| 33 | // try | |
| 34 | // { | |
| 35 | // Re gex regex = new Rege x("^[0-9]{ 10}$"); | |
| 36 | // if (regex.Is Match(edip i)) | |
| 37 | // { | |
| 38 | // //var ma nager = ne w DataMana ger(); | |
| 39 | // //result = manager .AddEdipiT oDatabase( edipi); | |
| 40 | // } | |
| 41 | // } | |
| 42 | // catch | |
| 43 | // { | |
| 44 | // re sult = fal se; | |
| 45 | // } | |
| 46 | // return result; | |
| 47 | // } | |
| 48 | ||
| 49 | // [WebMethod ] | |
| 50 | // public str ing Update Registrant WithDoDInf o(string e dipi) | |
| 51 | // { | |
| 52 | // string result = string.Emp ty; | |
| 53 | // try | |
| 54 | // { | |
| 55 | // // var manage r = new AH OBPRRegist rantManage r(); | |
| 56 | // // int regist rantDbId = EdipiVali dator.IsVa lid(edipi) ? manager .GetRegist rantId(edi pi) : 0; | |
| 57 | // // if (regist rantDbId ! = 0) | |
| 58 | // // { | |
| 59 | // // Compre hensiveUpd ater updat er = new C omprehensi veUpdater( ); | |
| 60 | // // result = updater .UpdateReg istrant(AH OBPRGlobal .Registran tManagers, edipi, re gistrantDb Id); | |
| 61 | // // } | |
| 62 | // // else | |
| 63 | // // { | |
| 64 | // re sult = "er ror: no re gistrant f ound"; | |
| 65 | // // } | |
| 66 | // } | |
| 67 | // catch (Exception ex) | |
| 68 | // { | |
| 69 | // re sult = $"{ ex.Message }"; | |
| 70 | // } | |
| 71 | // return result; | |
| 72 | // } | |
| 73 | ||
| 74 | #e ndregion | |
| 75 | ||
| 76 | #r egion rest _xml | |
| 77 | ||
| 78 | // [Operation Contract] | |
| 79 | // [WebInvoke (Method = "GET", Res ponseForma t = WebMes sageFormat .Xml, UriT emplate = "bens/queu e/add/{edi pi}")] | |
| 80 | // public boo l AddEdipi ForUpdateX ml(string edipi) | |
| 81 | // { | |
| 82 | // return this.AddE dipiForUpd ate(edipi) ; | |
| 83 | // } | |
| 84 | ||
| 85 | // [Operation Contract] | |
| 86 | // [WebInvoke (Method = "GET", Res ponseForma t = WebMes sageFormat .Xml, UriT emplate = "dodimport /update/{e dipi}")] | |
| 87 | // public str ing Update Registrant WithDoDInf oXml(strin g edipi) | |
| 88 | // { | |
| 89 | // return this.Upda teRegistra ntWithDoDI nfo(edipi) ; | |
| 90 | // } | |
| 91 | ||
| 92 | #e ndregion | |
| 93 | ||
| 94 | #r egion rest _json | |
| 95 | ||
| 96 | // 55 web met hods - 35 complete | |
| 97 | ||
| 98 | [O perationCo ntract] | |
| 99 | [W ebInvoke(M ethod = "G ET", | |
| 100 | Response Format = W ebMessageF ormat.Json , | |
| 101 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 102 | UriTempl ate = "ben s/queue/ad d/{edipi}" )] | |
| 103 | pu blic bool AddEdipiFo rUpdate(st ring edipi ) | |
| 104 | { | |
| 105 | //throw new NotImp lementedEx ception(); | |
| 106 | bool res ult = fals e; | |
| 107 | try | |
| 108 | { | |
| 109 | if ( EdipiIsVal id(edipi)) | |
| 110 | { | |
| 111 | UPDATES_BE NS_NOTIFIC ATION bens = new UPD ATES_BENS_ NOTIFICATI ON(); | |
| 112 | bens.EDIPI = edipi; | |
| 113 | bens.UPDAT ES_BENS_NO TIFICATION _ID = UPDA TES_BENS_N OTIFICATIO NManager.S ave("RESTf ul Service ", 0, bens ); | |
| 114 | result = t rue; | |
| 115 | ||
| 116 | //var mana ger = new DataManage r(); | |
| 117 | //result = manager.A ddEdipiToD atabase(ed ipi); | |
| 118 | } | |
| 119 | } | |
| 120 | catch | |
| 121 | { | |
| 122 | resu lt = false ; | |
| 123 | } | |
| 124 | return r esult; | |
| 125 | } | |
| 126 | ||
| 127 | [O perationCo ntract] | |
| 128 | [W ebInvoke(M ethod = "G ET", | |
| 129 | Response Format = W ebMessageF ormat.Json , | |
| 130 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 131 | UriTempl ate = "dod import/upd ate/{edipi }")] | |
| 132 | pu blic strin g UpdateRe gistrantWi thDoDInfo( string edi pi) | |
| 133 | { | |
| 134 | //throw new NotImp lementedEx ception(); | |
| 135 | string r esult = st ring.Empty ; | |
| 136 | try | |
| 137 | { | |
| 138 | if ( EdipiIsVal id(edipi)) | |
| 139 | { | |
| 140 | REGISTRANT registran t = REGIST RANTManage r.GetItemB yEdipi(edi pi); | |
| 141 | if (regist rant != nu ll) | |
| 142 | { | |
| 143 | //TLB. TODO | |
| 144 | result = REGISTR ANTManager .UpdateAll (edipi, re gistrant.R EGISTRANT_ ID); | |
| 145 | } | |
| 146 | else | |
| 147 | result = "error: no regist rant found "; | |
| 148 | } | |
| 149 | else | |
| 150 | result = " error: inv alid EDIPI "; | |
| 151 | ||
| 152 | //va r manager = new AHOB PRRegistra ntManager( ); | |
| 153 | //in t registra ntDbId = E dipiValida tor.IsVali d(edipi) ? manager.G etRegistra ntId(edipi ) : 0; | |
| 154 | //if (registra ntDbId != 0) | |
| 155 | //{ | |
| 156 | // Comprehe nsiveUpdat er updater = new Com prehensive Updater(); | |
| 157 | // result = updater.U pdateRegis trant(AHOB PRGlobal.R egistrantM anagers, e dipi, regi strantDbId ); | |
| 158 | //} | |
| 159 | //el se | |
| 160 | //{ | |
| 161 | // result = "error: n o registra nt found"; | |
| 162 | //} | |
| 163 | } | |
| 164 | catch (E xception e x) | |
| 165 | { | |
| 166 | resu lt = $"{ex .Message}" ; | |
| 167 | } | |
| 168 | return r esult; | |
| 169 | } | |
| 170 | ||
| 171 | [O perationCo ntract] | |
| 172 | [W ebInvoke(M ethod = "G ET", | |
| 173 | Response Format = W ebMessageF ormat.Json , | |
| 174 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 175 | UriTempl ate = "ben s/update/a ll")] | |
| 176 | pu blic strin g ProcessB ensNotific ations() | |
| 177 | { | |
| 178 | throw ne w NotImple mentedExce ption(); | |
| 179 | //string result = string.Emp ty; | |
| 180 | //try | |
| 181 | //{ | |
| 182 | // Be nsUpdater updater = new BensUp dater(); | |
| 183 | // re sult = upd ater.Recon cileQueue( AHOBPRGlob al.Registr antManager s); | |
| 184 | //} | |
| 185 | //catch (InvalidOp erationExc eption ex) | |
| 186 | //{ | |
| 187 | // re sult = $"{ ex.Message }"; | |
| 188 | //} | |
| 189 | //catch (Exception ex) | |
| 190 | //{ | |
| 191 | // re sult = $"e rror: {ex. Message}"; | |
| 192 | //} | |
| 193 | //return result; | |
| 194 | } | |
| 195 | ||
| 196 | [O perationCo ntract] | |
| 197 | [W ebInvoke(M ethod = "G ET", | |
| 198 | Response Format = W ebMessageF ormat.Json , | |
| 199 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 200 | UriTempl ate = "jso nparserfol lowup/{id} ")] | |
| 201 | pu blic bool JsonParser Followup(s tring id) | |
| 202 | { | |
| 203 | //throw new NotImp lementedEx ception(); | |
| 204 | bool res ult = fals e; | |
| 205 | ||
| 206 | if (stri ng.IsNullO rEmpty(id) ) | |
| 207 | { | |
| 208 | resu lt = true; | |
| 209 | } | |
| 210 | else | |
| 211 | { | |
| 212 | try | |
| 213 | { | |
| 214 | AHOBPRJson DataManage r manager = new AHOB PRJsonData Manager(); | |
| 215 | result = m anager.Par seJsonFoll owupData(C onvert.ToI nt32(id)); | |
| 216 | } | |
| 217 | catc h | |
| 218 | { | |
| 219 | result = f alse; | |
| 220 | } | |
| 221 | } | |
| 222 | ||
| 223 | return r esult; | |
| 224 | } | |
| 225 | ||
| 226 | [O perationCo ntract] | |
| 227 | [W ebInvoke(M ethod = "G ET", | |
| 228 | Response Format = W ebMessageF ormat.Json , | |
| 229 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 230 | UriTempl ate = "jso nparser/{i d}")] | |
| 231 | pu blic bool JsonParser (string id ) | |
| 232 | { | |
| 233 | //throw new NotImp lementedEx ception(); | |
| 234 | bool res ult = fals e; | |
| 235 | ||
| 236 | if (stri ng.IsNullO rEmpty(id) ) | |
| 237 | { | |
| 238 | resu lt = true; | |
| 239 | } | |
| 240 | else | |
| 241 | { | |
| 242 | try | |
| 243 | { | |
| 244 | AHOBPRJson DataManage r manager = new AHOB PRJsonData Manager(); | |
| 245 | result = m anager.Par seJsonData (Convert.T oInt32(id) ); | |
| 246 | } | |
| 247 | catc h | |
| 248 | { | |
| 249 | result = f alse; | |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 253 | return r esult; | |
| 254 | } | |
| 255 | ||
| 256 | [O perationCo ntract] | |
| 257 | [W ebInvoke(M ethod = "G ET", | |
| 258 | Response Format = W ebMessageF ormat.Json , | |
| 259 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 260 | UriTempl ate = "app notificati on")] | |
| 261 | pu blic strin g AppNotif ication() | |
| 262 | { | |
| 263 | //throw new NotImp lementedEx ception(); | |
| 264 | ||
| 265 | string n otificatio n = string .Empty; | |
| 266 | VIRP.CRS .BO.APPLIC ATION_STAT US appStat us = VIRP. CRS.BLL.AP PLICATION_ STATUSMana ger.GetApp licationSt atus("AHOB PR"); | |
| 267 | if (appS tatus != n ull) | |
| 268 | { | |
| 269 | if ( appStatus. PROCESS_FL AG == 1) | |
| 270 | { | |
| 271 | notificati on = appSt atus.MESSA GE; | |
| 272 | } | |
| 273 | } | |
| 274 | return n otificatio n; | |
| 275 | ||
| 276 | //AHOBPR GenericMan ager manag er = new A HOBPRGener icManager( ); | |
| 277 | //return manager.G etApplicat ionNotific ation(); | |
| 278 | } | |
| 279 | ||
| 280 | [O perationCo ntract] | |
| 281 | [W ebInvoke(M ethod = "G ET", | |
| 282 | Response Format = W ebMessageF ormat.Json , | |
| 283 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 284 | UriTempl ate = "upd atename2/{ userid}/{l astname}/{ firstname} /{createdb y}")] | |
| 285 | pu blic bool NameUpdate 2(string u serid, str ing lastna me, string firstname , string c reatedby) | |
| 286 | { | |
| 287 | return t his.NameUp date(useri d, lastnam e, firstna me, string .Empty, cr eatedby); | |
| 288 | } | |
| 289 | ||
| 290 | [O perationCo ntract] | |
| 291 | [W ebInvoke(M ethod = "G ET", | |
| 292 | Response Format = W ebMessageF ormat.Json , | |
| 293 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 294 | UriTempl ate = "upd atename/{u serid}/{la stname}/{f irstname}/ {middlenam e}/{create dby}")] | |
| 295 | pu blic bool NameUpdate (string us erid, stri ng lastnam e, string firstname, string mi ddlename, string cre atedby) | |
| 296 | { | |
| 297 | //throw new NotImp lementedEx ception(); | |
| 298 | bool res ults = fal se; | |
| 299 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 300 | JavaScri ptSerializ er seriali zer = new JavaScript Serializer (); | |
| 301 | REGISTRA NT_JSON re cord = nul l; | |
| 302 | ||
| 303 | // Updat e User Jso n with new name | |
| 304 | record = manager.G etJsonData (userid, A HOBPRGloba l.AhobprJs onDataType User); | |
| 305 | if (reco rd != null ) | |
| 306 | { | |
| 307 | BprU ser bprUse r = serial izer.Deser ialize<Bpr User>(reco rd.JSON_DA TA); | |
| 308 | bprU ser.firstN ame = firs tname; | |
| 309 | bprU ser.lastNa me = lastn ame; | |
| 310 | bprU ser.middle Name = mid dlename; | |
| 311 | ||
| 312 | resu lts = Save BprUser(us erid, seri alizer.Ser ialize(bpr User), cre atedby) != null; | |
| 313 | } | |
| 314 | ||
| 315 | // Updat e Info Jso n with new name | |
| 316 | record = manager.G etJsonData (userid, A HOBPRGloba l.AhobprJs onDataType Info); | |
| 317 | if (reco rd != null ) | |
| 318 | { | |
| 319 | BprI nfo bprInf o = serial izer.Deser ialize<Bpr Info>(reco rd.JSON_DA TA); | |
| 320 | if ( bprInfo != null) | |
| 321 | { | |
| 322 | bprInfo.ed ipiMismatc hed = fals e; | |
| 323 | bprInfo.ed ipiVerifie dDate = st ring.Empty ; | |
| 324 | if (bprInf o.contactI nfo != nul l) | |
| 325 | { | |
| 326 | bprInf o.contactI nfo.firstN ame = firs tname; | |
| 327 | bprInf o.contactI nfo.lastNa me = lastn ame; | |
| 328 | bprInf o.contactI nfo.middle Name = mid dlename; | |
| 329 | } | |
| 330 | results = SaveBprInf o(userid, serializer .Serialize (bprInfo), createdby ) != null; | |
| 331 | } | |
| 332 | } | |
| 333 | ||
| 334 | return r esults; | |
| 335 | } | |
| 336 | ||
| 337 | [O perationCo ntract] | |
| 338 | [W ebInvoke(M ethod = "G ET", | |
| 339 | Response Format = W ebMessageF ormat.Json , | |
| 340 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 341 | UriTempl ate = "tot alparticip ants")] | |
| 342 | pu blic strin g TotalPar ticipants( ) | |
| 343 | { | |
| 344 | //throw new NotImp lementedEx ception(); | |
| 345 | return R EGISTRANTM anager.Get TotalParti cipants(); | |
| 346 | } | |
| 347 | ||
| 348 | [O perationCo ntract] | |
| 349 | [W ebInvoke(M ethod = "G ET", | |
| 350 | Response Format = W ebMessageF ormat.Json , | |
| 351 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 352 | UriTempl ate = "ver sion")] | |
| 353 | pu blic strin g Version( ) | |
| 354 | { | |
| 355 | //throw new NotImp lementedEx ception(); | |
| 356 | return V IRP.CRS.BL L.VIRPMana ger.GET_VE RSION(); | |
| 357 | //return BaseCode. WebSiteVer sion.Build Version.To String(); | |
| 358 | } | |
| 359 | ||
| 360 | [O perationCo ntract] | |
| 361 | [W ebInvoke(M ethod = "G ET", | |
| 362 | Response Format = W ebMessageF ormat.Json , | |
| 363 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 364 | UriTempl ate = "jso nparser/re setglobal" )] | |
| 365 | pu blic bool ResetGloba lVariables () | |
| 366 | { | |
| 367 | //TLB.TO DO - deter mine if/ho w global v ariables w ill be use d | |
| 368 | throw ne w NotImple mentedExce ption(); | |
| 369 | //bool r esult = fa lse; | |
| 370 | //AHOBPR FormRespon seManager manager = new AHOBPR FormRespon seManager( ); | |
| 371 | //result = manager .ResetGlob alVariable s(); | |
| 372 | //return result; | |
| 373 | } | |
| 374 | ||
| 375 | [O perationCo ntract] | |
| 376 | [W ebInvoke(M ethod = "G ET", | |
| 377 | Response Format = W ebMessageF ormat.Json , | |
| 378 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 379 | UriTempl ate = "dow nload/{fil eType}/{fi leId}")] | |
| 380 | pu blic byte[ ] GetFile( string fil eType, str ing fileId ) | |
| 381 | { | |
| 382 | //throw new NotImp lementedEx ception(); | |
| 383 | return R EGISTRANT_ FILEManage r.GetFile( fileId, fi leType); | |
| 384 | } | |
| 385 | ||
| 386 | [O perationCo ntract] | |
| 387 | [W ebInvoke(M ethod = "G ET", | |
| 388 | Response Format = W ebMessageF ormat.Json , | |
| 389 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 390 | UriTempl ate = "inf o/{id}")] | |
| 391 | pu blic strin g BprInfo( string id) | |
| 392 | { | |
| 393 | //throw new NotImp lementedEx ception(); | |
| 394 | string r esults = n ull; | |
| 395 | ||
| 396 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 397 | REGISTRA NT_JSON re cord = man ager.GetJs onData(id, AHOBPRGlo bal.Ahobpr JsonDataTy peInfo); | |
| 398 | if (reco rd != null ) | |
| 399 | { | |
| 400 | resu lts = reco rd.JSON_DA TA; | |
| 401 | } | |
| 402 | ||
| 403 | return r esults; | |
| 404 | } | |
| 405 | ||
| 406 | [O perationCo ntract] | |
| 407 | [W ebInvoke(M ethod = "G ET", | |
| 408 | Response Format = W ebMessageF ormat.Json , | |
| 409 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 410 | UriTempl ate = "dod import/{ed ipi}/{ssn} ")] | |
| 411 | pu blic strin g BprDoDIm port(strin g edipi, s tring ssn) | |
| 412 | { | |
| 413 | //throw new NotImp lementedEx ception(); | |
| 414 | BprDoDDe ploymentIm ports impo rts = null ; | |
| 415 | try | |
| 416 | { | |
| 417 | REGI STRANT reg istrant = REGISTRANT Manager.Ge tRegistran tById(edip i, ssn); | |
| 418 | if ( registrant != null) | |
| 419 | { | |
| 420 | imports = BprDoDDepl oymentImpo rtsManager .GetBprDoD Deployment Imports(re gistrant); | |
| 421 | } | |
| 422 | //// Isn't ther e supposed to be a I OC contain er here? | |
| 423 | //ID eploymentI mporter ma nager = Cr eateDoDImp orter(); | |
| 424 | //if (manager != null) | |
| 425 | //{ | |
| 426 | // imports = manager. GetDoDDepl oymentImpo rts(edipi, ssn); | |
| 427 | //} | |
| 428 | } | |
| 429 | catch (N ullReferen ceExceptio n ex) | |
| 430 | { | |
| 431 | LogM anager.Log Error(ex.M essage, St ring.Forma t("{0}.{1} ", System. Reflection .MethodBas e.GetCurre ntMethod() .Declaring Type.FullN ame, Syste m.Reflecti on.MethodB ase.GetCur rentMethod ().Name), "RESTful S ervice", 0 ); | |
| 432 | //AH OBPRLogger .LogErrorM essage("Nu ll Referen ce", this. GetType(). Name + "." + MethodB ase.GetCur rentMethod ().Name, e x.Message) ; | |
| 433 | } | |
| 434 | catch (E xception e x) | |
| 435 | { | |
| 436 | LogM anager.Log Error(ex.M essage, St ring.Forma t("{0}.{1} ", System. Reflection .MethodBas e.GetCurre ntMethod() .Declaring Type.FullN ame, Syste m.Reflecti on.MethodB ase.GetCur rentMethod ().Name), "RESTful S ervice", 0 ); | |
| 437 | //AH OBPRLogger .LogErrorM essage("Ex ception", GetType(). Name + "." + MethodB ase.GetCur rentMethod ().Name, e x.StackTra ce); | |
| 438 | } | |
| 439 | return ( imports != null) ? n ew JavaScr iptSeriali zer().Seri alize(impo rts) : "{} "; | |
| 440 | } | |
| 441 | ||
| 442 | [O perationCo ntract] | |
| 443 | [W ebInvoke(M ethod = "G ET", | |
| 444 | Response Format = W ebMessageF ormat.Json , | |
| 445 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 446 | UriTempl ate = "use r/{id}")] | |
| 447 | pu blic strin g BprUser( string id) | |
| 448 | { | |
| 449 | //throw new NotImp lementedEx ception(); | |
| 450 | string r esults = s tring.Empt y; | |
| 451 | ||
| 452 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 453 | REGISTRA NT_JSON re cord = man ager.GetJs onData(id, AHOBPRGlo bal.Ahobpr JsonDataTy peUser); | |
| 454 | if (reco rd != null ) | |
| 455 | { | |
| 456 | resu lts = reco rd.JSON_DA TA; | |
| 457 | } | |
| 458 | ||
| 459 | return r esults; | |
| 460 | } | |
| 461 | ||
| 462 | [O perationCo ntract] | |
| 463 | [W ebInvoke(M ethod = "G ET", | |
| 464 | Response Format = W ebMessageF ormat.Json , | |
| 465 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 466 | UriTempl ate = "use rid/{id}") ] | |
| 467 | pu blic strin g BprUserI d(string i d) | |
| 468 | { | |
| 469 | //throw new NotImp lementedEx ception(); | |
| 470 | string u serId = st ring.Empty ; | |
| 471 | ||
| 472 | if (!str ing.IsNull OrEmpty(id )) | |
| 473 | { | |
| 474 | user Id = REGIS TRANTManag er.GetUser IdByRegist rantId(Con vert.ToInt 32(id)); | |
| 475 | } | |
| 476 | ||
| 477 | return u serId; | |
| 478 | } | |
| 479 | ||
| 480 | [O perationCo ntract] | |
| 481 | [W ebInvoke(M ethod = "G ET", | |
| 482 | Response Format = W ebMessageF ormat.Json , | |
| 483 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 484 | UriTempl ate = "pdf registrant list/{star tdate}/{en ddate}")] | |
| 485 | pu blic List< string> Pd fRegistran tList(stri ng startda te, string enddate) | |
| 486 | { | |
| 487 | //throw new NotImp lementedEx ception(); | |
| 488 | List<str ing> urser Ids = null ; | |
| 489 | ||
| 490 | if (!str ing.IsNull OrEmpty(st artdate) & & !string. IsNullOrEm pty(enddat e)) | |
| 491 | { | |
| 492 | if ( startdate. Length == 8 && endda te.Length == 8) | |
| 493 | { | |
| 494 | try | |
| 495 | { | |
| 496 | DateTi me startDa teTime = D ateTime.Mi nValue; | |
| 497 | DateTi me endDate Time = Dat eTime.MinV alue; | |
| 498 | ||
| 499 | startD ateTime = Convert.To DateTime(s tartdate.S ubstring(4 , 2) + "/" + startda te.Substri ng(6, 2) + "/" + sta rtdate.Sub string(0, 4)); | |
| 500 | endDat eTime = Co nvert.ToDa teTime(end date.Subst ring(4, 2) + "/" + e nddate.Sub string(6, 2) + "/" + enddate.S ubstring(0 , 4)); | |
| 501 | ||
| 502 | if (st artDateTim e != DateT ime.MinVal ue && endD ateTime != DateTime. MinValue) | |
| 503 | { | |
| 504 | ur serIds = R EGISTRANTM anager.Pdf Registrant List(start DateTime, endDateTim e); | |
| 505 | } | |
| 506 | else | |
| 507 | { | |
| 508 | th row new Ex ception("P DF Utility : Invalid start date (" + star tdate + ") or end da te (" + en ddate + ") ."); | |
| 509 | } | |
| 510 | } | |
| 511 | catch (Exc eption ex) | |
| 512 | { | |
| 513 | LogMan ager.LogEr ror(ex.Mes sage, Stri ng.Format( "{0}.{1}", System.Re flection.M ethodBase. GetCurrent Method().D eclaringTy pe.FullNam e, System. Reflection .MethodBas e.GetCurre ntMethod() .Name), "A HOBPR Rest ful Servic e", 0); | |
| 514 | } | |
| 515 | } | |
| 516 | } | |
| 517 | ||
| 518 | return u rserIds; | |
| 519 | } | |
| 520 | ||
| 521 | [O perationCo ntract] | |
| 522 | [W ebInvoke(M ethod = "G ET", | |
| 523 | Response Format = W ebMessageF ormat.Json , | |
| 524 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 525 | UriTempl ate = "pdf metadata/{ userid}")] | |
| 526 | pu blic strin g PdfMetaD ata(string userid) | |
| 527 | { | |
| 528 | //throw new NotImp lementedEx ception(); | |
| 529 | string r esult = st ring.Empty ; | |
| 530 | ||
| 531 | result = REGISTRAN TManager.G etPdfMetaD ata(userid ); | |
| 532 | ||
| 533 | return r esult; | |
| 534 | } | |
| 535 | ||
| 536 | [O perationCo ntract] | |
| 537 | [W ebInvoke(M ethod = "G ET", | |
| 538 | Response Format = W ebMessageF ormat.Json , | |
| 539 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 540 | UriTempl ate = "las tpdfrundat e")] | |
| 541 | pu blic strin g LastPdfR unDate() | |
| 542 | { | |
| 543 | //throw new NotImp lementedEx ception(); | |
| 544 | string r esult = st ring.Empty ; | |
| 545 | ||
| 546 | result = INTERFACE _CALL_LOGM anager.Get LastPdfRun Date(); | |
| 547 | ||
| 548 | return r esult; | |
| 549 | } | |
| 550 | ||
| 551 | [O perationCo ntract] | |
| 552 | [W ebInvoke(M ethod = "G ET", | |
| 553 | Response Format = W ebMessageF ormat.Json , | |
| 554 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 555 | UriTempl ate = "pro cessqueueb atch/{queu ebatchid}" )] | |
| 556 | pu blic bool ProcessQue ueBatch(st ring queue batchid) | |
| 557 | { | |
| 558 | //throw new NotImp lementedEx ception(); | |
| 559 | return Q UEUE_STATU SManager.P rocessQueu eBatch(que uebatchid) ; | |
| 560 | } | |
| 561 | ||
| 562 | [O perationCo ntract] | |
| 563 | [W ebInvoke(M ethod = "G ET", | |
| 564 | Response Format = W ebMessageF ormat.Json , | |
| 565 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 566 | UriTempl ate = "res ponses/{id }")] | |
| 567 | pu blic strin g BprRespo nses(strin g id) | |
| 568 | { | |
| 569 | //throw new NotImp lementedEx ception(); | |
| 570 | string r esults = n ull; | |
| 571 | ||
| 572 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 573 | REGISTRA NT_JSON re cord = man ager.GetJs onData(id, AHOBPRGlo bal.Ahobpr JsonDataTy peResponse s); | |
| 574 | if (reco rd != null ) | |
| 575 | { | |
| 576 | resu lts = reco rd.JSON_DA TA; | |
| 577 | } | |
| 578 | ||
| 579 | return r esults; | |
| 580 | } | |
| 581 | ||
| 582 | [O perationCo ntract] | |
| 583 | [W ebInvoke(M ethod = "G ET", | |
| 584 | Response Format = W ebMessageF ormat.Json , | |
| 585 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 586 | UriTempl ate = "reo penquestio nnaire/{id }")] | |
| 587 | pu blic bool ReopenQues tionnaire( string id) | |
| 588 | { | |
| 589 | //throw new NotImp lementedEx ception(); | |
| 590 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 591 | return m anager.Reo penQuestio nnaire(id) ; | |
| 592 | } | |
| 593 | ||
| 594 | [O perationCo ntract] | |
| 595 | [W ebInvoke(M ethod = "G ET", | |
| 596 | Response Format = W ebMessageF ormat.Json , | |
| 597 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 598 | UriTempl ate = "for m/{id=null }")] | |
| 599 | pu blic strin g BprForm( string id) | |
| 600 | { | |
| 601 | //throw new NotImp lementedEx ception(); | |
| 602 | string r esults = n ull; | |
| 603 | ||
| 604 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 605 | REGISTRA NT_JSON re cord = man ager.GetJs onData(id, AHOBPRGlo bal.Ahobpr JsonDataTy peForm); | |
| 606 | if (reco rd != null ) | |
| 607 | { | |
| 608 | resu lts = reco rd.JSON_DA TA; | |
| 609 | } | |
| 610 | ||
| 611 | return r esults; | |
| 612 | } | |
| 613 | ||
| 614 | [O perationCo ntract] | |
| 615 | [W ebInvoke(M ethod = "G ET", | |
| 616 | Response Format = W ebMessageF ormat.Json , | |
| 617 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 618 | UriTempl ate = "for mfollowup/ {id=null}" )] | |
| 619 | pu blic strin g BprFormF ollowup(st ring id) | |
| 620 | { | |
| 621 | //throw new NotImp lementedEx ception(); | |
| 622 | string r esults = n ull; | |
| 623 | ||
| 624 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 625 | results = manager. GetJsonFol lowup(id, AHOBPRGlob al.AhobprJ sonTypeFor mFollowup, id); | |
| 626 | ||
| 627 | return r esults; | |
| 628 | } | |
| 629 | ||
| 630 | [W ebInvoke(M ethod = "G ET", | |
| 631 | Response Format = W ebMessageF ormat.Json , | |
| 632 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 633 | UriTempl ate = "def aultFormId /")] | |
| 634 | pu blic strin g DefaultB prFormId() | |
| 635 | { | |
| 636 | //throw new NotImp lementedEx ception(); | |
| 637 | return A HOBPRGloba l.AhobprDe faultFormI d; | |
| 638 | } | |
| 639 | ||
| 640 | [O perationCo ntract] | |
| 641 | [W ebInvoke(M ethod = "G ET", | |
| 642 | Response Format = W ebMessageF ormat.Json , | |
| 643 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 644 | UriTempl ate = "dep loymentloc ations/{se arch=null} ")] | |
| 645 | pu blic strin g BprDeplo ymentLocat ions(strin g search) | |
| 646 | { | |
| 647 | //throw new NotImp lementedEx ception(); | |
| 648 | string r esults = s tring.Empt y; | |
| 649 | JavaScri ptSerializ er seriali zer = new JavaScript Serializer (); | |
| 650 | BprDeplo ymentLocat ion[] loca tions = ST D_DEPLOYME NT_LOCATIO NManager.G etDeployme ntLocation s(search.R eplace("__ ", " ").Re place("__" , " ").Rep lace("__", " ").Repl ace("__", " ").Repla ce("__", " ")); | |
| 651 | results = serializ er.Seriali ze(locatio ns); | |
| 652 | return r esults; | |
| 653 | } | |
| 654 | ||
| 655 | [O perationCo ntract] | |
| 656 | [W ebInvoke(M ethod = "G ET", | |
| 657 | Response Format = W ebMessageF ormat.Json , | |
| 658 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 659 | UriTempl ate = "bas enames/{se arch=null} ")] | |
| 660 | pu blic strin g BprBaseN ames(strin g search) | |
| 661 | { | |
| 662 | //throw new NotImp lementedEx ception(); | |
| 663 | string r esults = s tring.Empt y; | |
| 664 | JavaScri ptSerializ er seriali zer = new JavaScript Serializer (); | |
| 665 | BprDeplo ymentBaseN ame[] base s = STD_DE PLOYMENT_L OCATIONMan ager.GetDe ploymentBa seNames(se arch.Repla ce("__", " ").Replac e("__", " ").Replace ("__", " " ).Replace( "__", " ") .Replace(" __", " ")) ; | |
| 666 | results = serializ er.Seriali ze(bases); | |
| 667 | ||
| 668 | return r esults; | |
| 669 | } | |
| 670 | ||
| 671 | [O perationCo ntract] | |
| 672 | [W ebInvoke(M ethod = "G ET", | |
| 673 | Response Format = W ebMessageF ormat.Json , | |
| 674 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 675 | UriTempl ate = "use rfollowupf orms/{id}" )] | |
| 676 | pu blic strin g BprUserF ollowupFor ms(string id) | |
| 677 | { | |
| 678 | //throw new NotImp lementedEx ception(); | |
| 679 | string r esults = n ull; | |
| 680 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 681 | List<str ing> recor ds = manag er.GetJson Followups( id, AHOBPR Global.Aho bprJsonTyp eUserForm) ; | |
| 682 | if (reco rds.Count > 0) | |
| 683 | { | |
| 684 | Java ScriptSeri alizer ser ializer = new JavaSc riptSerial izer(); | |
| 685 | BprU serFollowu pForm user Form = new BprUserFo llowupForm (); | |
| 686 | List <BprUserFo llowupForm > userForm List = new List<BprU serFollowu pForm>(); | |
| 687 | fore ach (strin g userForm Json in re cords) | |
| 688 | { | |
| 689 | userForm = serialize r.Deserial ize<BprUse rFollowupF orm>(userF ormJson); | |
| 690 | userFormLi st.Add(use rForm); | |
| 691 | } | |
| 692 | BprU serFollowu pForms use rForms = n ew BprUser FollowupFo rms(); | |
| 693 | user Forms._id = Guid.New Guid().ToS tring(); | |
| 694 | user Forms.user FollowupFo rms = user FormList.T oArray(); | |
| 695 | resu lts = seri alizer.Ser ialize(use rForms); | |
| 696 | } | |
| 697 | return r esults; | |
| 698 | } | |
| 699 | ||
| 700 | [O perationCo ntract] | |
| 701 | [W ebInvoke(M ethod = "G ET", | |
| 702 | Response Format = W ebMessageF ormat.Json , | |
| 703 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 704 | UriTempl ate = "mes sages/{id} ")] | |
| 705 | pu blic strin g BprMessa ges(string id) | |
| 706 | { | |
| 707 | //throw new NotImp lementedEx ception(); | |
| 708 | string r esults = n ull; | |
| 709 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 710 | List<str ing> recor ds = manag er.GetJson Followups( id, AHOBPR Global.Aho bprJsonTyp eMessage); | |
| 711 | if (reco rds.Count > 0) | |
| 712 | { | |
| 713 | Java ScriptSeri alizer ser ializer = new JavaSc riptSerial izer(); | |
| 714 | BprM essage mes sage = new BprMessag e(); | |
| 715 | List <BprMessag e> message s = new Li st<BprMess age>(); | |
| 716 | fore ach (strin g jsonData in record s) | |
| 717 | { | |
| 718 | message = serializer .Deseriali ze<BprMess age>(jsonD ata); | |
| 719 | message.bo dy = messa ge.body.Re place("\r\ n", "<br / >"); | |
| 720 | messages.A dd(message ); | |
| 721 | } | |
| 722 | BprM essages bp rMessages = new BprM essages(); | |
| 723 | bprM essages.us erId = id; | |
| 724 | mess ages = (fr om m in me ssages | |
| 725 | or derby Conv ert.ToInt3 2(m._id) d escending | |
| 726 | se lect m).To List(); | |
| 727 | bprM essages.me ssages = m essages.To Array(); | |
| 728 | resu lts = seri alizer.Ser ialize(bpr Messages); | |
| 729 | } | |
| 730 | return r esults; | |
| 731 | } | |
| 732 | ||
| 733 | [O perationCo ntract] | |
| 734 | [W ebInvoke(M ethod = "G ET", | |
| 735 | Response Format = W ebMessageF ormat.Json , | |
| 736 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 737 | UriTempl ate = "fol lowupformr esponses/{ userid}/{f ormid}")] | |
| 738 | pu blic strin g BprFollo wUpFormRes ponse(stri ng userid, string fo rmid) | |
| 739 | { | |
| 740 | //throw new NotImp lementedEx ception(); | |
| 741 | string r esult = st ring.Empty ; | |
| 742 | ||
| 743 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 744 | result = manager.G etJsonFoll owup(useri d, AHOBPRG lobal.Ahob prJsonType ResponsesF ollowup, f ormid); | |
| 745 | ||
| 746 | return r esult; | |
| 747 | } | |
| 748 | ||
| 749 | [O perationCo ntract] | |
| 750 | [W ebInvoke(M ethod = "G ET", | |
| 751 | Response Format = W ebMessageF ormat.Json , | |
| 752 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 753 | UriTempl ate = "upd ateregistr antstatus/ {userid}/{ newstatus} /{createdb y}")] | |
| 754 | pu blic Strin g UpdateRe gistrantSt atus(Strin g userid, String new status, St ring creat edby) | |
| 755 | { | |
| 756 | //throw new NotImp lementedEx ception(); | |
| 757 | string r esults = s tring.Empt y; | |
| 758 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 759 | JavaScri ptSerializ er seriali zer = new JavaScript Serializer (); | |
| 760 | ||
| 761 | // Updat e User Jso n with new status | |
| 762 | REGISTRA NT_JSON re cord = man ager.GetJs onData(use rid, AHOBP RGlobal.Ah obprJsonDa taTypeUser ); | |
| 763 | if (reco rd != null ) | |
| 764 | { | |
| 765 | BprU ser bprUse r = serial izer.Deser ialize<Bpr User>(reco rd.JSON_DA TA); | |
| 766 | ||
| 767 | bprU ser.userSt ate = new BprUserSta te() { las tUpdated = DateTime. UtcNow.ToS tring("yyy y-MM-ddTHH :mm:ss.fff Z"), state = newstat us }; | |
| 768 | resu lts = Save BprUser(us erid, seri alizer.Ser ialize(bpr User), cre atedby); | |
| 769 | } | |
| 770 | ||
| 771 | //Moved logic to S aveBprUser | |
| 772 | return r esults; | |
| 773 | } | |
| 774 | ||
| 775 | [O perationCo ntract] | |
| 776 | [W ebInvoke(M ethod = "G ET", | |
| 777 | Response Format = W ebMessageF ormat.Json , | |
| 778 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 779 | UriTempl ate = "upd atedefault formid/{de faultformi d}")] | |
| 780 | pu blic Strin g UpdateDe faultFormI d(String d efaultform id) | |
| 781 | { | |
| 782 | //throw new NotImp lementedEx ception(); | |
| 783 | String r esults = S tring.Empt y; | |
| 784 | ||
| 785 | try | |
| 786 | { | |
| 787 | Syst em.Configu ration.Con figuration config = WebConfigu rationMana ger.OpenWe bConfigura tion("~"); | |
| 788 | //No t sure wha t the MyVa lue settin g is for, doesn't se em to exis t | |
| 789 | Syst em.Configu ration.Key ValueConfi gurationEl ement sett ing = conf ig.AppSett ings.Setti ngs["MyVal ue"]; | |
| 790 | conf ig.AppSett ings.Setti ngs["Ahobp rDefaultFo rmId"].Val ue = defau ltformid; | |
| 791 | conf ig.Save(); | |
| 792 | resu lts = "tru e"; | |
| 793 | } | |
| 794 | catch // (Exception ex) | |
| 795 | { | |
| 796 | resu lts = "fal se"; | |
| 797 | } | |
| 798 | ||
| 799 | return r esults; | |
| 800 | } | |
| 801 | ||
| 802 | [O perationCo ntract] | |
| 803 | [W ebInvoke(M ethod = "G ET", | |
| 804 | Response Format = W ebMessageF ormat.Json , | |
| 805 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 806 | UriTempl ate = "dbr eset")] | |
| 807 | pu blic bool ResetDatab ase() | |
| 808 | { | |
| 809 | //throw new NotImp lementedEx ception(); | |
| 810 | return R EGISTRANTM anager.Res etDatabase (); | |
| 811 | } | |
| 812 | ||
| 813 | [O perationCo ntract] | |
| 814 | [W ebInvoke(M ethod = "G ET", | |
| 815 | Response Format = W ebMessageF ormat.Json , | |
| 816 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 817 | UriTempl ate = "del eteregistr ant/{regis trantid}") ] | |
| 818 | pu blic bool DeleteRegi strant(str ing regist rantid) | |
| 819 | { | |
| 820 | //throw new NotImp lementedEx ception(); | |
| 821 | if (stri ng.IsNullO rEmpty(reg istrantid) || regist rantid.All (Char.IsDi git) == fa lse) | |
| 822 | { | |
| 823 | retu rn true; | |
| 824 | } | |
| 825 | else | |
| 826 | { | |
| 827 | int id = Conve rt.ToInt32 (registran tid); | |
| 828 | retu rn REGISTR ANTManager .DeleteOne Registrant (id); | |
| 829 | } | |
| 830 | } | |
| 831 | ||
| 832 | [O perationCo ntract] | |
| 833 | [W ebInvoke(M ethod = "G ET", | |
| 834 | Response Format = W ebMessageF ormat.Json , | |
| 835 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 836 | UriTempl ate = "del etecprslog /{registra ntid}")] | |
| 837 | pu blic bool DeleteCprs Log(string registran tid) | |
| 838 | { | |
| 839 | //throw new NotImp lementedEx ception(); | |
| 840 | if (stri ng.IsNullO rEmpty(reg istrantid) || regist rantid.All (Char.IsDi git) == fa lse) | |
| 841 | { | |
| 842 | retu rn true; | |
| 843 | } | |
| 844 | else | |
| 845 | { | |
| 846 | int id = Conve rt.ToInt32 (registran tid); | |
| 847 | retu rn CPRS_LO GManager.D eleteCprsL og(id); | |
| 848 | } | |
| 849 | } | |
| 850 | ||
| 851 | [O perationCo ntract] | |
| 852 | [W ebInvoke(M ethod = "G ET", | |
| 853 | Response Format = W ebMessageF ormat.Json , | |
| 854 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 855 | UriTempl ate = "set migrationm ode/{newmo de}")] | |
| 856 | pu blic bool SetMigrati onMode(Str ing newmod e) | |
| 857 | { | |
| 858 | //throw new NotImp lementedEx ception(); | |
| 859 | if (newm ode.ToLowe r() != "mi gration") | |
| 860 | PROC ESS_METRIC SManager.C learProces sMetrics() ; | |
| 861 | ||
| 862 | //if (ne wmode.ToLo wer() == " migration" ) | |
| 863 | //{ | |
| 864 | // Se tServiceMo de("migrat ion"); | |
| 865 | ||
| 866 | //} | |
| 867 | //else | |
| 868 | //{ | |
| 869 | // // Clear the process me trics tabl e: | |
| 870 | // (n ew AHOBPRG enericMana ger()).Cle arProcessM etrics(); | |
| 871 | ||
| 872 | // Se tServiceMo de("normal "); | |
| 873 | //} | |
| 874 | ||
| 875 | System.C onfigurati on.Configu ration con fig = Syst em.Web.Con figuration .WebConfig urationMan ager.OpenW ebConfigur ation("~") ; | |
| 876 | System.C onfigurati on.KeyValu eConfigura tionElemen t setting = config.A ppSettings .Settings[ "MyValue"] ; | |
| 877 | config.A ppSettings .Settings[ "ServiceMo de"].Value = newmode ; | |
| 878 | config.S ave(); | |
| 879 | ||
| 880 | return t rue; | |
| 881 | } | |
| 882 | ||
| 883 | [O perationCo ntract] | |
| 884 | [W ebInvoke(M ethod = "G ET", | |
| 885 | Response Format = W ebMessageF ormat.Json , | |
| 886 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 887 | UriTempl ate = "get daspdf/{re gistrantid }")] | |
| 888 | pu blic byte[ ] GetDasPd f(String r egistranti d) | |
| 889 | { | |
| 890 | //throw new NotImp lementedEx ception(); | |
| 891 | byte[] v alue = new byte[0]; | |
| 892 | ||
| 893 | try | |
| 894 | { | |
| 895 | valu e = INTERF ACE_CALL_L OGManager. GetDasPdf( registrant id); | |
| 896 | } | |
| 897 | catch (E xception e x) | |
| 898 | { | |
| 899 | LogM anager.Log Error(ex.M essage, St ring.Forma t("{0}.{1} ", System. Reflection .MethodBas e.GetCurre ntMethod() .Declaring Type.FullN ame, Syste m.Reflecti on.MethodB ase.GetCur rentMethod ().Name), "RESTful S ervice", 0 ); | |
| 900 | //AH OBPRLogger .LogErrorM essage("Ex ception: " + ex.Mess age, "AHOB PR.svc." + MethodBas e.GetCurre ntMethod() .Name, ex. StackTrace ); | |
| 901 | } | |
| 902 | ||
| 903 | return v alue; | |
| 904 | } | |
| 905 | ||
| 906 | [O perationCo ntract] | |
| 907 | [W ebInvoke(M ethod = "G ET", | |
| 908 | Response Format = W ebMessageF ormat.Json , | |
| 909 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 910 | UriTempl ate = "cre atefollowu pformjson/ {toolformi d}/{issyst emwide}/{c reatedby}" )] | |
| 911 | pu blic bool CreateFoll owUpFormJs on(string toolformid , string i ssystemwid e, string createdby) | |
| 912 | { | |
| 913 | //throw new NotImp lementedEx ception(); | |
| 914 | bool res ult = fals e; | |
| 915 | ||
| 916 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 917 | result = manager.C reateFollo wupFormJso n(toolform id, issyst emwide, cr eatedby); | |
| 918 | ||
| 919 | return r esult; | |
| 920 | } | |
| 921 | ||
| 922 | [O perationCo ntract] | |
| 923 | [W ebInvoke(M ethod = "G ET", | |
| 924 | Response Format = W ebMessageF ormat.Json , | |
| 925 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 926 | UriTempl ate = "Upd ateFollowu pFormJsonS ystemWide/ {toolformi d}")] | |
| 927 | pu blic bool UpdateFoll owupFormJs onSystemWi de(string toolformid ) | |
| 928 | { | |
| 929 | //throw new NotImp lementedEx ception(); | |
| 930 | bool res ult = fals e; | |
| 931 | ||
| 932 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 933 | result = manager.U pdateFollo wupFormJso nSystemWid e(toolform id); | |
| 934 | ||
| 935 | return r esult; | |
| 936 | } | |
| 937 | ||
| 938 | [O perationCo ntract] | |
| 939 | [W ebInvoke(M ethod = "G ET", | |
| 940 | Response Format = W ebMessageF ormat.Json , | |
| 941 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 942 | UriTempl ate = "cre atemessage json/{regi strantId}/ {emailtemp lateid}/{c reatedby}" )] | |
| 943 | pu blic bool CreateMess ageJson(st ring regis trantId, s tring emai ltemplatei d, string createdby) | |
| 944 | { | |
| 945 | //throw new NotImp lementedEx ception(); | |
| 946 | bool res ult = fals e; | |
| 947 | ||
| 948 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 949 | result = manager.C reateMessa geJson(reg istrantId, emailtemp lateid, cr eatedby); | |
| 950 | ||
| 951 | return r esult; | |
| 952 | } | |
| 953 | ||
| 954 | [O perationCo ntract] | |
| 955 | [W ebInvoke(M ethod = "G ET", | |
| 956 | Response Format = W ebMessageF ormat.Json , | |
| 957 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 958 | UriTempl ate = "cre ateuserfor mjson/{reg istrantid} /{formid}/ {createdby }")] | |
| 959 | pu blic bool CreateUser FormJson(s tring regi strantid, string for mid, strin g createdb y) | |
| 960 | { | |
| 961 | //throw new NotImp lementedEx ception(); | |
| 962 | bool res ult = fals e; | |
| 963 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 964 | result = manager.C reateUserF ormJson(re gistrantid , formid, createdby) ; | |
| 965 | ||
| 966 | return r esult; | |
| 967 | } | |
| 968 | ||
| 969 | [O perationCo ntract] | |
| 970 | [W ebInvoke(M ethod = "G ET", | |
| 971 | Response Format = W ebMessageF ormat.Json , | |
| 972 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 973 | UriTempl ate = "sys temwidefor mjsons")] | |
| 974 | pu blic strin g SystemWi deFormJson s() | |
| 975 | { | |
| 976 | //throw new NotImp lementedEx ception(); | |
| 977 | string r esults = s tring.Empt y; | |
| 978 | AHOBPRJs onDataMana ger manage r = new AH OBPRJsonDa taManager( ); | |
| 979 | List<str ing> recor ds = manag er.GetSyst emWideForm Jsons(); | |
| 980 | if (reco rds.Count > 0) | |
| 981 | { | |
| 982 | Java ScriptSeri alizer ser ializer = new JavaSc riptSerial izer(); | |
| 983 | BprU serFollowu pForm user Form = new BprUserFo llowupForm (); | |
| 984 | BprF orm form = new BprFo rm(); | |
| 985 | List <BprUserFo llowupForm > userForm List = new List<BprU serFollowu pForm>(); | |
| 986 | fore ach (strin g formJson in record s) | |
| 987 | { | |
| 988 | form = ser ializer.De serialize< BprForm>(f ormJson); | |
| 989 | userForm = new BprUs erFollowup Form(); | |
| 990 | userForm._ id = form. _id; | |
| 991 | userForm.n ame = form .name; | |
| 992 | userForm.t itle = for m.title; | |
| 993 | userFormLi st.Add(use rForm); | |
| 994 | } | |
| 995 | BprU serFollowu pForms use rForms = n ew BprUser FollowupFo rms(); | |
| 996 | user Forms._id = Guid.New Guid().ToS tring(); | |
| 997 | user Forms.user FollowupFo rms = user FormList.T oArray(); | |
| 998 | resu lts = seri alizer.Ser ialize(use rForms); | |
| 999 | } | |
| 1000 | ||
| 1001 | return r esults; | |
| 1002 | } | |
| 1003 | ||
| 1004 | [O perationCo ntract] | |
| 1005 | [W ebInvoke(M ethod = "G ET", | |
| 1006 | Response Format = W ebMessageF ormat.Json , | |
| 1007 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1008 | UriTempl ate = "scr iptsbatch" )] | |
| 1009 | pu blic strin g ScriptsB atch() | |
| 1010 | { | |
| 1011 | throw ne w NotImple mentedExce ption(); | |
| 1012 | //AHOBPR ScriptsMan ager manag er = new A HOBPRScrip tsManager( ); | |
| 1013 | //string results = manager.G etScriptsB atch(); | |
| 1014 | //return results; | |
| 1015 | } | |
| 1016 | ||
| 1017 | [O perationCo ntract] | |
| 1018 | [W ebInvoke(M ethod = "G ET", | |
| 1019 | Response Format = W ebMessageF ormat.Json , | |
| 1020 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1021 | UriTempl ate = "upd atescripts batchstatu s/{id}/{ty pe}")] | |
| 1022 | pu blic bool UpdateScri ptsBatchSt atus(strin g id, stri ng type) | |
| 1023 | { | |
| 1024 | throw ne w NotImple mentedExce ption(); | |
| 1025 | //bool r esult = fa lse; | |
| 1026 | //AHOBPR ScriptsMan ager manag er = new A HOBPRScrip tsManager( ); | |
| 1027 | //result = manager .UpdateScr iptsBatchS tatus(id, type); | |
| 1028 | //return result; | |
| 1029 | } | |
| 1030 | ||
| 1031 | [O perationCo ntract] | |
| 1032 | [W ebInvoke(M ethod = "G ET", | |
| 1033 | Response Format = W ebMessageF ormat.Json , | |
| 1034 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1035 | UriTempl ate = "use rrole/{use rname}")] | |
| 1036 | pu blic strin g UserRole (string us ername) | |
| 1037 | { | |
| 1038 | throw ne w NotImple mentedExce ption(); | |
| 1039 | //string role = st ring.Empty ; | |
| 1040 | //AHOBPR GenericMan ager manag er = new A HOBPRGener icManager( ); | |
| 1041 | //role = manager.G etUserRole (username) ; | |
| 1042 | //return role; | |
| 1043 | } | |
| 1044 | ||
| 1045 | [O perationCo ntract] | |
| 1046 | [W ebInvoke(M ethod = "P OST", | |
| 1047 | Response Format = W ebMessageF ormat.Json , | |
| 1048 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1049 | UriTempl ate = "inf o/{userId} ")] | |
| 1050 | pu blic strin g SaveBprI nfo(string userId, s tring bprI nfo) | |
| 1051 | { | |
| 1052 | throw ne w NotImple mentedExce ption(); | |
| 1053 | //return this.Save BprInfo(us erId, bprI nfo, strin g.Empty); | |
| 1054 | } | |
| 1055 | ||
| 1056 | // / <summary > | |
| 1057 | // / Save Bpr Info | |
| 1058 | // / </summar y> | |
| 1059 | // / <param n ame="userI d"></param > | |
| 1060 | // / <param n ame="bprIn fo"></para m> | |
| 1061 | // / <param n ame="creat edBy"></pa ram> | |
| 1062 | // / <returns ></returns > | |
| 1063 | st ring SaveB prInfo(str ing userId , string b prInfo, st ring creat edBy) | |
| 1064 | { | |
| 1065 | throw ne w NotImple mentedExce ption(); | |
| 1066 | //string results = string.Em pty; | |
| 1067 | ||
| 1068 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1069 | //REGIST RANT_JSON registrant Json = man ager.SaveJ sonData(us erId, AHOB PRGlobal.A hobprJsonD ataTypeInf o, bprInfo , createdB y); | |
| 1070 | //if (re gistrantJs on != null ) | |
| 1071 | //{ | |
| 1072 | // tr y | |
| 1073 | // { | |
| 1074 | // results = registra ntJson.JSO N_DATA; | |
| 1075 | // } | |
| 1076 | // ca tch | |
| 1077 | // { | |
| 1078 | // results = string.E mpty; | |
| 1079 | // } | |
| 1080 | //} | |
| 1081 | ||
| 1082 | //return results; | |
| 1083 | } | |
| 1084 | ||
| 1085 | [O perationCo ntract] | |
| 1086 | [W ebInvoke(M ethod = "P OST", | |
| 1087 | Response Format = W ebMessageF ormat.Json , | |
| 1088 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1089 | UriTempl ate = "use r/{userId} ")] | |
| 1090 | pu blic strin g SaveBprU ser(string userId, s tring bprU ser) | |
| 1091 | { | |
| 1092 | throw ne w NotImple mentedExce ption(); | |
| 1093 | //return this.Save BprUser(us erId, bprU ser, strin g.Empty); | |
| 1094 | } | |
| 1095 | ||
| 1096 | // / <summary > | |
| 1097 | // / Save Bpr User | |
| 1098 | // / </summar y> | |
| 1099 | // / <param n ame="userI d"></param > | |
| 1100 | // / <param n ame="bprUs er"></para m> | |
| 1101 | // / <param n ame="creat edBy"></pa ram> | |
| 1102 | // / <returns ></returns > | |
| 1103 | st ring SaveB prUser(str ing userId , string b prUser, st ring creat edBy) | |
| 1104 | { | |
| 1105 | throw ne w NotImple mentedExce ption(); | |
| 1106 | //string results = string.Em pty; | |
| 1107 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1108 | //JavaSc riptSerial izer seria lizer = ne w JavaScri ptSerializ er(); | |
| 1109 | //REGIST RANT_JSON record = n ull; | |
| 1110 | //string oldStatus = string. Empty; | |
| 1111 | //string newStatus = string. Empty; | |
| 1112 | ||
| 1113 | //// Get latest us er record | |
| 1114 | //record = manager .GetJsonDa ta(userId, AHOBPRGlo bal.Ahobpr JsonDataTy peUser); | |
| 1115 | //if (re cord != nu ll) | |
| 1116 | //{ | |
| 1117 | // Bp rUser oldU ser = seri alizer.Des erialize<B prUser>(re cord.JSON_ DATA); | |
| 1118 | // if (oldUser != null) o ldStatus = oldUser.u serState.s tate; | |
| 1119 | ||
| 1120 | // Bp rUser newU ser = seri alizer.Des erialize<B prUser>(bp rUser); | |
| 1121 | // if (newUser != null) n ewStatus = newUser.u serState.s tate; | |
| 1122 | ||
| 1123 | // // There is a defect wh ere old Mo ngoDB sess ion data i s overwrit ing SQL Se rver data | |
| 1124 | // // Do not all ow status updates if it regres ses the us er back to a lower s tatus | |
| 1125 | // if ((oldStat us == "PAR TICIPANT" || oldStat us == "ELI GIBLE" || oldStatus == "REVIEW ED_ELIGIBL E" || oldS tatus == " REVIEWED_N OT_ELIGIBL E") | |
| 1126 | // && (newS tatus == " NOT_ELIGIB LE" || new Status == "REVIEW" | | newStatu s == "CONS ENT" || ne wStatus == "NOT_CONS ENT" || ne wStatus == "REVIEW_R EQUESTED") ) | |
| 1127 | // { | |
| 1128 | // newStatu s = oldSta tus; | |
| 1129 | // } | |
| 1130 | // el se if ((ol dStatus == "ELIGIBLE ") | |
| 1131 | // && (newS tatus == " REVIEWED_N OT_ELIGIBL E" || newS tatus == " REVIEWED_E LIGIBLE")) | |
| 1132 | // { | |
| 1133 | // newStatu s = oldSta tus; | |
| 1134 | // } | |
| 1135 | ||
| 1136 | // ne wUser.user State = ne w BprUserS tate() { l astUpdated = DateTim e.UtcNow.T oString("y yyy-MM-ddT HH:mm:ss.f ffZ"), sta te = newSt atus }; | |
| 1137 | ||
| 1138 | // bp rUser = se rializer.S erialize(n ewUser); | |
| 1139 | //} | |
| 1140 | ||
| 1141 | //REGIST RANT_JSON registrant Json = man ager.SaveJ sonData(us erId, AHOB PRGlobal.A hobprJsonD ataTypeUse r, bprUser , createdB y); | |
| 1142 | //if (re gistrantJs on != null ) | |
| 1143 | //{ | |
| 1144 | // re sults = re gistrantJs on.JSON_DA TA; | |
| 1145 | ||
| 1146 | // tr y | |
| 1147 | // { | |
| 1148 | // //Update Registran t Table | |
| 1149 | // manager. ParseUserJ son(result s); | |
| 1150 | // } | |
| 1151 | // ca tch | |
| 1152 | // { | |
| 1153 | // results = string.E mpty; | |
| 1154 | // } | |
| 1155 | //} | |
| 1156 | ||
| 1157 | ////Busi ness Rule: Registran t can corr ect errors within 30 days | |
| 1158 | ////Belo w will cle ar out com pleted dat es and pdf files | |
| 1159 | //if (ol dStatus == "PARTICIP ANT" && ne wStatus != "PARTICIP ANT") | |
| 1160 | //{ | |
| 1161 | // // Update th e response json if i t has ques tionnaire completed date | |
| 1162 | // re cord = man ager.GetJs onData(use rId, AHOBP RGlobal.Ah obprJsonDa taTypeResp onses); | |
| 1163 | // if (record ! = null && !string.Is NullOrEmpt y(record.J SON_DATA)) | |
| 1164 | // { | |
| 1165 | // //There is respons e JSON dat a in the d atabase wi th an arra y type for "answerVa lue" | |
| 1166 | // //howeve r the plur al "answer Values" is supposed to be used for an ar ray answer | |
| 1167 | // string s earch = "a nswerValue " + '"' + ":["; | |
| 1168 | // string r eplace = " answerValu es" + '"' + ":["; | |
| 1169 | // record.J SON_DATA = record.JS ON_DATA.Re place(sear ch, replac e); | |
| 1170 | ||
| 1171 | // BprRespo nses bprRe sponses = serializer .Deseriali ze<BprResp onses>(rec ord.JSON_D ATA); | |
| 1172 | // if (bprR esponses ! = null) | |
| 1173 | // { | |
| 1174 | // if ( bprRespons es.respons eStatus != null) | |
| 1175 | // { | |
| 1176 | // if (!strin g.IsNullOr Empty(bprR esponses.r esponseSta tus.questi onnaireCom pletedDate )) | |
| 1177 | // { | |
| 1178 | // bprRes ponses.res ponseStatu s.question naireCompl etedDate = string.Em pty; | |
| 1179 | // SaveBp rResponses (userId, s erializer. Serialize( bprRespons es)); | |
| 1180 | ||
| 1181 | // //Remo ve the PDF file | |
| 1182 | // AHOBPR FileManage r fileMana ger = new AHOBPRFile Manager(); | |
| 1183 | // fileMa nager.Dele teFile(use rId, AHOBP RGlobal.Ah obprFileTy peResponse Pdf); | |
| 1184 | ||
| 1185 | // //Remo ve the Que stionnaire CompletedD ate from F ORM_RESPON SE_STATUS table | |
| 1186 | // AHOBPR FormRespon seManager responseMa nanger = n ew AHOBPRF ormRespons eManager() ; | |
| 1187 | // respon seMananger .RemoveQue stionnaire CompleteDa te(userId) ; | |
| 1188 | // } | |
| 1189 | // } | |
| 1190 | // } | |
| 1191 | // } | |
| 1192 | //} | |
| 1193 | ||
| 1194 | //return results; | |
| 1195 | } | |
| 1196 | ||
| 1197 | [O perationCo ntract] | |
| 1198 | [W ebInvoke(M ethod = "P OST", | |
| 1199 | Response Format = W ebMessageF ormat.Json , | |
| 1200 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1201 | UriTempl ate = "res ponses/{us erId}")] | |
| 1202 | pu blic strin g SaveBprR esponses(s tring user Id, string bprRespon ses) | |
| 1203 | { | |
| 1204 | throw ne w NotImple mentedExce ption(); | |
| 1205 | //string results = string.Em pty; | |
| 1206 | ||
| 1207 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1208 | //REGIST RANT_JSON registrant Json = man ager.SaveJ sonData(us erId, AHOB PRGlobal.A hobprJsonD ataTypeRes ponses, bp rResponses , string.E mpty); | |
| 1209 | //if (re gistrantJs on != null ) | |
| 1210 | //{ | |
| 1211 | // tr y | |
| 1212 | // { | |
| 1213 | // results = registra ntJson.JSO N_DATA; | |
| 1214 | // } | |
| 1215 | // ca tch | |
| 1216 | // { | |
| 1217 | // results = string.E mpty; | |
| 1218 | // } | |
| 1219 | //} | |
| 1220 | //return results; | |
| 1221 | } | |
| 1222 | ||
| 1223 | [O perationCo ntract] | |
| 1224 | [W ebInvoke(M ethod = "P OST", | |
| 1225 | Response Format = W ebMessageF ormat.Json , | |
| 1226 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1227 | UriTempl ate = "fol lowuprespo nses/{user Id}/{formI d}")] | |
| 1228 | pu blic strin g SaveBprF ollowupRes ponses(str ing userId , string f ormId, str ing bprRes ponses) | |
| 1229 | { | |
| 1230 | throw ne w NotImple mentedExce ption(); | |
| 1231 | //string results = string.Em pty; | |
| 1232 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1233 | //REGIST RANT_JSON_ FOLLOWUP r egistrantJ son = mana ger.SaveJs onFollowup Data(userI d, AHOBPRG lobal.Ahob prJsonType ResponsesF ollowup, f ormId, bpr Responses, AHOBPRGlo bal.Ahobpr JsonStatus Completed, "no", str ing.Empty) ; | |
| 1234 | //if (re gistrantJs on != null ) | |
| 1235 | //{ | |
| 1236 | // tr y | |
| 1237 | // { | |
| 1238 | // UpdateUs erFollowup FormStatus (userId, f ormId); | |
| 1239 | // results = registra ntJson.JSO N_DATA; | |
| 1240 | // } | |
| 1241 | // ca tch | |
| 1242 | // { | |
| 1243 | // results = string.E mpty; | |
| 1244 | // } | |
| 1245 | //} | |
| 1246 | ||
| 1247 | //return results; | |
| 1248 | } | |
| 1249 | ||
| 1250 | [O perationCo ntract] | |
| 1251 | [W ebInvoke(M ethod = "P OST", | |
| 1252 | Response Format = W ebMessageF ormat.Json , | |
| 1253 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1254 | UriTempl ate = "for m/{formId} ")] | |
| 1255 | pu blic bool SaveBprFor m(string f ormId, str ing bprFor m) | |
| 1256 | { | |
| 1257 | throw ne w NotImple mentedExce ption(); | |
| 1258 | //bool r esults = f alse; | |
| 1259 | ||
| 1260 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1261 | //REGIST RANT_JSON registrant Json = man ager.SaveJ sonData(fo rmId, AHOB PRGlobal.A hobprJsonD ataTypeFor m, bprForm , string.E mpty); | |
| 1262 | //if (re gistrantJs on != null ) | |
| 1263 | //{ | |
| 1264 | // tr y | |
| 1265 | // { | |
| 1266 | // results = registra ntJson.JSO N_DATA.Len gth > 0; | |
| 1267 | // } | |
| 1268 | // ca tch | |
| 1269 | // { | |
| 1270 | // results = false; | |
| 1271 | // } | |
| 1272 | //} | |
| 1273 | //return results; | |
| 1274 | } | |
| 1275 | ||
| 1276 | [O perationCo ntract] | |
| 1277 | [W ebInvoke(M ethod = "P OST", | |
| 1278 | Response Format = W ebMessageF ormat.Json , | |
| 1279 | UriTempl ate = "upl oad/{fileT ype}/{file Id}")] | |
| 1280 | pu blic bool SaveFile(s tring file Type, stri ng fileId, Stream pd fStream) | |
| 1281 | { | |
| 1282 | throw ne w NotImple mentedExce ption(); | |
| 1283 | //bool r esult = fa lse; | |
| 1284 | ||
| 1285 | //AHOBPR FileManage r manager = new AHOB PRFileMana ger(); | |
| 1286 | //result = manager .SaveFile( fileId, fi leType, fi leStream); | |
| 1287 | ||
| 1288 | //return result; | |
| 1289 | } | |
| 1290 | ||
| 1291 | [O perationCo ntract] | |
| 1292 | [W ebInvoke(M ethod = "P OST", | |
| 1293 | Response Format = W ebMessageF ormat.Json , | |
| 1294 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1295 | UriTempl ate = "upd atevistalo gin")] | |
| 1296 | pu blic bool UpdateVist aLogin(Str ing userid ) | |
| 1297 | { | |
| 1298 | throw ne w NotImple mentedExce ption(); | |
| 1299 | //return (new AHOB PRUserMana ger()).Upd ateLastVis taLogin(us erid); | |
| 1300 | } | |
| 1301 | ||
| 1302 | [O perationCo ntract] | |
| 1303 | [W ebInvoke(M ethod = "P OST", | |
| 1304 | Response Format = W ebMessageF ormat.Json , | |
| 1305 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1306 | UriTempl ate = "dat aaccesslog ")] | |
| 1307 | pu blic bool SaveDataAc cessLog(ob ject dataA ccessLog) //DataAcce ssLog data AccessLog) | |
| 1308 | { | |
| 1309 | throw ne w NotImple mentedExce ption(); | |
| 1310 | //AHOBPR GenericMan ager manag er = new A HOBPRGener icManager( ); | |
| 1311 | //return manager.S aveDataAcc essLog(dat aAccessLog .userId, d ataAccessL og.pageNam e, dataAcc essLog.use rAgent); | |
| 1312 | } | |
| 1313 | ||
| 1314 | [O perationCo ntract] | |
| 1315 | [W ebInvoke(M ethod = "P OST", | |
| 1316 | Response Format = W ebMessageF ormat.Json , | |
| 1317 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1318 | UriTempl ate = "upd atemessage status/{us erId}")] | |
| 1319 | pu blic strin g UpdateMe ssageStatu s(string u serId, str ing bprMes sages) | |
| 1320 | { | |
| 1321 | throw ne w NotImple mentedExce ption(); | |
| 1322 | //string results = string.Em pty; | |
| 1323 | //AHOBPR JsonDataMa nager mana ger = new AHOBPRJson DataManage r(); | |
| 1324 | //List<s tring> rec ords = man ager.GetJs onFollowup s(userId, AHOBPRGlob al.AhobprJ sonTypeMes sage); | |
| 1325 | //if (re cords.Coun t > 0) | |
| 1326 | //{ | |
| 1327 | // Ja vaScriptSe rializer s erializer = new Java ScriptSeri alizer(); | |
| 1328 | // Bp rMessage m essage = n ew BprMess age(); | |
| 1329 | // Li st<BprMess age> messa ges = new List<BprMe ssage>(); | |
| 1330 | // fo reach (str ing jsonDa ta in reco rds) | |
| 1331 | // { | |
| 1332 | // message = serializ er.Deseria lize<BprMe ssage>(jso nData); | |
| 1333 | // if (mess age.status == AHOBPR Global.Aho bprJsonSta tusNew) | |
| 1334 | // { | |
| 1335 | // mess age.status = AHOBPRG lobal.Ahob prJsonStat usComplete d; | |
| 1336 | // mess age.comple tedDate = DateTime.N ow.ToStrin g(); | |
| 1337 | // stri ng message Json = ser ializer.Se rialize(me ssage); | |
| 1338 | // mana ger.SaveJs onFollowup Data(userI d, AHOBPRG lobal.Ahob prJsonType Message, m essage._id , messageJ son, AHOBP RGlobal.Ah obprJsonSt atusComple ted, "no", string.Em pty); | |
| 1339 | // } | |
| 1340 | // messages .Add(messa ge); | |
| 1341 | // } | |
| 1342 | // Bp rMessages newMessage s = new Bp rMessages( ); | |
| 1343 | // ne wMessages. userId = u serId; | |
| 1344 | // me ssages = ( from m in messages | |
| 1345 | // orderby m. _id descen ding | |
| 1346 | // select m). ToList(); | |
| 1347 | // ne wMessages. messages = messages. ToArray(); | |
| 1348 | // re sults = se rializer.S erialize(n ewMessages ); | |
| 1349 | //} | |
| 1350 | ||
| 1351 | //return results; | |
| 1352 | } | |
| 1353 | ||
| 1354 | [O perationCo ntract] | |
| 1355 | [W ebInvoke(M ethod = "P OST", | |
| 1356 | Response Format = W ebMessageF ormat.Json , | |
| 1357 | BodyStyl e = WebMes sageBodySt yle.Wrappe d, | |
| 1358 | UriTempl ate = "sav einterface log/{userI d}")] | |
| 1359 | pu blic bool SaveInterf aceLog(str ing userId , string v alue) | |
| 1360 | { | |
| 1361 | throw ne w NotImple mentedExce ption(); | |
| 1362 | //AHOBPR GenericMan ager manag er = new A HOBPRGener icManager( ); | |
| 1363 | //return manager.S aveInterfa ceLog(user Id, value) ; | |
| 1364 | } | |
| 1365 | ||
| 1366 | #e ndregion | |
| 1367 | ||
| 1368 | #r egion util s | |
| 1369 | ||
| 1370 | pr ivate bool EdipiIsVa lid(string edipi) | |
| 1371 | { | |
| 1372 | Regex re gex = new Regex("^\\ d{10}$", R egexOption s.Compiled ); | |
| 1373 | return ! (string.Is NullOrEmpt y(edipi) | | !regex.I sMatch(edi pi)); | |
| 1374 | } | |
| 1375 | ||
| 1376 | #e ndregion | |
| 1377 | } | |
| 1378 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.