Request
Response
XMLOps
VB.NET
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | <?xml version="1.0" encoding="utf-8"?> <?qbxml version="16.0"?> <QBXML> <QBXMLMsgsRq onError="stopOnError"> <EmployeeQueryRq metaData="ENUMTYPE"> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <MaxReturned >INTTYPE</MaxReturned> <!-- optional --> <!-- ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All --> <ActiveStatus >ENUMTYPE</ActiveStatus> <!-- optional --> <FromModifiedDate >DATETIMETYPE</FromModifiedDate> <!-- optional --> <ToModifiedDate >DATETIMETYPE</ToModifiedDate> <!-- optional --> <!-- BEGIN OR --> <NameFilter> <!-- optional --> <!-- MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith --> <MatchCriterion >ENUMTYPE</MatchCriterion> <!-- required --> <Name >STRTYPE</Name> <!-- required --> </NameFilter> <!-- OR --> <NameRangeFilter> <!-- optional --> <FromName >STRTYPE</FromName> <!-- optional --> <ToName >STRTYPE</ToName> <!-- optional --> </NameRangeFilter> <!-- END OR --> <!-- END OR --> <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat --> <OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat --> </EmployeeQueryRq> <EmployeeQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE"> <EmployeeRet> <!-- optional, may repeat --> <ListID >IDTYPE</ListID> <!-- required --> <TimeCreated >DATETIMETYPE</TimeCreated> <!-- required --> <TimeModified >DATETIMETYPE</TimeModified> <!-- required --> <EditSequence >STRTYPE</EditSequence> <!-- required --> <Name >STRTYPE</Name> <!-- required --> <IsActive >BOOLTYPE</IsActive> <!-- optional --> <Salutation >STRTYPE</Salutation> <!-- optional --> <FirstName >STRTYPE</FirstName> <!-- optional --> <MiddleName >STRTYPE</MiddleName> <!-- optional --> <LastName >STRTYPE</LastName> <!-- optional --> <JobTitle >STRTYPE</JobTitle> <!-- optional --> <SupervisorRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </SupervisorRef> <Department >STRTYPE</Department> <!-- optional --> <Description >STRTYPE</Description> <!-- optional --> <TargetBonus >AMTTYPE</TargetBonus> <!-- optional --> <EmployeeAddress> <!-- optional --> <Addr1 >STRTYPE</Addr1> <!-- optional --> <Addr2 >STRTYPE</Addr2> <!-- optional --> <City >STRTYPE</City> <!-- optional --> <State >STRTYPE</State> <!-- optional --> <PostalCode >STRTYPE</PostalCode> <!-- optional --> </EmployeeAddress> <PrintAs >STRTYPE</PrintAs> <!-- optional --> <Phone >STRTYPE</Phone> <!-- optional --> <Mobile >STRTYPE</Mobile> <!-- optional --> <Pager >STRTYPE</Pager> <!-- optional --> <PagerPIN >STRTYPE</PagerPIN> <!-- optional --> <AltPhone >STRTYPE</AltPhone> <!-- optional --> <Fax >STRTYPE</Fax> <!-- optional --> <SSN >STRTYPE</SSN> <!-- optional --> <Email >STRTYPE</Email> <!-- optional --> <AdditionalContactRef> <!-- must occur 0 - 8 times --> <ContactName >STRTYPE</ContactName> <!-- required --> <ContactValue >STRTYPE</ContactValue> <!-- required --> </AdditionalContactRef> <EmergencyContacts> <!-- optional --> <PrimaryContact> <!-- optional --> <ContactName >STRTYPE</ContactName> <!-- required --> <ContactValue >STRTYPE</ContactValue> <!-- required --> <!-- Relation may have one of the following values: Spouse, Partner, Mother, Father, Sister, Brother, Son, Daughter, Friend, Other --> <Relation >ENUMTYPE</Relation> <!-- optional --> </PrimaryContact> <SecondaryContact> <!-- optional --> <ContactName >STRTYPE</ContactName> <!-- required --> <ContactValue >STRTYPE</ContactValue> <!-- required --> <!-- Relation may have one of the following values: Spouse, Partner, Mother, Father, Sister, Brother, Son, Daughter, Friend, Other --> <Relation >ENUMTYPE</Relation> <!-- optional --> </SecondaryContact> </EmergencyContacts> <!-- EmployeeType may have one of the following values: Officer, Owner, Regular [DEFAULT], Statutory --> <EmployeeType >ENUMTYPE</EmployeeType> <!-- optional --> <!-- PartOrFullTime may have one of the following values: PartTime, FullTime --> <PartOrFullTime >ENUMTYPE</PartOrFullTime> <!-- optional --> <!-- Exempt may have one of the following values: Exempt, NonExempt --> <Exempt >ENUMTYPE</Exempt> <!-- optional --> <!-- KeyEmployee may have one of the following values: Yes, No --> <KeyEmployee >ENUMTYPE</KeyEmployee> <!-- optional --> <!-- Gender may have one of the following values: Male, Female --> <Gender >ENUMTYPE</Gender> <!-- optional --> <HiredDate >DATETYPE</HiredDate> <!-- optional --> <OriginalHireDate >DATETYPE</OriginalHireDate> <!-- optional --> <AdjustedServiceDate >DATETYPE</AdjustedServiceDate> <!-- optional --> <ReleasedDate >DATETYPE</ReleasedDate> <!-- optional --> <BirthDate >DATETYPE</BirthDate> <!-- optional --> <!-- USCitizen may have one of the following values: Yes, No --> <USCitizen >ENUMTYPE</USCitizen> <!-- optional --> <!-- Ethnicity may have one of the following values: AmericianIndian, Asian, Black, Hawaiian, Hispanic, White, TwoOrMoreRaces --> <Ethnicity >ENUMTYPE</Ethnicity> <!-- optional --> <!-- Disabled may have one of the following values: Yes, No --> <Disabled >ENUMTYPE</Disabled> <!-- optional --> <DisabilityDesc >STRTYPE</DisabilityDesc> <!-- optional --> <!-- OnFile may have one of the following values: Yes, No --> <OnFile >ENUMTYPE</OnFile> <!-- optional --> <WorkAuthExpireDate >DATETYPE</WorkAuthExpireDate> <!-- optional --> <!-- USVeteran may have one of the following values: Yes, No --> <USVeteran >ENUMTYPE</USVeteran> <!-- optional --> <!-- MilitaryStatus may have one of the following values: Active, Reserve --> <MilitaryStatus >ENUMTYPE</MilitaryStatus> <!-- optional --> <AccountNumber >STRTYPE</AccountNumber> <!-- optional --> <Notes >STRTYPE</Notes> <!-- optional --> <AdditionalNotesRet> <!-- optional, may repeat --> <NoteID >INTTYPE</NoteID> <!-- required --> <Date >DATETYPE</Date> <!-- required --> <Note >STRTYPE</Note> <!-- required --> </AdditionalNotesRet> <BillingRateRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </BillingRateRef> <EmployeePayrollInfo> <!-- optional --> <!-- PayPeriod may have one of the following values: Daily, Weekly, Biweekly, Semimonthly, Monthly, Quarterly, Yearly --> <PayPeriod >ENUMTYPE</PayPeriod> <!-- optional --> <ClassRef> <!-- optional --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </ClassRef> <!-- BEGIN OR --> <ClearEarnings >BOOLTYPE</ClearEarnings> <!-- optional --> <!-- OR --> <Earnings> <!-- optional, may repeat --> <PayrollItemWageRef> <!-- required --> <ListID >IDTYPE</ListID> <!-- optional --> <FullName >STRTYPE</FullName> <!-- optional --> </PayrollItemWageRef> <!-- BEGIN OR --> <Rate >PRICETYPE</Rate> <!-- optional --> <!-- OR --> <RatePercent >PERCENTTYPE</RatePercent> <!-- optional --> <!-- END OR --> </Earnings> <!-- END OR --> <IsUsingTimeDataToCreatePaychecks >BOOLTYPE</IsUsingTimeDataToCreatePaychecks> <!-- optional --> <!-- UseTimeDataToCreatePaychecks may have one of the following values: NotSet, UseTimeData, DoNotUseTimeData --> <UseTimeDataToCreatePaychecks >ENUMTYPE</UseTimeDataToCreatePaychecks> <!-- optional --> <SickHours> <!-- optional --> <HoursAvailable >TIMEINTERVALTYPE</HoursAvailable> <!-- optional --> <!-- AccrualPeriod may have one of the following values: BeginningOfYear, EveryHourOnPaycheck, EveryPaycheck --> <AccrualPeriod >ENUMTYPE</AccrualPeriod> <!-- optional --> <HoursAccrued >TIMEINTERVALTYPE</HoursAccrued> <!-- optional --> <MaximumHours >TIMEINTERVALTYPE</MaximumHours> <!-- optional --> <IsResettingHoursEachNewYear >BOOLTYPE</IsResettingHoursEachNewYear> <!-- optional --> <HoursUsed >TIMEINTERVALTYPE</HoursUsed> <!-- optional --> <AccrualStartDate >DATETYPE</AccrualStartDate> <!-- optional --> </SickHours> <VacationHours> <!-- optional --> <HoursAvailable >TIMEINTERVALTYPE</HoursAvailable> <!-- optional --> <!-- AccrualPeriod may have one of the following values: BeginningOfYear, EveryHourOnPaycheck, EveryPaycheck --> <AccrualPeriod >ENUMTYPE</AccrualPeriod> <!-- optional --> <HoursAccrued >TIMEINTERVALTYPE</HoursAccrued> <!-- optional --> <MaximumHours >TIMEINTERVALTYPE</MaximumHours> <!-- optional --> <IsResettingHoursEachNewYear >BOOLTYPE</IsResettingHoursEachNewYear> <!-- optional --> <HoursUsed >TIMEINTERVALTYPE</HoursUsed> <!-- optional --> <AccrualStartDate >DATETYPE</AccrualStartDate> <!-- optional --> </VacationHours> </EmployeePayrollInfo> <ExternalGUID >GUIDTYPE</ExternalGUID> <!-- optional --> <DataExtRet> <!-- optional, may repeat --> <OwnerID >GUIDTYPE</OwnerID> <!-- optional --> <DataExtName >STRTYPE</DataExtName> <!-- required --> <!-- DataExtType may have one of the following values: AMTTYPE, DATETIMETYPE, INTTYPE, PERCENTTYPE, PRICETYPE, QUANTYPE, STR1024TYPE, STR255TYPE --> <DataExtType >ENUMTYPE</DataExtType> <!-- required --> <DataExtValue >STRTYPE</DataExtValue> <!-- required --> </DataExtRet> </EmployeeRet> </EmployeeQueryRs> </QBXMLMsgsRq> </QBXML> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | 'The following sample code is generated as an illustration of 'Creating requests and parsing responses ONLY 'This code is NOT intended to show best practices or ideal code 'Use at your most careful discretion imports System imports System.Net imports System.Drawing imports System.Collections imports System.ComponentModel imports System.Windows.Forms imports System.Data imports System.IO imports Interop.QBFC16 Module com.intuit.idn.samples Public Class Sample Public Sub DoEmployeeQuery() Dim sessionBegun as Boolean sessionBegun = False Dim connectionOpen as Boolean connectionOpen = False Dim sessionManager as QBSessionManager sessionManager = nothing Try 'Create the session Manager object sessionManager = new QBSessionManager 'Create the message set request object to hold our request Dim requestMsgSet as IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0) requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue BuildEmployeeQueryRq(requestMsgSet) 'Connect to QuickBooks and begin a session sessionManager.OpenConnection("","Sample Code from OSR") connectionOpen = True sessionManager.BeginSession("", ENOpenMode.omDontCare) sessionBegun = True 'Send the request and get the response from QuickBooks Dim responseMsgSet as IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet) 'End the session and close the connection to QuickBooks sessionManager.EndSession() sessionBegun = False sessionManager.CloseConnection() connectionOpen = False WalkEmployeeQueryRs(responseMsgSet) Catch e as Exception MessageBox.Show(e.Message, "Error") if (sessionBegun) then sessionManager.EndSession() End If if (connectionOpen) then sessionManager.CloseConnection() End If End Try End Sub Public Sub BuildEmployeeQueryRq(requestMsgSet as IMsgSetRequest) Dim EmployeeQueryRq as IEmployeeQuery EmployeeQueryRq= requestMsgSet.AppendEmployeeQueryRq() Dim ORListQueryElementType8729 as String ORListQueryElementType8729 = "ListIDList" if (ORListQueryElementType8729 == "ListIDList") then 'Set field value for ListIDList 'May create more than one of these if needed EmployeeQueryRq.ORListQuery.ListIDList.Add("200000-1011023419") End If if (ORListQueryElementType8729 == "FullNameList") then 'Set field value for FullNameList 'May create more than one of these if needed EmployeeQueryRq.ORListQuery.FullNameList.Add("ab") End If if (ORListQueryElementType8729 == "ListFilter") then 'Set field value for MaxReturned EmployeeQueryRq.ORListQuery.ListFilter.MaxReturned.SetValue(6) 'Set field value for ActiveStatus EmployeeQueryRq.ORListQuery.ListFilter.ActiveStatus.SetValue(ENActiveStatus.asActiveOnly [DEFAULT]) 'Set field value for FromModifiedDate EmployeeQueryRq.ORListQuery.ListFilter.FromModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false) 'Set field value for ToModifiedDate EmployeeQueryRq.ORListQuery.ListFilter.ToModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false) Dim ORNameFilterElementType8730 as String ORNameFilterElementType8730 = "NameFilter" if (ORNameFilterElementType8730 == "NameFilter") then 'Set field value for MatchCriterion EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameFilter.MatchCriterion.SetValue(ENMatchCriterion.mcStartsWith) 'Set field value for Name EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameFilter.Name.SetValue("ab") End If if (ORNameFilterElementType8730 == "NameRangeFilter") then 'Set field value for FromName EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameRangeFilter.FromName.SetValue("ab") 'Set field value for ToName EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameRangeFilter.ToName.SetValue("ab") End If End If 'Set field value for IncludeRetElementList 'May create more than one of these if needed EmployeeQueryRq.IncludeRetElementList.Add("ab") 'Set field value for OwnerIDList 'May create more than one of these if needed EmployeeQueryRq.OwnerIDList.Add(System.Guid.NewGuid().ToString()) End Sub Public Sub WalkEmployeeQueryRs( responseMsgSet as IMsgSetResponse) if (responseMsgSet is nothing) then Exit Sub End If Dim responseList as IResponseList responseList = responseMsgSet.ResponseList if (responseList is nothing) then Exit Sub End If 'if we sent only one request, there is only one response, we'll walk the list for this sample for j=0 to responseList.Count-1 Dim response as IResponse response = responseList.GetAt(j) 'check the status code of the response, 0=ok, >0 is warning if (response.StatusCode >= 0) then 'the request-specific response is in the details, make sure we have some if (not response.Detail is nothing) then 'make sure the response is the type we're expecting Dim responseType as ENResponseType responseType = CType(response.Type.GetValue(),ENResponseType) if (responseType == ENResponseType.rtEmployeeQueryRs) then 'upcast to more specific type here, this is safe because we checked with response.Type check above Dim EmployeeRet as IEmployeeRetList EmployeeRet = CType(response.Detail,IEmployeeRetList) WalkEmployeeRet(EmployeeRet) End If End If End If Next j End Sub Public Sub WalkEmployeeRet(EmployeeRet as IEmployeeRetList) if (EmployeeRet is nothing) then Exit Sub End If 'Go through all the elements of IEmployeeRetList 'Get value of ListID Dim ListID8731 as String ListID8731 = EmployeeRet.ListID.GetValue() 'Get value of TimeCreated Dim TimeCreated8732 as DateTime TimeCreated8732 = EmployeeRet.TimeCreated.GetValue() 'Get value of TimeModified Dim TimeModified8733 as DateTime TimeModified8733 = EmployeeRet.TimeModified.GetValue() 'Get value of EditSequence Dim EditSequence8734 as String EditSequence8734 = EmployeeRet.EditSequence.GetValue() 'Get value of Name Dim Name8735 as String Name8735 = EmployeeRet.Name.GetValue() 'Get value of IsActive if ( not EmployeeRet.IsActive is nothing) then Dim IsActive8736 as Boolean IsActive8736 = EmployeeRet.IsActive.GetValue() End If 'Get value of Salutation if ( not EmployeeRet.Salutation is nothing) then Dim Salutation8737 as String Salutation8737 = EmployeeRet.Salutation.GetValue() End If 'Get value of FirstName if ( not EmployeeRet.FirstName is nothing) then Dim FirstName8738 as String FirstName8738 = EmployeeRet.FirstName.GetValue() End If 'Get value of MiddleName if ( not EmployeeRet.MiddleName is nothing) then Dim MiddleName8739 as String MiddleName8739 = EmployeeRet.MiddleName.GetValue() End If 'Get value of LastName if ( not EmployeeRet.LastName is nothing) then Dim LastName8740 as String LastName8740 = EmployeeRet.LastName.GetValue() End If 'Get value of JobTitle if ( not EmployeeRet.JobTitle is nothing) then Dim JobTitle8741 as String JobTitle8741 = EmployeeRet.JobTitle.GetValue() End If if (not EmployeeRet.SupervisorRef. is nothing) then 'Get value of ListID if ( not EmployeeRet.SupervisorRef.ListID is nothing) then Dim ListID8742 as String ListID8742 = EmployeeRet.SupervisorRef.ListID.GetValue() End If 'Get value of FullName if ( not EmployeeRet.SupervisorRef.FullName is nothing) then Dim FullName8743 as String FullName8743 = EmployeeRet.SupervisorRef.FullName.GetValue() End If End If 'Get value of Department if ( not EmployeeRet.Department is nothing) then Dim Department8744 as String Department8744 = EmployeeRet.Department.GetValue() End If 'Get value of Description if ( not EmployeeRet.Description is nothing) then Dim Description8745 as String Description8745 = EmployeeRet.Description.GetValue() End If 'Get value of TargetBonus if ( not EmployeeRet.TargetBonus is nothing) then Dim TargetBonus8746 as Double TargetBonus8746 = EmployeeRet.TargetBonus.GetValue() End If if (not EmployeeRet.EmployeeAddress. is nothing) then 'Get value of Addr1 if ( not EmployeeRet.EmployeeAddress.Addr1 is nothing) then Dim Addr18747 as String Addr18747 = EmployeeRet.EmployeeAddress.Addr1.GetValue() End If 'Get value of Addr2 if ( not EmployeeRet.EmployeeAddress.Addr2 is nothing) then Dim Addr28748 as String Addr28748 = EmployeeRet.EmployeeAddress.Addr2.GetValue() End If 'Get value of City if ( not EmployeeRet.EmployeeAddress.City is nothing) then Dim City8749 as String City8749 = EmployeeRet.EmployeeAddress.City.GetValue() End If 'Get value of State if ( not EmployeeRet.EmployeeAddress.State is nothing) then Dim State8750 as String State8750 = EmployeeRet.EmployeeAddress.State.GetValue() End If 'Get value of PostalCode if ( not EmployeeRet.EmployeeAddress.PostalCode is nothing) then Dim PostalCode8751 as String PostalCode8751 = EmployeeRet.EmployeeAddress.PostalCode.GetValue() End If End If 'Get value of PrintAs if ( not EmployeeRet.PrintAs is nothing) then Dim PrintAs8752 as String PrintAs8752 = EmployeeRet.PrintAs.GetValue() End If 'Get value of Phone if ( not EmployeeRet.Phone is nothing) then Dim Phone8753 as String Phone8753 = EmployeeRet.Phone.GetValue() End If 'Get value of Mobile if ( not EmployeeRet.Mobile is nothing) then Dim Mobile8754 as String Mobile8754 = EmployeeRet.Mobile.GetValue() End If 'Get value of Pager if ( not EmployeeRet.Pager is nothing) then Dim Pager8755 as String Pager8755 = EmployeeRet.Pager.GetValue() End If 'Get value of PagerPIN if ( not EmployeeRet.PagerPIN is nothing) then Dim PagerPIN8756 as String PagerPIN8756 = EmployeeRet.PagerPIN.GetValue() End If 'Get value of AltPhone if ( not EmployeeRet.AltPhone is nothing) then Dim AltPhone8757 as String AltPhone8757 = EmployeeRet.AltPhone.GetValue() End If 'Get value of Fax if ( not EmployeeRet.Fax is nothing) then Dim Fax8758 as String Fax8758 = EmployeeRet.Fax.GetValue() End If 'Get value of SSN if ( not EmployeeRet.SSN is nothing) then Dim SSN8759 as String SSN8759 = EmployeeRet.SSN.GetValue() End If 'Get value of Email if ( not EmployeeRet.Email is nothing) then Dim Email8760 as String Email8760 = EmployeeRet.Email.GetValue() End If if (not EmployeeRet.AdditionalContactRefList is nothing) Dim i8761 as Integer for i8761 = 0 to EmployeeRet.AdditionalContactRefList.Count - 1 Dim QBBaseRef as IQBBaseRef QBBaseRef = EmployeeRet.AdditionalContactRefList.GetAt(i8761) 'Get value of ContactName Dim ContactName8762 as String ContactName8762 = QBBaseRefContactName.GetValue() 'Get value of ContactValue Dim ContactValue8763 as String ContactValue8763 = QBBaseRefContactValue.GetValue() Next i8761 End If if (not EmployeeRet.EmergencyContacts. is nothing) then if (not EmployeeRet.EmergencyContacts.PrimaryContact. is nothing) then 'Get value of ContactName Dim ContactName8764 as String ContactName8764 = EmployeeRet.EmergencyContacts.PrimaryContact.ContactName.GetValue() 'Get value of ContactValue Dim ContactValue8765 as String ContactValue8765 = EmployeeRet.EmergencyContacts.PrimaryContact.ContactValue.GetValue() 'Get value of Relation if ( not EmployeeRet.EmergencyContacts.PrimaryContact.Relation is nothing) then Dim Relation8766 as ENRelation Relation8766 = EmployeeRet.EmergencyContacts.PrimaryContact.Relation.GetValue() End If End If if (not EmployeeRet.EmergencyContacts.SecondaryContact. is nothing) then 'Get value of ContactName Dim ContactName8767 as String ContactName8767 = EmployeeRet.EmergencyContacts.SecondaryContact.ContactName.GetValue() 'Get value of ContactValue Dim ContactValue8768 as String ContactValue8768 = EmployeeRet.EmergencyContacts.SecondaryContact.ContactValue.GetValue() 'Get value of Relation if ( not EmployeeRet.EmergencyContacts.SecondaryContact.Relation is nothing) then Dim Relation8769 as ENRelation Relation8769 = EmployeeRet.EmergencyContacts.SecondaryContact.Relation.GetValue() End If End If End If 'Get value of EmployeeType if ( not EmployeeRet.EmployeeType is nothing) then Dim EmployeeType8770 as ENEmployeeType EmployeeType8770 = EmployeeRet.EmployeeType.GetValue() End If 'Get value of PartOrFullTime if ( not EmployeeRet.PartOrFullTime is nothing) then Dim PartOrFullTime8771 as ENPartOrFullTime PartOrFullTime8771 = EmployeeRet.PartOrFullTime.GetValue() End If 'Get value of Exempt if ( not EmployeeRet.Exempt is nothing) then Dim Exempt8772 as ENExempt Exempt8772 = EmployeeRet.Exempt.GetValue() End If 'Get value of KeyEmployee if ( not EmployeeRet.KeyEmployee is nothing) then Dim KeyEmployee8773 as ENKeyEmployee KeyEmployee8773 = EmployeeRet.KeyEmployee.GetValue() End If 'Get value of Gender if ( not EmployeeRet.Gender is nothing) then Dim Gender8774 as ENGender Gender8774 = EmployeeRet.Gender.GetValue() End If 'Get value of HiredDate if ( not EmployeeRet.HiredDate is nothing) then Dim HiredDate8775 as DateTime HiredDate8775 = EmployeeRet.HiredDate.GetValue() End If 'Get value of OriginalHireDate if ( not EmployeeRet.OriginalHireDate is nothing) then Dim OriginalHireDate8776 as DateTime OriginalHireDate8776 = EmployeeRet.OriginalHireDate.GetValue() End If 'Get value of AdjustedServiceDate if ( not EmployeeRet.AdjustedServiceDate is nothing) then Dim AdjustedServiceDate8777 as DateTime AdjustedServiceDate8777 = EmployeeRet.AdjustedServiceDate.GetValue() End If 'Get value of ReleasedDate if ( not EmployeeRet.ReleasedDate is nothing) then Dim ReleasedDate8778 as DateTime ReleasedDate8778 = EmployeeRet.ReleasedDate.GetValue() End If 'Get value of BirthDate if ( not EmployeeRet.BirthDate is nothing) then Dim BirthDate8779 as DateTime BirthDate8779 = EmployeeRet.BirthDate.GetValue() End If 'Get value of USCitizen if ( not EmployeeRet.USCitizen is nothing) then Dim USCitizen8780 as ENUSCitizen USCitizen8780 = EmployeeRet.USCitizen.GetValue() End If 'Get value of Ethnicity if ( not EmployeeRet.Ethnicity is nothing) then Dim Ethnicity8781 as ENEthnicity Ethnicity8781 = EmployeeRet.Ethnicity.GetValue() End If 'Get value of Disabled if ( not EmployeeRet.Disabled is nothing) then Dim Disabled8782 as ENDisabled Disabled8782 = EmployeeRet.Disabled.GetValue() End If 'Get value of DisabilityDesc if ( not EmployeeRet.DisabilityDesc is nothing) then Dim DisabilityDesc8783 as String DisabilityDesc8783 = EmployeeRet.DisabilityDesc.GetValue() End If 'Get value of OnFile if ( not EmployeeRet.OnFile is nothing) then Dim OnFile8784 as ENOnFile OnFile8784 = EmployeeRet.OnFile.GetValue() End If 'Get value of WorkAuthExpireDate if ( not EmployeeRet.WorkAuthExpireDate is nothing) then Dim WorkAuthExpireDate8785 as DateTime WorkAuthExpireDate8785 = EmployeeRet.WorkAuthExpireDate.GetValue() End If 'Get value of USVeteran if ( not EmployeeRet.USVeteran is nothing) then Dim USVeteran8786 as ENUSVeteran USVeteran8786 = EmployeeRet.USVeteran.GetValue() End If 'Get value of MilitaryStatus if ( not EmployeeRet.MilitaryStatus is nothing) then Dim MilitaryStatus8787 as ENMilitaryStatus MilitaryStatus8787 = EmployeeRet.MilitaryStatus.GetValue() End If 'Get value of AccountNumber if ( not EmployeeRet.AccountNumber is nothing) then Dim AccountNumber8788 as String AccountNumber8788 = EmployeeRet.AccountNumber.GetValue() End If 'Get value of Notes if ( not EmployeeRet.Notes is nothing) then Dim Notes8789 as String Notes8789 = EmployeeRet.Notes.GetValue() End If if (not EmployeeRet.AdditionalNotesRetList is nothing) Dim i8790 as Integer for i8790 = 0 to EmployeeRet.AdditionalNotesRetList.Count - 1 Dim AdditionalNotesRet as IAdditionalNotesRet AdditionalNotesRet = EmployeeRet.AdditionalNotesRetList.GetAt(i8790) 'Get value of NoteID Dim NoteID8791 as Integer NoteID8791 = AdditionalNotesRetNoteID.GetValue() 'Get value of Date Dim Date8792 as DateTime Date8792 = AdditionalNotesRetDate.GetValue() 'Get value of Note Dim Note8793 as String Note8793 = AdditionalNotesRetNote.GetValue() Next i8790 End If if (not EmployeeRet.BillingRateRef. is nothing) then 'Get value of ListID if ( not EmployeeRet.BillingRateRef.ListID is nothing) then Dim ListID8794 as String ListID8794 = EmployeeRet.BillingRateRef.ListID.GetValue() End If 'Get value of FullName if ( not EmployeeRet.BillingRateRef.FullName is nothing) then Dim FullName8795 as String FullName8795 = EmployeeRet.BillingRateRef.FullName.GetValue() End If End If if (not EmployeeRet.EmployeePayrollInfo. is nothing) then 'Get value of PayPeriod if ( not EmployeeRet.EmployeePayrollInfo.PayPeriod is nothing) then Dim PayPeriod8796 as ENPayPeriod PayPeriod8796 = EmployeeRet.EmployeePayrollInfo.PayPeriod.GetValue() End If if (not EmployeeRet.EmployeePayrollInfo.ClassRef. is nothing) then 'Get value of ListID if ( not EmployeeRet.EmployeePayrollInfo.ClassRef.ListID is nothing) then Dim ListID8797 as String ListID8797 = EmployeeRet.EmployeePayrollInfo.ClassRef.ListID.GetValue() End If 'Get value of FullName if ( not EmployeeRet.EmployeePayrollInfo.ClassRef.FullName is nothing) then Dim FullName8798 as String FullName8798 = EmployeeRet.EmployeePayrollInfo.ClassRef.FullName.GetValue() End If End If if (not EmployeeRet.EmployeePayrollInfo.OREarnings is nothing) then if (not EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings is nothing) then 'Get value of ClearEarnings if ( not EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings is nothing) then Dim ClearEarnings8800 as Boolean ClearEarnings8800 = EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings.GetValue() End If End If if (not EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList is nothing) then if (not EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList is nothing) Dim i8801 as Integer for i8801 = 0 to EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.Count - 1 Dim Earnings as IEarnings Earnings = EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.GetAt(i8801) 'Get value of ListID if ( not EarningsPayrollItemWageRef.ListID is nothing) then Dim ListID8802 as String ListID8802 = EarningsPayrollItemWageRef.ListID.GetValue() End If 'Get value of FullName if ( not EarningsPayrollItemWageRef.FullName is nothing) then Dim FullName8803 as String FullName8803 = EarningsPayrollItemWageRef.FullName.GetValue() End If if (not EarningsORRate is nothing) then if (not EarningsORRate.Rate is nothing) then 'Get value of Rate if ( not EarningsORRate.Rate is nothing) then Dim Rate8805 as Double Rate8805 = EarningsORRate.Rate.GetValue() End If End If if (not EarningsORRate.RatePercent is nothing) then 'Get value of RatePercent if ( not EarningsORRate.RatePercent is nothing) then Dim RatePercent8806 as Double RatePercent8806 = EarningsORRate.RatePercent.GetValue() End If End If End If Next i8801 End If End If End If 'Get value of IsUsingTimeDataToCreatePaychecks if ( not EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks is nothing) then Dim IsUsingTimeDataToCreatePaychecks8807 as Boolean IsUsingTimeDataToCreatePaychecks8807 = EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.GetValue() End If 'Get value of UseTimeDataToCreatePaychecks if ( not EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks is nothing) then Dim UseTimeDataToCreatePaychecks8808 as ENUseTimeDataToCreatePaychecks UseTimeDataToCreatePaychecks8808 = EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks.GetValue() End If if (not EmployeeRet.EmployeePayrollInfo.SickHours. is nothing) then 'Get value of HoursAvailable if ( not EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable is nothing) then Dim HoursAvailable8809 as IQBTimeIntervalType HoursAvailable8809 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable.GetValue() End If 'Get value of AccrualPeriod if ( not EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod is nothing) then Dim AccrualPeriod8810 as ENAccrualPeriod AccrualPeriod8810 = EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod.GetValue() End If 'Get value of HoursAccrued if ( not EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued is nothing) then Dim HoursAccrued8811 as IQBTimeIntervalType HoursAccrued8811 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued.GetValue() End If 'Get value of MaximumHours if ( not EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours is nothing) then Dim MaximumHours8812 as IQBTimeIntervalType MaximumHours8812 = EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours.GetValue() End If 'Get value of IsResettingHoursEachNewYear if ( not EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear is nothing) then Dim IsResettingHoursEachNewYear8813 as Boolean IsResettingHoursEachNewYear8813 = EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.GetValue() End If 'Get value of HoursUsed if ( not EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed is nothing) then Dim HoursUsed8814 as IQBTimeIntervalType HoursUsed8814 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed.GetValue() End If 'Get value of AccrualStartDate if ( not EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate is nothing) then Dim AccrualStartDate8815 as DateTime AccrualStartDate8815 = EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate.GetValue() End If End If if (not EmployeeRet.EmployeePayrollInfo.VacationHours. is nothing) then 'Get value of HoursAvailable if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable is nothing) then Dim HoursAvailable8816 as IQBTimeIntervalType HoursAvailable8816 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable.GetValue() End If 'Get value of AccrualPeriod if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod is nothing) then Dim AccrualPeriod8817 as ENAccrualPeriod AccrualPeriod8817 = EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod.GetValue() End If 'Get value of HoursAccrued if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued is nothing) then Dim HoursAccrued8818 as IQBTimeIntervalType HoursAccrued8818 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued.GetValue() End If 'Get value of MaximumHours if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours is nothing) then Dim MaximumHours8819 as IQBTimeIntervalType MaximumHours8819 = EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours.GetValue() End If 'Get value of IsResettingHoursEachNewYear if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear is nothing) then Dim IsResettingHoursEachNewYear8820 as Boolean IsResettingHoursEachNewYear8820 = EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.GetValue() End If 'Get value of HoursUsed if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed is nothing) then Dim HoursUsed8821 as IQBTimeIntervalType HoursUsed8821 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed.GetValue() End If 'Get value of AccrualStartDate if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate is nothing) then Dim AccrualStartDate8822 as DateTime AccrualStartDate8822 = EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate.GetValue() End If End If End If 'Get value of ExternalGUID if ( not EmployeeRet.ExternalGUID is nothing) then Dim ExternalGUID8823 as String ExternalGUID8823 = EmployeeRet.ExternalGUID.GetValue() End If if (not EmployeeRet.DataExtRetList is nothing) Dim i8824 as Integer for i8824 = 0 to EmployeeRet.DataExtRetList.Count - 1 Dim DataExtRet as IDataExtRet DataExtRet = EmployeeRet.DataExtRetList.GetAt(i8824) 'Get value of OwnerID if ( not DataExtRetOwnerID is nothing) then Dim OwnerID8825 as String OwnerID8825 = DataExtRetOwnerID.GetValue() End If 'Get value of DataExtName Dim DataExtName8826 as String DataExtName8826 = DataExtRetDataExtName.GetValue() 'Get value of DataExtType Dim DataExtType8827 as ENDataExtType DataExtType8827 = DataExtRetDataExtType.GetValue() 'Get value of DataExtValue Dim DataExtValue8828 as String DataExtValue8828 = DataExtRetDataExtValue.GetValue() Next i8824 End If End Sub End Class End Module |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 | //The following sample code is generated as an illustration of //Creating requests and parsing responses ONLY //This code is NOT intended to show best practices or ideal code //Use at your most careful discretion using System; using System.Net; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using Interop.QBFC16; namespace com.intuit.idn.samples { public class Sample { public void DoEmployeeQuery() { bool sessionBegun = false; bool connectionOpen = false; QBSessionManager sessionManager = null; try { //Create the session Manager object sessionManager = new QBSessionManager(); //Create the message set request object to hold our request IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0); requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue; BuildEmployeeQueryRq(requestMsgSet); //Connect to QuickBooks and begin a session sessionManager.OpenConnection("","Sample Code from OSR"); connectionOpen = true; sessionManager.BeginSession("", ENOpenMode.omDontCare); sessionBegun = true; //Send the request and get the response from QuickBooks IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet); //End the session and close the connection to QuickBooks sessionManager.EndSession(); sessionBegun = false; sessionManager.CloseConnection(); connectionOpen = false; WalkEmployeeQueryRs(responseMsgSet); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); if (sessionBegun) { sessionManager.EndSession(); } if (connectionOpen) { sessionManager.CloseConnection(); } } } void BuildEmployeeQueryRq(IMsgSetRequest requestMsgSet) { IEmployeeQuery EmployeeQueryRq= requestMsgSet.AppendEmployeeQueryRq(); //Set attributes //Set field value for metaData EmployeeQueryRq.metaData.SetValue("IQBENmetaDataType"); string ORListQueryElementType8629 = "ListIDList"; if (ORListQueryElementType8629 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed EmployeeQueryRq.ORListQuery.ListIDList.Add("200000-1011023419"); } if (ORListQueryElementType8629 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed EmployeeQueryRq.ORListQuery.FullNameList.Add("ab"); } if (ORListQueryElementType8629 == "ListFilter") { //Set field value for MaxReturned EmployeeQueryRq.ORListQuery.ListFilter.MaxReturned.SetValue(6); //Set field value for ActiveStatus EmployeeQueryRq.ORListQuery.ListFilter.ActiveStatus.SetValue(ENActiveStatus.asActiveOnly [DEFAULT]); //Set field value for FromModifiedDate EmployeeQueryRq.ORListQuery.ListFilter.FromModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false); //Set field value for ToModifiedDate EmployeeQueryRq.ORListQuery.ListFilter.ToModifiedDate.SetValue(DateTime.Parse("12/15/2007 12:15:12"),false); string ORNameFilterElementType8630 = "NameFilter"; if (ORNameFilterElementType8630 == "NameFilter") { //Set field value for MatchCriterion EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameFilter.MatchCriterion.SetValue(ENMatchCriterion.mcStartsWith); //Set field value for Name EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameFilter.Name.SetValue("ab"); } if (ORNameFilterElementType8630 == "NameRangeFilter") { //Set field value for FromName EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameRangeFilter.FromName.SetValue("ab"); //Set field value for ToName EmployeeQueryRq.ORListQuery.ListFilter.ORNameFilter.NameRangeFilter.ToName.SetValue("ab"); } } //Set field value for IncludeRetElementList //May create more than one of these if needed EmployeeQueryRq.IncludeRetElementList.Add("ab"); //Set field value for OwnerIDList //May create more than one of these if needed EmployeeQueryRq.OwnerIDList.Add(Guid.NewGuid().ToString()); } void WalkEmployeeQueryRs(IMsgSetResponse responseMsgSet) { if (responseMsgSet == null) return; IResponseList responseList = responseMsgSet.ResponseList; if (responseList == null) return; //if we sent only one request, there is only one response, we'll walk the list for this sample for(int i=0; i < responseList.Count; i++) { IResponse response = responseList.GetAt(i); //check the status code of the response, 0=ok, >0 is warning if (response.StatusCode >= 0) { //the request-specific response is in the details, make sure we have some if (response.Detail != null) { //make sure the response is the type we're expecting ENResponseType responseType = (ENResponseType)response.Type.GetValue(); if (responseType == ENResponseType.rtEmployeeQueryRs) { //upcast to more specific type here, this is safe because we checked with response.Type check above IEmployeeRetList EmployeeRet = (IEmployeeRetList)response.Detail; WalkEmployeeRet(EmployeeRet); } } } } } void WalkEmployeeRet(IEmployeeRetList EmployeeRet) { if (EmployeeRet == null) return; //Go through all the elements of IEmployeeRetList //Get value of ListID string ListID8631 = (string)EmployeeRet.ListID.GetValue(); //Get value of TimeCreated DateTime TimeCreated8632 = (DateTime)EmployeeRet.TimeCreated.GetValue(); //Get value of TimeModified DateTime TimeModified8633 = (DateTime)EmployeeRet.TimeModified.GetValue(); //Get value of EditSequence string EditSequence8634 = (string)EmployeeRet.EditSequence.GetValue(); //Get value of Name string Name8635 = (string)EmployeeRet.Name.GetValue(); //Get value of IsActive if (EmployeeRet.IsActive != null) { bool IsActive8636 = (bool)EmployeeRet.IsActive.GetValue(); } //Get value of Salutation if (EmployeeRet.Salutation != null) { string Salutation8637 = (string)EmployeeRet.Salutation.GetValue(); } //Get value of FirstName if (EmployeeRet.FirstName != null) { string FirstName8638 = (string)EmployeeRet.FirstName.GetValue(); } //Get value of MiddleName if (EmployeeRet.MiddleName != null) { string MiddleName8639 = (string)EmployeeRet.MiddleName.GetValue(); } //Get value of LastName if (EmployeeRet.LastName != null) { string LastName8640 = (string)EmployeeRet.LastName.GetValue(); } //Get value of JobTitle if (EmployeeRet.JobTitle != null) { string JobTitle8641 = (string)EmployeeRet.JobTitle.GetValue(); } if (EmployeeRet.SupervisorRef != null) { //Get value of ListID if (EmployeeRet.SupervisorRef.ListID != null) { string ListID8642 = (string)EmployeeRet.SupervisorRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.SupervisorRef.FullName != null) { string FullName8643 = (string)EmployeeRet.SupervisorRef.FullName.GetValue(); } } //Get value of Department if (EmployeeRet.Department != null) { string Department8644 = (string)EmployeeRet.Department.GetValue(); } //Get value of Description if (EmployeeRet.Description != null) { string Description8645 = (string)EmployeeRet.Description.GetValue(); } //Get value of TargetBonus if (EmployeeRet.TargetBonus != null) { double TargetBonus8646 = (double)EmployeeRet.TargetBonus.GetValue(); } if (EmployeeRet.EmployeeAddress != null) { //Get value of Addr1 if (EmployeeRet.EmployeeAddress.Addr1 != null) { string Addr18647 = (string)EmployeeRet.EmployeeAddress.Addr1.GetValue(); } //Get value of Addr2 if (EmployeeRet.EmployeeAddress.Addr2 != null) { string Addr28648 = (string)EmployeeRet.EmployeeAddress.Addr2.GetValue(); } //Get value of City if (EmployeeRet.EmployeeAddress.City != null) { string City8649 = (string)EmployeeRet.EmployeeAddress.City.GetValue(); } //Get value of State if (EmployeeRet.EmployeeAddress.State != null) { string State8650 = (string)EmployeeRet.EmployeeAddress.State.GetValue(); } //Get value of PostalCode if (EmployeeRet.EmployeeAddress.PostalCode != null) { string PostalCode8651 = (string)EmployeeRet.EmployeeAddress.PostalCode.GetValue(); } } //Get value of PrintAs if (EmployeeRet.PrintAs != null) { string PrintAs8652 = (string)EmployeeRet.PrintAs.GetValue(); } //Get value of Phone if (EmployeeRet.Phone != null) { string Phone8653 = (string)EmployeeRet.Phone.GetValue(); } //Get value of Mobile if (EmployeeRet.Mobile != null) { string Mobile8654 = (string)EmployeeRet.Mobile.GetValue(); } //Get value of Pager if (EmployeeRet.Pager != null) { string Pager8655 = (string)EmployeeRet.Pager.GetValue(); } //Get value of PagerPIN if (EmployeeRet.PagerPIN != null) { string PagerPIN8656 = (string)EmployeeRet.PagerPIN.GetValue(); } //Get value of AltPhone if (EmployeeRet.AltPhone != null) { string AltPhone8657 = (string)EmployeeRet.AltPhone.GetValue(); } //Get value of Fax if (EmployeeRet.Fax != null) { string Fax8658 = (string)EmployeeRet.Fax.GetValue(); } //Get value of SSN if (EmployeeRet.SSN != null) { string SSN8659 = (string)EmployeeRet.SSN.GetValue(); } //Get value of Email if (EmployeeRet.Email != null) { string Email8660 = (string)EmployeeRet.Email.GetValue(); } if (EmployeeRet.AdditionalContactRefList != null) { for (int i8661 = 0; i8661 < EmployeeRet.AdditionalContactRefList.Count; i8661++) { IQBBaseRef QBBaseRef = EmployeeRet.AdditionalContactRefList.GetAt(i8661); //Get value of ContactName string ContactName8662 = (string)QBBaseRef.ContactName.GetValue(); //Get value of ContactValue string ContactValue8663 = (string)QBBaseRef.ContactValue.GetValue(); } } if (EmployeeRet.EmergencyContacts != null) { if (EmployeeRet.EmergencyContacts.PrimaryContact != null) { //Get value of ContactName string ContactName8664 = (string)EmployeeRet.EmergencyContacts.PrimaryContact.ContactName.GetValue(); //Get value of ContactValue string ContactValue8665 = (string)EmployeeRet.EmergencyContacts.PrimaryContact.ContactValue.GetValue(); //Get value of Relation if (EmployeeRet.EmergencyContacts.PrimaryContact.Relation != null) { ENRelation Relation8666 = (ENRelation)EmployeeRet.EmergencyContacts.PrimaryContact.Relation.GetValue(); } } if (EmployeeRet.EmergencyContacts.SecondaryContact != null) { //Get value of ContactName string ContactName8667 = (string)EmployeeRet.EmergencyContacts.SecondaryContact.ContactName.GetValue(); //Get value of ContactValue string ContactValue8668 = (string)EmployeeRet.EmergencyContacts.SecondaryContact.ContactValue.GetValue(); //Get value of Relation if (EmployeeRet.EmergencyContacts.SecondaryContact.Relation != null) { ENRelation Relation8669 = (ENRelation)EmployeeRet.EmergencyContacts.SecondaryContact.Relation.GetValue(); } } } //Get value of EmployeeType if (EmployeeRet.EmployeeType != null) { ENEmployeeType EmployeeType8670 = (ENEmployeeType)EmployeeRet.EmployeeType.GetValue(); } //Get value of PartOrFullTime if (EmployeeRet.PartOrFullTime != null) { ENPartOrFullTime PartOrFullTime8671 = (ENPartOrFullTime)EmployeeRet.PartOrFullTime.GetValue(); } //Get value of Exempt if (EmployeeRet.Exempt != null) { ENExempt Exempt8672 = (ENExempt)EmployeeRet.Exempt.GetValue(); } //Get value of KeyEmployee if (EmployeeRet.KeyEmployee != null) { ENKeyEmployee KeyEmployee8673 = (ENKeyEmployee)EmployeeRet.KeyEmployee.GetValue(); } //Get value of Gender if (EmployeeRet.Gender != null) { ENGender Gender8674 = (ENGender)EmployeeRet.Gender.GetValue(); } //Get value of HiredDate if (EmployeeRet.HiredDate != null) { DateTime HiredDate8675 = (DateTime)EmployeeRet.HiredDate.GetValue(); } //Get value of OriginalHireDate if (EmployeeRet.OriginalHireDate != null) { DateTime OriginalHireDate8676 = (DateTime)EmployeeRet.OriginalHireDate.GetValue(); } //Get value of AdjustedServiceDate if (EmployeeRet.AdjustedServiceDate != null) { DateTime AdjustedServiceDate8677 = (DateTime)EmployeeRet.AdjustedServiceDate.GetValue(); } //Get value of ReleasedDate if (EmployeeRet.ReleasedDate != null) { DateTime ReleasedDate8678 = (DateTime)EmployeeRet.ReleasedDate.GetValue(); } //Get value of BirthDate if (EmployeeRet.BirthDate != null) { DateTime BirthDate8679 = (DateTime)EmployeeRet.BirthDate.GetValue(); } //Get value of USCitizen if (EmployeeRet.USCitizen != null) { ENUSCitizen USCitizen8680 = (ENUSCitizen)EmployeeRet.USCitizen.GetValue(); } //Get value of Ethnicity if (EmployeeRet.Ethnicity != null) { ENEthnicity Ethnicity8681 = (ENEthnicity)EmployeeRet.Ethnicity.GetValue(); } //Get value of Disabled if (EmployeeRet.Disabled != null) { ENDisabled Disabled8682 = (ENDisabled)EmployeeRet.Disabled.GetValue(); } //Get value of DisabilityDesc if (EmployeeRet.DisabilityDesc != null) { string DisabilityDesc8683 = (string)EmployeeRet.DisabilityDesc.GetValue(); } //Get value of OnFile if (EmployeeRet.OnFile != null) { ENOnFile OnFile8684 = (ENOnFile)EmployeeRet.OnFile.GetValue(); } //Get value of WorkAuthExpireDate if (EmployeeRet.WorkAuthExpireDate != null) { DateTime WorkAuthExpireDate8685 = (DateTime)EmployeeRet.WorkAuthExpireDate.GetValue(); } //Get value of USVeteran if (EmployeeRet.USVeteran != null) { ENUSVeteran USVeteran8686 = (ENUSVeteran)EmployeeRet.USVeteran.GetValue(); } //Get value of MilitaryStatus if (EmployeeRet.MilitaryStatus != null) { ENMilitaryStatus MilitaryStatus8687 = (ENMilitaryStatus)EmployeeRet.MilitaryStatus.GetValue(); } //Get value of AccountNumber if (EmployeeRet.AccountNumber != null) { string AccountNumber8688 = (string)EmployeeRet.AccountNumber.GetValue(); } //Get value of Notes if (EmployeeRet.Notes != null) { string Notes8689 = (string)EmployeeRet.Notes.GetValue(); } if (EmployeeRet.AdditionalNotesRetList != null) { for (int i8690 = 0; i8690 < EmployeeRet.AdditionalNotesRetList.Count; i8690++) { IAdditionalNotesRet AdditionalNotesRet = EmployeeRet.AdditionalNotesRetList.GetAt(i8690); //Get value of NoteID int NoteID8691 = (int)AdditionalNotesRet.NoteID.GetValue(); //Get value of Date DateTime Date8692 = (DateTime)AdditionalNotesRet.Date.GetValue(); //Get value of Note string Note8693 = (string)AdditionalNotesRet.Note.GetValue(); } } if (EmployeeRet.BillingRateRef != null) { //Get value of ListID if (EmployeeRet.BillingRateRef.ListID != null) { string ListID8694 = (string)EmployeeRet.BillingRateRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.BillingRateRef.FullName != null) { string FullName8695 = (string)EmployeeRet.BillingRateRef.FullName.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo != null) { //Get value of PayPeriod if (EmployeeRet.EmployeePayrollInfo.PayPeriod != null) { ENPayPeriod PayPeriod8696 = (ENPayPeriod)EmployeeRet.EmployeePayrollInfo.PayPeriod.GetValue(); } if (EmployeeRet.EmployeePayrollInfo.ClassRef != null) { //Get value of ListID if (EmployeeRet.EmployeePayrollInfo.ClassRef.ListID != null) { string ListID8697 = (string)EmployeeRet.EmployeePayrollInfo.ClassRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.EmployeePayrollInfo.ClassRef.FullName != null) { string FullName8698 = (string)EmployeeRet.EmployeePayrollInfo.ClassRef.FullName.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo.OREarnings != null) { if (EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings != null) { //Get value of ClearEarnings if (EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings != null) { bool ClearEarnings8700 = (bool)EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList != null) { if (EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList != null) { for (int i8701 = 0; i8701 < EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.Count; i8701++) { IEarnings Earnings = EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.GetAt(i8701); //Get value of ListID if (Earnings.PayrollItemWageRef.ListID != null) { string ListID8702 = (string)Earnings.PayrollItemWageRef.ListID.GetValue(); } //Get value of FullName if (Earnings.PayrollItemWageRef.FullName != null) { string FullName8703 = (string)Earnings.PayrollItemWageRef.FullName.GetValue(); } if (Earnings.ORRate != null) { if (Earnings.ORRate.Rate != null) { //Get value of Rate if (Earnings.ORRate.Rate != null) { double Rate8705 = (double)Earnings.ORRate.Rate.GetValue(); } } if (Earnings.ORRate.RatePercent != null) { //Get value of RatePercent if (Earnings.ORRate.RatePercent != null) { double RatePercent8706 = (double)Earnings.ORRate.RatePercent.GetValue(); } } } } } } } //Get value of IsUsingTimeDataToCreatePaychecks if (EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks != null) { bool IsUsingTimeDataToCreatePaychecks8707 = (bool)EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.GetValue(); } //Get value of UseTimeDataToCreatePaychecks if (EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks != null) { ENUseTimeDataToCreatePaychecks UseTimeDataToCreatePaychecks8708 = (ENUseTimeDataToCreatePaychecks)EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks.GetValue(); } if (EmployeeRet.EmployeePayrollInfo.SickHours != null) { //Get value of HoursAvailable if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable != null) { IQBTimeIntervalType HoursAvailable8709 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable.GetValue(); } //Get value of AccrualPeriod if (EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod != null) { ENAccrualPeriod AccrualPeriod8710 = (ENAccrualPeriod)EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod.GetValue(); } //Get value of HoursAccrued if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued != null) { IQBTimeIntervalType HoursAccrued8711 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued.GetValue(); } //Get value of MaximumHours if (EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours != null) { IQBTimeIntervalType MaximumHours8712 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours.GetValue(); } //Get value of IsResettingHoursEachNewYear if (EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear != null) { bool IsResettingHoursEachNewYear8713 = (bool)EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.GetValue(); } //Get value of HoursUsed if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed != null) { IQBTimeIntervalType HoursUsed8714 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed.GetValue(); } //Get value of AccrualStartDate if (EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate != null) { DateTime AccrualStartDate8715 = (DateTime)EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo.VacationHours != null) { //Get value of HoursAvailable if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable != null) { IQBTimeIntervalType HoursAvailable8716 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable.GetValue(); } //Get value of AccrualPeriod if (EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod != null) { ENAccrualPeriod AccrualPeriod8717 = (ENAccrualPeriod)EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod.GetValue(); } //Get value of HoursAccrued if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued != null) { IQBTimeIntervalType HoursAccrued8718 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued.GetValue(); } //Get value of MaximumHours if (EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours != null) { IQBTimeIntervalType MaximumHours8719 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours.GetValue(); } //Get value of IsResettingHoursEachNewYear if (EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear != null) { bool IsResettingHoursEachNewYear8720 = (bool)EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.GetValue(); } //Get value of HoursUsed if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed != null) { IQBTimeIntervalType HoursUsed8721 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed.GetValue(); } //Get value of AccrualStartDate if (EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate != null) { DateTime AccrualStartDate8722 = (DateTime)EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate.GetValue(); } } } //Get value of ExternalGUID if (EmployeeRet.ExternalGUID != null) { string ExternalGUID8723 = (string)EmployeeRet.ExternalGUID.GetValue(); } if (EmployeeRet.DataExtRetList != null) { for (int i8724 = 0; i8724 < EmployeeRet.DataExtRetList.Count; i8724++) { IDataExtRet DataExtRet = EmployeeRet.DataExtRetList.GetAt(i8724); //Get value of OwnerID if (DataExtRet.OwnerID != null) { string OwnerID8725 = (string)DataExtRet.OwnerID.GetValue(); } //Get value of DataExtName string DataExtName8726 = (string)DataExtRet.DataExtName.GetValue(); //Get value of DataExtType ENDataExtType DataExtType8727 = (ENDataExtType)DataExtRet.DataExtType.GetValue(); //Get value of DataExtValue string DataExtValue8728 = (string)DataExtRet.DataExtValue.GetValue(); } } } } } |