Adds an employee with personal data about the employee as well as certain payroll-related data.
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 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 | <?xml version="1.0" encoding="utf-8"?> <?qbxml version="17.0"?> <QBXML> <QBXMLMsgsRq onError="stopOnError"> <EmployeeAddRq> <EmployeeAdd> <!-- 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 --> <AdditionalNotes> <!-- optional, may repeat --> <Note >STRTYPE</Note> <!-- required --> </AdditionalNotes> <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 --> </EmployeeAdd> <IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat --> </EmployeeAddRq> <EmployeeAddRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE"> <EmployeeRet> <!-- optional --> <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> <ErrorRecovery> <!-- optional --> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional --> <!-- OR --> <OwnerID >GUIDTYPE</OwnerID> <!-- optional --> <!-- OR --> <TxnID >IDTYPE</TxnID> <!-- optional --> <!-- END OR --> <TxnNumber >INTTYPE</TxnNumber> <!-- optional --> <EditSequence >STRTYPE</EditSequence> <!-- optional --> <ExternalGUID >GUIDTYPE</ExternalGUID> <!-- optional --> </ErrorRecovery> </EmployeeAddRs> </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 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | '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 DoEmployeeAdd()
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
BuildEmployeeAddRq(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
WalkEmployeeAddRs(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 BuildEmployeeAddRq(requestMsgSet as IMsgSetRequest)
Dim EmployeeAddRq as IEmployeeAdd
EmployeeAddRq= requestMsgSet.AppendEmployeeAddRq()
'Set field value for IsActive
EmployeeAddRq.IsActive.SetValue(True)
'Set field value for Salutation
EmployeeAddRq.Salutation.SetValue("ab")
'Set field value for FirstName
EmployeeAddRq.FirstName.SetValue("ab")
'Set field value for MiddleName
EmployeeAddRq.MiddleName.SetValue("ab")
'Set field value for LastName
EmployeeAddRq.LastName.SetValue("ab")
'Set field value for JobTitle
EmployeeAddRq.JobTitle.SetValue("ab")
'Set field value for ListID
EmployeeAddRq.SupervisorRef.ListID.SetValue("200000-1011023419")
'Set field value for FullName
EmployeeAddRq.SupervisorRef.FullName.SetValue("ab")
'Set field value for Department
EmployeeAddRq.Department.SetValue("ab")
'Set field value for Description
EmployeeAddRq.Description.SetValue("ab")
'Set field value for TargetBonus
EmployeeAddRq.TargetBonus.SetValue(10.01)
'Set field value for Addr1
EmployeeAddRq.EmployeeAddress.Addr1.SetValue("ab")
'Set field value for Addr2
EmployeeAddRq.EmployeeAddress.Addr2.SetValue("ab")
'Set field value for City
EmployeeAddRq.EmployeeAddress.City.SetValue("ab")
'Set field value for State
EmployeeAddRq.EmployeeAddress.State.SetValue("ab")
'Set field value for PostalCode
EmployeeAddRq.EmployeeAddress.PostalCode.SetValue("ab")
'Set field value for PrintAs
EmployeeAddRq.PrintAs.SetValue("ab")
'Set field value for Phone
EmployeeAddRq.Phone.SetValue("ab")
'Set field value for Mobile
EmployeeAddRq.Mobile.SetValue("ab")
'Set field value for Pager
EmployeeAddRq.Pager.SetValue("ab")
'Set field value for PagerPIN
EmployeeAddRq.PagerPIN.SetValue("ab")
'Set field value for AltPhone
EmployeeAddRq.AltPhone.SetValue("ab")
'Set field value for Fax
EmployeeAddRq.Fax.SetValue("ab")
'Set field value for SSN
EmployeeAddRq.SSN.SetValue("ab")
'Set field value for Email
EmployeeAddRq.Email.SetValue("ab")
Dim AdditionalContactRef8320 as IQBBaseRef
AdditionalContactRef8320=EmployeeAddRq.AdditionalContactRefList.Append()
'Set field value for ContactName
AdditionalContactRef8320.ContactName.SetValue("ab")
'Set field value for ContactValue
AdditionalContactRef8320.ContactValue.SetValue("ab")
'Set field value for ContactName
EmployeeAddRq.EmergencyContacts.PrimaryContact.ContactName.SetValue("ab")
'Set field value for ContactValue
EmployeeAddRq.EmergencyContacts.PrimaryContact.ContactValue.SetValue("ab")
'Set field value for Relation
EmployeeAddRq.EmergencyContacts.PrimaryContact.Relation.SetValue(ENRelation.rSpouse)
'Set field value for ContactName
EmployeeAddRq.EmergencyContacts.SecondaryContact.ContactName.SetValue("ab")
'Set field value for ContactValue
EmployeeAddRq.EmergencyContacts.SecondaryContact.ContactValue.SetValue("ab")
'Set field value for Relation
EmployeeAddRq.EmergencyContacts.SecondaryContact.Relation.SetValue(ENRelation.rSpouse)
'Set field value for EmployeeType
EmployeeAddRq.EmployeeType.SetValue(ENEmployeeType.etOfficer)
'Set field value for PartOrFullTime
EmployeeAddRq.PartOrFullTime.SetValue(ENPartOrFullTime.poftPartTime)
'Set field value for Exempt
EmployeeAddRq.Exempt.SetValue(ENExempt.eExempt)
'Set field value for KeyEmployee
EmployeeAddRq.KeyEmployee.SetValue(ENKeyEmployee.keYes)
'Set field value for Gender
EmployeeAddRq.Gender.SetValue(ENGender.gMale)
'Set field value for HiredDate
EmployeeAddRq.HiredDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for OriginalHireDate
EmployeeAddRq.OriginalHireDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for AdjustedServiceDate
EmployeeAddRq.AdjustedServiceDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for ReleasedDate
EmployeeAddRq.ReleasedDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for BirthDate
EmployeeAddRq.BirthDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for USCitizen
EmployeeAddRq.USCitizen.SetValue(ENUSCitizen.uscYes)
'Set field value for Ethnicity
EmployeeAddRq.Ethnicity.SetValue(ENEthnicity.eAmericianIndian)
'Set field value for Disabled
EmployeeAddRq.Disabled.SetValue(ENDisabled.dYes)
'Set field value for DisabilityDesc
EmployeeAddRq.DisabilityDesc.SetValue("ab")
'Set field value for OnFile
EmployeeAddRq.OnFile.SetValue(ENOnFile.ofYes)
'Set field value for WorkAuthExpireDate
EmployeeAddRq.WorkAuthExpireDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for USVeteran
EmployeeAddRq.USVeteran.SetValue(ENUSVeteran.usvYes)
'Set field value for MilitaryStatus
EmployeeAddRq.MilitaryStatus.SetValue(ENMilitaryStatus.msActive)
'Set field value for AccountNumber
EmployeeAddRq.AccountNumber.SetValue("ab")
'Set field value for Notes
EmployeeAddRq.Notes.SetValue("ab")
Dim AdditionalNotes8321 as IAdditionalNotes
AdditionalNotes8321=EmployeeAddRq.AdditionalNotesList.Append()
'Set field value for Note
AdditionalNotes8321.Note.SetValue("ab")
'Set field value for ListID
EmployeeAddRq.BillingRateRef.ListID.SetValue("200000-1011023419")
'Set field value for FullName
EmployeeAddRq.BillingRateRef.FullName.SetValue("ab")
'Set field value for PayPeriod
EmployeeAddRq.EmployeePayrollInfo.PayPeriod.SetValue(ENPayPeriod.ppDaily)
'Set field value for ListID
EmployeeAddRq.EmployeePayrollInfo.ClassRef.ListID.SetValue("200000-1011023419")
'Set field value for FullName
EmployeeAddRq.EmployeePayrollInfo.ClassRef.FullName.SetValue("ab")
Dim OREarningsElementType8322 as String
OREarningsElementType8322 = "ClearEarnings"
if (OREarningsElementType8322 == "ClearEarnings") then
'Set field value for ClearEarnings
EmployeeAddRq.EmployeePayrollInfo.OREarnings.ClearEarnings.SetValue(True)
End If
if (OREarningsElementType8322 == "EarningsList") then
Dim Earnings8323 as IEarnings
Earnings8323=EmployeeAddRq.EmployeePayrollInfo.OREarnings.EarningsList.Append()
'Set field value for ListID
Earnings8323.PayrollItemWageRef.ListID.SetValue("200000-1011023419")
'Set field value for FullName
Earnings8323.PayrollItemWageRef.FullName.SetValue("ab")
Dim ORRateElementType8324 as String
ORRateElementType8324 = "Rate"
if (ORRateElementType8324 == "Rate") then
'Set field value for Rate
Earnings8323.ORRate.Rate.SetValue(15.65)
End If
if (ORRateElementType8324 == "RatePercent") then
'Set field value for RatePercent
Earnings8323.ORRate.RatePercent.SetValue(20.00)
End If
End If
'Set field value for IsUsingTimeDataToCreatePaychecks
EmployeeAddRq.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.SetValue(True)
'Set field value for UseTimeDataToCreatePaychecks
EmployeeAddRq.EmployeePayrollInfo.UseTimeDataToCreatePaychecks.SetValue(ENUseTimeDataToCreatePaychecks.utdtcpNotSet)
'Set field value for HoursAvailable
EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursAvailable.SetValue("IQBTimeIntervalType")
'Set field value for AccrualPeriod
EmployeeAddRq.EmployeePayrollInfo.SickHours.AccrualPeriod.SetValue(ENAccrualPeriod.apBeginningOfYear)
'Set field value for HoursAccrued
EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursAccrued.SetValue("IQBTimeIntervalType")
'Set field value for MaximumHours
EmployeeAddRq.EmployeePayrollInfo.SickHours.MaximumHours.SetValue("IQBTimeIntervalType")
'Set field value for IsResettingHoursEachNewYear
EmployeeAddRq.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.SetValue(True)
'Set field value for HoursUsed
EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursUsed.SetValue("IQBTimeIntervalType")
'Set field value for AccrualStartDate
EmployeeAddRq.EmployeePayrollInfo.SickHours.AccrualStartDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for HoursAvailable
EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursAvailable.SetValue("IQBTimeIntervalType")
'Set field value for AccrualPeriod
EmployeeAddRq.EmployeePayrollInfo.VacationHours.AccrualPeriod.SetValue(ENAccrualPeriod.apBeginningOfYear)
'Set field value for HoursAccrued
EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursAccrued.SetValue("IQBTimeIntervalType")
'Set field value for MaximumHours
EmployeeAddRq.EmployeePayrollInfo.VacationHours.MaximumHours.SetValue("IQBTimeIntervalType")
'Set field value for IsResettingHoursEachNewYear
EmployeeAddRq.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.SetValue(True)
'Set field value for HoursUsed
EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursUsed.SetValue("IQBTimeIntervalType")
'Set field value for AccrualStartDate
EmployeeAddRq.EmployeePayrollInfo.VacationHours.AccrualStartDate.SetValue(DateTime.Parse("12/15/2007"))
'Set field value for ExternalGUID
EmployeeAddRq.ExternalGUID.SetValue(System.Guid.NewGuid().ToString())
'Set field value for IncludeRetElementList
'May create more than one of these if needed
EmployeeAddRq.IncludeRetElementList.Add("ab")
End Sub
Public Sub WalkEmployeeAddRs( 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.rtEmployeeAddRs) then
'upcast to more specific type here, this is safe because we checked with response.Type check above
Dim EmployeeRet as IEmployeeRet
EmployeeRet = CType(response.Detail,IEmployeeRet)
WalkEmployeeRet(EmployeeRet)
End If
End If
End If
Next j
End Sub
Public Sub WalkEmployeeRet(EmployeeRet as IEmployeeRet)
if (EmployeeRet is nothing) then
Exit Sub
End If
'Go through all the elements of IEmployeeRet
'Get value of ListID
Dim ListID8325 as String
ListID8325 = EmployeeRet.ListID.GetValue()
'Get value of TimeCreated
Dim TimeCreated8326 as DateTime
TimeCreated8326 = EmployeeRet.TimeCreated.GetValue()
'Get value of TimeModified
Dim TimeModified8327 as DateTime
TimeModified8327 = EmployeeRet.TimeModified.GetValue()
'Get value of EditSequence
Dim EditSequence8328 as String
EditSequence8328 = EmployeeRet.EditSequence.GetValue()
'Get value of Name
Dim Name8329 as String
Name8329 = EmployeeRet.Name.GetValue()
'Get value of IsActive
if ( not EmployeeRet.IsActive is nothing) then
Dim IsActive8330 as Boolean
IsActive8330 = EmployeeRet.IsActive.GetValue()
End If
'Get value of Salutation
if ( not EmployeeRet.Salutation is nothing) then
Dim Salutation8331 as String
Salutation8331 = EmployeeRet.Salutation.GetValue()
End If
'Get value of FirstName
if ( not EmployeeRet.FirstName is nothing) then
Dim FirstName8332 as String
FirstName8332 = EmployeeRet.FirstName.GetValue()
End If
'Get value of MiddleName
if ( not EmployeeRet.MiddleName is nothing) then
Dim MiddleName8333 as String
MiddleName8333 = EmployeeRet.MiddleName.GetValue()
End If
'Get value of LastName
if ( not EmployeeRet.LastName is nothing) then
Dim LastName8334 as String
LastName8334 = EmployeeRet.LastName.GetValue()
End If
'Get value of JobTitle
if ( not EmployeeRet.JobTitle is nothing) then
Dim JobTitle8335 as String
JobTitle8335 = 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 ListID8336 as String
ListID8336 = EmployeeRet.SupervisorRef.ListID.GetValue()
End If
'Get value of FullName
if ( not EmployeeRet.SupervisorRef.FullName is nothing) then
Dim FullName8337 as String
FullName8337 = EmployeeRet.SupervisorRef.FullName.GetValue()
End If
End If
'Get value of Department
if ( not EmployeeRet.Department is nothing) then
Dim Department8338 as String
Department8338 = EmployeeRet.Department.GetValue()
End If
'Get value of Description
if ( not EmployeeRet.Description is nothing) then
Dim Description8339 as String
Description8339 = EmployeeRet.Description.GetValue()
End If
'Get value of TargetBonus
if ( not EmployeeRet.TargetBonus is nothing) then
Dim TargetBonus8340 as Double
TargetBonus8340 = 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 Addr18341 as String
Addr18341 = EmployeeRet.EmployeeAddress.Addr1.GetValue()
End If
'Get value of Addr2
if ( not EmployeeRet.EmployeeAddress.Addr2 is nothing) then
Dim Addr28342 as String
Addr28342 = EmployeeRet.EmployeeAddress.Addr2.GetValue()
End If
'Get value of City
if ( not EmployeeRet.EmployeeAddress.City is nothing) then
Dim City8343 as String
City8343 = EmployeeRet.EmployeeAddress.City.GetValue()
End If
'Get value of State
if ( not EmployeeRet.EmployeeAddress.State is nothing) then
Dim State8344 as String
State8344 = EmployeeRet.EmployeeAddress.State.GetValue()
End If
'Get value of PostalCode
if ( not EmployeeRet.EmployeeAddress.PostalCode is nothing) then
Dim PostalCode8345 as String
PostalCode8345 = EmployeeRet.EmployeeAddress.PostalCode.GetValue()
End If
End If
'Get value of PrintAs
if ( not EmployeeRet.PrintAs is nothing) then
Dim PrintAs8346 as String
PrintAs8346 = EmployeeRet.PrintAs.GetValue()
End If
'Get value of Phone
if ( not EmployeeRet.Phone is nothing) then
Dim Phone8347 as String
Phone8347 = EmployeeRet.Phone.GetValue()
End If
'Get value of Mobile
if ( not EmployeeRet.Mobile is nothing) then
Dim Mobile8348 as String
Mobile8348 = EmployeeRet.Mobile.GetValue()
End If
'Get value of Pager
if ( not EmployeeRet.Pager is nothing) then
Dim Pager8349 as String
Pager8349 = EmployeeRet.Pager.GetValue()
End If
'Get value of PagerPIN
if ( not EmployeeRet.PagerPIN is nothing) then
Dim PagerPIN8350 as String
PagerPIN8350 = EmployeeRet.PagerPIN.GetValue()
End If
'Get value of AltPhone
if ( not EmployeeRet.AltPhone is nothing) then
Dim AltPhone8351 as String
AltPhone8351 = EmployeeRet.AltPhone.GetValue()
End If
'Get value of Fax
if ( not EmployeeRet.Fax is nothing) then
Dim Fax8352 as String
Fax8352 = EmployeeRet.Fax.GetValue()
End If
'Get value of SSN
if ( not EmployeeRet.SSN is nothing) then
Dim SSN8353 as String
SSN8353 = EmployeeRet.SSN.GetValue()
End If
'Get value of Email
if ( not EmployeeRet.Email is nothing) then
Dim Email8354 as String
Email8354 = EmployeeRet.Email.GetValue()
End If
if (not EmployeeRet.AdditionalContactRefList is nothing)
Dim i8355 as Integer
for i8355 = 0 to EmployeeRet.AdditionalContactRefList.Count - 1
Dim QBBaseRef as IQBBaseRef
QBBaseRef = EmployeeRet.AdditionalContactRefList.GetAt(i8355)
'Get value of ContactName
Dim ContactName8356 as String
ContactName8356 = QBBaseRefContactName.GetValue()
'Get value of ContactValue
Dim ContactValue8357 as String
ContactValue8357 = QBBaseRefContactValue.GetValue()
Next i8355
End If
if (not EmployeeRet.EmergencyContacts. is nothing) then
if (not EmployeeRet.EmergencyContacts.PrimaryContact. is nothing) then
'Get value of ContactName
Dim ContactName8358 as String
ContactName8358 = EmployeeRet.EmergencyContacts.PrimaryContact.ContactName.GetValue()
'Get value of ContactValue
Dim ContactValue8359 as String
ContactValue8359 = EmployeeRet.EmergencyContacts.PrimaryContact.ContactValue.GetValue()
'Get value of Relation
if ( not EmployeeRet.EmergencyContacts.PrimaryContact.Relation is nothing) then
Dim Relation8360 as ENRelation
Relation8360 = EmployeeRet.EmergencyContacts.PrimaryContact.Relation.GetValue()
End If
End If
if (not EmployeeRet.EmergencyContacts.SecondaryContact. is nothing) then
'Get value of ContactName
Dim ContactName8361 as String
ContactName8361 = EmployeeRet.EmergencyContacts.SecondaryContact.ContactName.GetValue()
'Get value of ContactValue
Dim ContactValue8362 as String
ContactValue8362 = EmployeeRet.EmergencyContacts.SecondaryContact.ContactValue.GetValue()
'Get value of Relation
if ( not EmployeeRet.EmergencyContacts.SecondaryContact.Relation is nothing) then
Dim Relation8363 as ENRelation
Relation8363 = EmployeeRet.EmergencyContacts.SecondaryContact.Relation.GetValue()
End If
End If
End If
'Get value of EmployeeType
if ( not EmployeeRet.EmployeeType is nothing) then
Dim EmployeeType8364 as ENEmployeeType
EmployeeType8364 = EmployeeRet.EmployeeType.GetValue()
End If
'Get value of PartOrFullTime
if ( not EmployeeRet.PartOrFullTime is nothing) then
Dim PartOrFullTime8365 as ENPartOrFullTime
PartOrFullTime8365 = EmployeeRet.PartOrFullTime.GetValue()
End If
'Get value of Exempt
if ( not EmployeeRet.Exempt is nothing) then
Dim Exempt8366 as ENExempt
Exempt8366 = EmployeeRet.Exempt.GetValue()
End If
'Get value of KeyEmployee
if ( not EmployeeRet.KeyEmployee is nothing) then
Dim KeyEmployee8367 as ENKeyEmployee
KeyEmployee8367 = EmployeeRet.KeyEmployee.GetValue()
End If
'Get value of Gender
if ( not EmployeeRet.Gender is nothing) then
Dim Gender8368 as ENGender
Gender8368 = EmployeeRet.Gender.GetValue()
End If
'Get value of HiredDate
if ( not EmployeeRet.HiredDate is nothing) then
Dim HiredDate8369 as DateTime
HiredDate8369 = EmployeeRet.HiredDate.GetValue()
End If
'Get value of OriginalHireDate
if ( not EmployeeRet.OriginalHireDate is nothing) then
Dim OriginalHireDate8370 as DateTime
OriginalHireDate8370 = EmployeeRet.OriginalHireDate.GetValue()
End If
'Get value of AdjustedServiceDate
if ( not EmployeeRet.AdjustedServiceDate is nothing) then
Dim AdjustedServiceDate8371 as DateTime
AdjustedServiceDate8371 = EmployeeRet.AdjustedServiceDate.GetValue()
End If
'Get value of ReleasedDate
if ( not EmployeeRet.ReleasedDate is nothing) then
Dim ReleasedDate8372 as DateTime
ReleasedDate8372 = EmployeeRet.ReleasedDate.GetValue()
End If
'Get value of BirthDate
if ( not EmployeeRet.BirthDate is nothing) then
Dim BirthDate8373 as DateTime
BirthDate8373 = EmployeeRet.BirthDate.GetValue()
End If
'Get value of USCitizen
if ( not EmployeeRet.USCitizen is nothing) then
Dim USCitizen8374 as ENUSCitizen
USCitizen8374 = EmployeeRet.USCitizen.GetValue()
End If
'Get value of Ethnicity
if ( not EmployeeRet.Ethnicity is nothing) then
Dim Ethnicity8375 as ENEthnicity
Ethnicity8375 = EmployeeRet.Ethnicity.GetValue()
End If
'Get value of Disabled
if ( not EmployeeRet.Disabled is nothing) then
Dim Disabled8376 as ENDisabled
Disabled8376 = EmployeeRet.Disabled.GetValue()
End If
'Get value of DisabilityDesc
if ( not EmployeeRet.DisabilityDesc is nothing) then
Dim DisabilityDesc8377 as String
DisabilityDesc8377 = EmployeeRet.DisabilityDesc.GetValue()
End If
'Get value of OnFile
if ( not EmployeeRet.OnFile is nothing) then
Dim OnFile8378 as ENOnFile
OnFile8378 = EmployeeRet.OnFile.GetValue()
End If
'Get value of WorkAuthExpireDate
if ( not EmployeeRet.WorkAuthExpireDate is nothing) then
Dim WorkAuthExpireDate8379 as DateTime
WorkAuthExpireDate8379 = EmployeeRet.WorkAuthExpireDate.GetValue()
End If
'Get value of USVeteran
if ( not EmployeeRet.USVeteran is nothing) then
Dim USVeteran8380 as ENUSVeteran
USVeteran8380 = EmployeeRet.USVeteran.GetValue()
End If
'Get value of MilitaryStatus
if ( not EmployeeRet.MilitaryStatus is nothing) then
Dim MilitaryStatus8381 as ENMilitaryStatus
MilitaryStatus8381 = EmployeeRet.MilitaryStatus.GetValue()
End If
'Get value of AccountNumber
if ( not EmployeeRet.AccountNumber is nothing) then
Dim AccountNumber8382 as String
AccountNumber8382 = EmployeeRet.AccountNumber.GetValue()
End If
'Get value of Notes
if ( not EmployeeRet.Notes is nothing) then
Dim Notes8383 as String
Notes8383 = EmployeeRet.Notes.GetValue()
End If
if (not EmployeeRet.AdditionalNotesRetList is nothing)
Dim i8384 as Integer
for i8384 = 0 to EmployeeRet.AdditionalNotesRetList.Count - 1
Dim AdditionalNotesRet as IAdditionalNotesRet
AdditionalNotesRet = EmployeeRet.AdditionalNotesRetList.GetAt(i8384)
'Get value of NoteID
Dim NoteID8385 as Integer
NoteID8385 = AdditionalNotesRetNoteID.GetValue()
'Get value of Date
Dim Date8386 as DateTime
Date8386 = AdditionalNotesRetDate.GetValue()
'Get value of Note
Dim Note8387 as String
Note8387 = AdditionalNotesRetNote.GetValue()
Next i8384
End If
if (not EmployeeRet.BillingRateRef. is nothing) then
'Get value of ListID
if ( not EmployeeRet.BillingRateRef.ListID is nothing) then
Dim ListID8388 as String
ListID8388 = EmployeeRet.BillingRateRef.ListID.GetValue()
End If
'Get value of FullName
if ( not EmployeeRet.BillingRateRef.FullName is nothing) then
Dim FullName8389 as String
FullName8389 = 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 PayPeriod8390 as ENPayPeriod
PayPeriod8390 = 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 ListID8391 as String
ListID8391 = EmployeeRet.EmployeePayrollInfo.ClassRef.ListID.GetValue()
End If
'Get value of FullName
if ( not EmployeeRet.EmployeePayrollInfo.ClassRef.FullName is nothing) then
Dim FullName8392 as String
FullName8392 = 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 ClearEarnings8394 as Boolean
ClearEarnings8394 = 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 i8395 as Integer
for i8395 = 0 to EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.Count - 1
Dim Earnings as IEarnings
Earnings = EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.GetAt(i8395)
'Get value of ListID
if ( not EarningsPayrollItemWageRef.ListID is nothing) then
Dim ListID8396 as String
ListID8396 = EarningsPayrollItemWageRef.ListID.GetValue()
End If
'Get value of FullName
if ( not EarningsPayrollItemWageRef.FullName is nothing) then
Dim FullName8397 as String
FullName8397 = 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 Rate8399 as Double
Rate8399 = 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 RatePercent8400 as Double
RatePercent8400 = EarningsORRate.RatePercent.GetValue()
End If
End If
End If
Next i8395
End If
End If
End If
'Get value of IsUsingTimeDataToCreatePaychecks
if ( not EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks is nothing) then
Dim IsUsingTimeDataToCreatePaychecks8401 as Boolean
IsUsingTimeDataToCreatePaychecks8401 = EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.GetValue()
End If
'Get value of UseTimeDataToCreatePaychecks
if ( not EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks is nothing) then
Dim UseTimeDataToCreatePaychecks8402 as ENUseTimeDataToCreatePaychecks
UseTimeDataToCreatePaychecks8402 = 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 HoursAvailable8403 as IQBTimeIntervalType
HoursAvailable8403 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable.GetValue()
End If
'Get value of AccrualPeriod
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod is nothing) then
Dim AccrualPeriod8404 as ENAccrualPeriod
AccrualPeriod8404 = EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod.GetValue()
End If
'Get value of HoursAccrued
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued is nothing) then
Dim HoursAccrued8405 as IQBTimeIntervalType
HoursAccrued8405 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued.GetValue()
End If
'Get value of MaximumHours
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours is nothing) then
Dim MaximumHours8406 as IQBTimeIntervalType
MaximumHours8406 = EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours.GetValue()
End If
'Get value of IsResettingHoursEachNewYear
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear is nothing) then
Dim IsResettingHoursEachNewYear8407 as Boolean
IsResettingHoursEachNewYear8407 = EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.GetValue()
End If
'Get value of HoursUsed
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed is nothing) then
Dim HoursUsed8408 as IQBTimeIntervalType
HoursUsed8408 = EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed.GetValue()
End If
'Get value of AccrualStartDate
if ( not EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate is nothing) then
Dim AccrualStartDate8409 as DateTime
AccrualStartDate8409 = 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 HoursAvailable8410 as IQBTimeIntervalType
HoursAvailable8410 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable.GetValue()
End If
'Get value of AccrualPeriod
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod is nothing) then
Dim AccrualPeriod8411 as ENAccrualPeriod
AccrualPeriod8411 = EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod.GetValue()
End If
'Get value of HoursAccrued
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued is nothing) then
Dim HoursAccrued8412 as IQBTimeIntervalType
HoursAccrued8412 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued.GetValue()
End If
'Get value of MaximumHours
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours is nothing) then
Dim MaximumHours8413 as IQBTimeIntervalType
MaximumHours8413 = EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours.GetValue()
End If
'Get value of IsResettingHoursEachNewYear
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear is nothing) then
Dim IsResettingHoursEachNewYear8414 as Boolean
IsResettingHoursEachNewYear8414 = EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.GetValue()
End If
'Get value of HoursUsed
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed is nothing) then
Dim HoursUsed8415 as IQBTimeIntervalType
HoursUsed8415 = EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed.GetValue()
End If
'Get value of AccrualStartDate
if ( not EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate is nothing) then
Dim AccrualStartDate8416 as DateTime
AccrualStartDate8416 = EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate.GetValue()
End If
End If
End If
'Get value of ExternalGUID
if ( not EmployeeRet.ExternalGUID is nothing) then
Dim ExternalGUID8417 as String
ExternalGUID8417 = EmployeeRet.ExternalGUID.GetValue()
End If
if (not EmployeeRet.DataExtRetList is nothing)
Dim i8418 as Integer
for i8418 = 0 to EmployeeRet.DataExtRetList.Count - 1
Dim DataExtRet as IDataExtRet
DataExtRet = EmployeeRet.DataExtRetList.GetAt(i8418)
'Get value of OwnerID
if ( not DataExtRetOwnerID is nothing) then
Dim OwnerID8419 as String
OwnerID8419 = DataExtRetOwnerID.GetValue()
End If
'Get value of DataExtName
Dim DataExtName8420 as String
DataExtName8420 = DataExtRetDataExtName.GetValue()
'Get value of DataExtType
Dim DataExtType8421 as ENDataExtType
DataExtType8421 = DataExtRetDataExtType.GetValue()
'Get value of DataExtValue
Dim DataExtValue8422 as String
DataExtValue8422 = DataExtRetDataExtValue.GetValue()
Next i8418
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 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | //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 DoEmployeeAdd() { 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; BuildEmployeeAddRq(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; WalkEmployeeAddRs(responseMsgSet); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); if (sessionBegun) { sessionManager.EndSession(); } if (connectionOpen) { sessionManager.CloseConnection(); } } } void BuildEmployeeAddRq(IMsgSetRequest requestMsgSet) { IEmployeeAdd EmployeeAddRq= requestMsgSet.AppendEmployeeAddRq(); //Set field value for IsActive EmployeeAddRq.IsActive.SetValue(true); //Set field value for Salutation EmployeeAddRq.Salutation.SetValue("ab"); //Set field value for FirstName EmployeeAddRq.FirstName.SetValue("ab"); //Set field value for MiddleName EmployeeAddRq.MiddleName.SetValue("ab"); //Set field value for LastName EmployeeAddRq.LastName.SetValue("ab"); //Set field value for JobTitle EmployeeAddRq.JobTitle.SetValue("ab"); //Set field value for ListID EmployeeAddRq.SupervisorRef.ListID.SetValue("200000-1011023419"); //Set field value for FullName EmployeeAddRq.SupervisorRef.FullName.SetValue("ab"); //Set field value for Department EmployeeAddRq.Department.SetValue("ab"); //Set field value for Description EmployeeAddRq.Description.SetValue("ab"); //Set field value for TargetBonus EmployeeAddRq.TargetBonus.SetValue(10.01); //Set field value for Addr1 EmployeeAddRq.EmployeeAddress.Addr1.SetValue("ab"); //Set field value for Addr2 EmployeeAddRq.EmployeeAddress.Addr2.SetValue("ab"); //Set field value for City EmployeeAddRq.EmployeeAddress.City.SetValue("ab"); //Set field value for State EmployeeAddRq.EmployeeAddress.State.SetValue("ab"); //Set field value for PostalCode EmployeeAddRq.EmployeeAddress.PostalCode.SetValue("ab"); //Set field value for PrintAs EmployeeAddRq.PrintAs.SetValue("ab"); //Set field value for Phone EmployeeAddRq.Phone.SetValue("ab"); //Set field value for Mobile EmployeeAddRq.Mobile.SetValue("ab"); //Set field value for Pager EmployeeAddRq.Pager.SetValue("ab"); //Set field value for PagerPIN EmployeeAddRq.PagerPIN.SetValue("ab"); //Set field value for AltPhone EmployeeAddRq.AltPhone.SetValue("ab"); //Set field value for Fax EmployeeAddRq.Fax.SetValue("ab"); //Set field value for SSN EmployeeAddRq.SSN.SetValue("ab"); //Set field value for Email EmployeeAddRq.Email.SetValue("ab"); IQBBaseRef AdditionalContactRef8217=EmployeeAddRq.AdditionalContactRefList.Append(); //Set field value for ContactName AdditionalContactRef8217.ContactName.SetValue("ab"); //Set field value for ContactValue AdditionalContactRef8217.ContactValue.SetValue("ab"); //Set field value for ContactName EmployeeAddRq.EmergencyContacts.PrimaryContact.ContactName.SetValue("ab"); //Set field value for ContactValue EmployeeAddRq.EmergencyContacts.PrimaryContact.ContactValue.SetValue("ab"); //Set field value for Relation EmployeeAddRq.EmergencyContacts.PrimaryContact.Relation.SetValue(ENRelation.rSpouse); //Set field value for ContactName EmployeeAddRq.EmergencyContacts.SecondaryContact.ContactName.SetValue("ab"); //Set field value for ContactValue EmployeeAddRq.EmergencyContacts.SecondaryContact.ContactValue.SetValue("ab"); //Set field value for Relation EmployeeAddRq.EmergencyContacts.SecondaryContact.Relation.SetValue(ENRelation.rSpouse); //Set field value for EmployeeType EmployeeAddRq.EmployeeType.SetValue(ENEmployeeType.etOfficer); //Set field value for PartOrFullTime EmployeeAddRq.PartOrFullTime.SetValue(ENPartOrFullTime.poftPartTime); //Set field value for Exempt EmployeeAddRq.Exempt.SetValue(ENExempt.eExempt); //Set field value for KeyEmployee EmployeeAddRq.KeyEmployee.SetValue(ENKeyEmployee.keYes); //Set field value for Gender EmployeeAddRq.Gender.SetValue(ENGender.gMale); //Set field value for HiredDate EmployeeAddRq.HiredDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for OriginalHireDate EmployeeAddRq.OriginalHireDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for AdjustedServiceDate EmployeeAddRq.AdjustedServiceDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for ReleasedDate EmployeeAddRq.ReleasedDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for BirthDate EmployeeAddRq.BirthDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for USCitizen EmployeeAddRq.USCitizen.SetValue(ENUSCitizen.uscYes); //Set field value for Ethnicity EmployeeAddRq.Ethnicity.SetValue(ENEthnicity.eAmericianIndian); //Set field value for Disabled EmployeeAddRq.Disabled.SetValue(ENDisabled.dYes); //Set field value for DisabilityDesc EmployeeAddRq.DisabilityDesc.SetValue("ab"); //Set field value for OnFile EmployeeAddRq.OnFile.SetValue(ENOnFile.ofYes); //Set field value for WorkAuthExpireDate EmployeeAddRq.WorkAuthExpireDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for USVeteran EmployeeAddRq.USVeteran.SetValue(ENUSVeteran.usvYes); //Set field value for MilitaryStatus EmployeeAddRq.MilitaryStatus.SetValue(ENMilitaryStatus.msActive); //Set field value for AccountNumber EmployeeAddRq.AccountNumber.SetValue("ab"); //Set field value for Notes EmployeeAddRq.Notes.SetValue("ab"); IAdditionalNotes AdditionalNotes8218=EmployeeAddRq.AdditionalNotesList.Append(); //Set field value for Note AdditionalNotes8218.Note.SetValue("ab"); //Set field value for ListID EmployeeAddRq.BillingRateRef.ListID.SetValue("200000-1011023419"); //Set field value for FullName EmployeeAddRq.BillingRateRef.FullName.SetValue("ab"); //Set field value for PayPeriod EmployeeAddRq.EmployeePayrollInfo.PayPeriod.SetValue(ENPayPeriod.ppDaily); //Set field value for ListID EmployeeAddRq.EmployeePayrollInfo.ClassRef.ListID.SetValue("200000-1011023419"); //Set field value for FullName EmployeeAddRq.EmployeePayrollInfo.ClassRef.FullName.SetValue("ab"); string OREarningsElementType8219 = "ClearEarnings"; if (OREarningsElementType8219 == "ClearEarnings") { //Set field value for ClearEarnings EmployeeAddRq.EmployeePayrollInfo.OREarnings.ClearEarnings.SetValue(true); } if (OREarningsElementType8219 == "EarningsList") { IEarnings Earnings8220=EmployeeAddRq.EmployeePayrollInfo.OREarnings.EarningsList.Append(); //Set field value for ListID Earnings8220.PayrollItemWageRef.ListID.SetValue("200000-1011023419"); //Set field value for FullName Earnings8220.PayrollItemWageRef.FullName.SetValue("ab"); string ORRateElementType8221 = "Rate"; if (ORRateElementType8221 == "Rate") { //Set field value for Rate Earnings8220.ORRate.Rate.SetValue(15.65); } if (ORRateElementType8221 == "RatePercent") { //Set field value for RatePercent Earnings8220.ORRate.RatePercent.SetValue(20.00); } } //Set field value for IsUsingTimeDataToCreatePaychecks EmployeeAddRq.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.SetValue(true); //Set field value for UseTimeDataToCreatePaychecks EmployeeAddRq.EmployeePayrollInfo.UseTimeDataToCreatePaychecks.SetValue(ENUseTimeDataToCreatePaychecks.utdtcpNotSet); //Set field value for HoursAvailable EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursAvailable.SetValue("IQBTimeIntervalType"); //Set field value for AccrualPeriod EmployeeAddRq.EmployeePayrollInfo.SickHours.AccrualPeriod.SetValue(ENAccrualPeriod.apBeginningOfYear); //Set field value for HoursAccrued EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursAccrued.SetValue("IQBTimeIntervalType"); //Set field value for MaximumHours EmployeeAddRq.EmployeePayrollInfo.SickHours.MaximumHours.SetValue("IQBTimeIntervalType"); //Set field value for IsResettingHoursEachNewYear EmployeeAddRq.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.SetValue(true); //Set field value for HoursUsed EmployeeAddRq.EmployeePayrollInfo.SickHours.HoursUsed.SetValue("IQBTimeIntervalType"); //Set field value for AccrualStartDate EmployeeAddRq.EmployeePayrollInfo.SickHours.AccrualStartDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for HoursAvailable EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursAvailable.SetValue("IQBTimeIntervalType"); //Set field value for AccrualPeriod EmployeeAddRq.EmployeePayrollInfo.VacationHours.AccrualPeriod.SetValue(ENAccrualPeriod.apBeginningOfYear); //Set field value for HoursAccrued EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursAccrued.SetValue("IQBTimeIntervalType"); //Set field value for MaximumHours EmployeeAddRq.EmployeePayrollInfo.VacationHours.MaximumHours.SetValue("IQBTimeIntervalType"); //Set field value for IsResettingHoursEachNewYear EmployeeAddRq.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.SetValue(true); //Set field value for HoursUsed EmployeeAddRq.EmployeePayrollInfo.VacationHours.HoursUsed.SetValue("IQBTimeIntervalType"); //Set field value for AccrualStartDate EmployeeAddRq.EmployeePayrollInfo.VacationHours.AccrualStartDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for ExternalGUID EmployeeAddRq.ExternalGUID.SetValue(Guid.NewGuid().ToString()); //Set field value for IncludeRetElementList //May create more than one of these if needed EmployeeAddRq.IncludeRetElementList.Add("ab"); } void WalkEmployeeAddRs(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.rtEmployeeAddRs) { //upcast to more specific type here, this is safe because we checked with response.Type check above IEmployeeRet EmployeeRet = (IEmployeeRet)response.Detail; WalkEmployeeRet(EmployeeRet); } } } } } void WalkEmployeeRet(IEmployeeRet EmployeeRet) { if (EmployeeRet == null) return; //Go through all the elements of IEmployeeRet //Get value of ListID string ListID8222 = (string)EmployeeRet.ListID.GetValue(); //Get value of TimeCreated DateTime TimeCreated8223 = (DateTime)EmployeeRet.TimeCreated.GetValue(); //Get value of TimeModified DateTime TimeModified8224 = (DateTime)EmployeeRet.TimeModified.GetValue(); //Get value of EditSequence string EditSequence8225 = (string)EmployeeRet.EditSequence.GetValue(); //Get value of Name string Name8226 = (string)EmployeeRet.Name.GetValue(); //Get value of IsActive if (EmployeeRet.IsActive != null) { bool IsActive8227 = (bool)EmployeeRet.IsActive.GetValue(); } //Get value of Salutation if (EmployeeRet.Salutation != null) { string Salutation8228 = (string)EmployeeRet.Salutation.GetValue(); } //Get value of FirstName if (EmployeeRet.FirstName != null) { string FirstName8229 = (string)EmployeeRet.FirstName.GetValue(); } //Get value of MiddleName if (EmployeeRet.MiddleName != null) { string MiddleName8230 = (string)EmployeeRet.MiddleName.GetValue(); } //Get value of LastName if (EmployeeRet.LastName != null) { string LastName8231 = (string)EmployeeRet.LastName.GetValue(); } //Get value of JobTitle if (EmployeeRet.JobTitle != null) { string JobTitle8232 = (string)EmployeeRet.JobTitle.GetValue(); } if (EmployeeRet.SupervisorRef != null) { //Get value of ListID if (EmployeeRet.SupervisorRef.ListID != null) { string ListID8233 = (string)EmployeeRet.SupervisorRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.SupervisorRef.FullName != null) { string FullName8234 = (string)EmployeeRet.SupervisorRef.FullName.GetValue(); } } //Get value of Department if (EmployeeRet.Department != null) { string Department8235 = (string)EmployeeRet.Department.GetValue(); } //Get value of Description if (EmployeeRet.Description != null) { string Description8236 = (string)EmployeeRet.Description.GetValue(); } //Get value of TargetBonus if (EmployeeRet.TargetBonus != null) { double TargetBonus8237 = (double)EmployeeRet.TargetBonus.GetValue(); } if (EmployeeRet.EmployeeAddress != null) { //Get value of Addr1 if (EmployeeRet.EmployeeAddress.Addr1 != null) { string Addr18238 = (string)EmployeeRet.EmployeeAddress.Addr1.GetValue(); } //Get value of Addr2 if (EmployeeRet.EmployeeAddress.Addr2 != null) { string Addr28239 = (string)EmployeeRet.EmployeeAddress.Addr2.GetValue(); } //Get value of City if (EmployeeRet.EmployeeAddress.City != null) { string City8240 = (string)EmployeeRet.EmployeeAddress.City.GetValue(); } //Get value of State if (EmployeeRet.EmployeeAddress.State != null) { string State8241 = (string)EmployeeRet.EmployeeAddress.State.GetValue(); } //Get value of PostalCode if (EmployeeRet.EmployeeAddress.PostalCode != null) { string PostalCode8242 = (string)EmployeeRet.EmployeeAddress.PostalCode.GetValue(); } } //Get value of PrintAs if (EmployeeRet.PrintAs != null) { string PrintAs8243 = (string)EmployeeRet.PrintAs.GetValue(); } //Get value of Phone if (EmployeeRet.Phone != null) { string Phone8244 = (string)EmployeeRet.Phone.GetValue(); } //Get value of Mobile if (EmployeeRet.Mobile != null) { string Mobile8245 = (string)EmployeeRet.Mobile.GetValue(); } //Get value of Pager if (EmployeeRet.Pager != null) { string Pager8246 = (string)EmployeeRet.Pager.GetValue(); } //Get value of PagerPIN if (EmployeeRet.PagerPIN != null) { string PagerPIN8247 = (string)EmployeeRet.PagerPIN.GetValue(); } //Get value of AltPhone if (EmployeeRet.AltPhone != null) { string AltPhone8248 = (string)EmployeeRet.AltPhone.GetValue(); } //Get value of Fax if (EmployeeRet.Fax != null) { string Fax8249 = (string)EmployeeRet.Fax.GetValue(); } //Get value of SSN if (EmployeeRet.SSN != null) { string SSN8250 = (string)EmployeeRet.SSN.GetValue(); } //Get value of Email if (EmployeeRet.Email != null) { string Email8251 = (string)EmployeeRet.Email.GetValue(); } if (EmployeeRet.AdditionalContactRefList != null) { for (int i8252 = 0; i8252 < EmployeeRet.AdditionalContactRefList.Count; i8252++) { IQBBaseRef QBBaseRef = EmployeeRet.AdditionalContactRefList.GetAt(i8252); //Get value of ContactName string ContactName8253 = (string)QBBaseRef.ContactName.GetValue(); //Get value of ContactValue string ContactValue8254 = (string)QBBaseRef.ContactValue.GetValue(); } } if (EmployeeRet.EmergencyContacts != null) { if (EmployeeRet.EmergencyContacts.PrimaryContact != null) { //Get value of ContactName string ContactName8255 = (string)EmployeeRet.EmergencyContacts.PrimaryContact.ContactName.GetValue(); //Get value of ContactValue string ContactValue8256 = (string)EmployeeRet.EmergencyContacts.PrimaryContact.ContactValue.GetValue(); //Get value of Relation if (EmployeeRet.EmergencyContacts.PrimaryContact.Relation != null) { ENRelation Relation8257 = (ENRelation)EmployeeRet.EmergencyContacts.PrimaryContact.Relation.GetValue(); } } if (EmployeeRet.EmergencyContacts.SecondaryContact != null) { //Get value of ContactName string ContactName8258 = (string)EmployeeRet.EmergencyContacts.SecondaryContact.ContactName.GetValue(); //Get value of ContactValue string ContactValue8259 = (string)EmployeeRet.EmergencyContacts.SecondaryContact.ContactValue.GetValue(); //Get value of Relation if (EmployeeRet.EmergencyContacts.SecondaryContact.Relation != null) { ENRelation Relation8260 = (ENRelation)EmployeeRet.EmergencyContacts.SecondaryContact.Relation.GetValue(); } } } //Get value of EmployeeType if (EmployeeRet.EmployeeType != null) { ENEmployeeType EmployeeType8261 = (ENEmployeeType)EmployeeRet.EmployeeType.GetValue(); } //Get value of PartOrFullTime if (EmployeeRet.PartOrFullTime != null) { ENPartOrFullTime PartOrFullTime8262 = (ENPartOrFullTime)EmployeeRet.PartOrFullTime.GetValue(); } //Get value of Exempt if (EmployeeRet.Exempt != null) { ENExempt Exempt8263 = (ENExempt)EmployeeRet.Exempt.GetValue(); } //Get value of KeyEmployee if (EmployeeRet.KeyEmployee != null) { ENKeyEmployee KeyEmployee8264 = (ENKeyEmployee)EmployeeRet.KeyEmployee.GetValue(); } //Get value of Gender if (EmployeeRet.Gender != null) { ENGender Gender8265 = (ENGender)EmployeeRet.Gender.GetValue(); } //Get value of HiredDate if (EmployeeRet.HiredDate != null) { DateTime HiredDate8266 = (DateTime)EmployeeRet.HiredDate.GetValue(); } //Get value of OriginalHireDate if (EmployeeRet.OriginalHireDate != null) { DateTime OriginalHireDate8267 = (DateTime)EmployeeRet.OriginalHireDate.GetValue(); } //Get value of AdjustedServiceDate if (EmployeeRet.AdjustedServiceDate != null) { DateTime AdjustedServiceDate8268 = (DateTime)EmployeeRet.AdjustedServiceDate.GetValue(); } //Get value of ReleasedDate if (EmployeeRet.ReleasedDate != null) { DateTime ReleasedDate8269 = (DateTime)EmployeeRet.ReleasedDate.GetValue(); } //Get value of BirthDate if (EmployeeRet.BirthDate != null) { DateTime BirthDate8270 = (DateTime)EmployeeRet.BirthDate.GetValue(); } //Get value of USCitizen if (EmployeeRet.USCitizen != null) { ENUSCitizen USCitizen8271 = (ENUSCitizen)EmployeeRet.USCitizen.GetValue(); } //Get value of Ethnicity if (EmployeeRet.Ethnicity != null) { ENEthnicity Ethnicity8272 = (ENEthnicity)EmployeeRet.Ethnicity.GetValue(); } //Get value of Disabled if (EmployeeRet.Disabled != null) { ENDisabled Disabled8273 = (ENDisabled)EmployeeRet.Disabled.GetValue(); } //Get value of DisabilityDesc if (EmployeeRet.DisabilityDesc != null) { string DisabilityDesc8274 = (string)EmployeeRet.DisabilityDesc.GetValue(); } //Get value of OnFile if (EmployeeRet.OnFile != null) { ENOnFile OnFile8275 = (ENOnFile)EmployeeRet.OnFile.GetValue(); } //Get value of WorkAuthExpireDate if (EmployeeRet.WorkAuthExpireDate != null) { DateTime WorkAuthExpireDate8276 = (DateTime)EmployeeRet.WorkAuthExpireDate.GetValue(); } //Get value of USVeteran if (EmployeeRet.USVeteran != null) { ENUSVeteran USVeteran8277 = (ENUSVeteran)EmployeeRet.USVeteran.GetValue(); } //Get value of MilitaryStatus if (EmployeeRet.MilitaryStatus != null) { ENMilitaryStatus MilitaryStatus8278 = (ENMilitaryStatus)EmployeeRet.MilitaryStatus.GetValue(); } //Get value of AccountNumber if (EmployeeRet.AccountNumber != null) { string AccountNumber8279 = (string)EmployeeRet.AccountNumber.GetValue(); } //Get value of Notes if (EmployeeRet.Notes != null) { string Notes8280 = (string)EmployeeRet.Notes.GetValue(); } if (EmployeeRet.AdditionalNotesRetList != null) { for (int i8281 = 0; i8281 < EmployeeRet.AdditionalNotesRetList.Count; i8281++) { IAdditionalNotesRet AdditionalNotesRet = EmployeeRet.AdditionalNotesRetList.GetAt(i8281); //Get value of NoteID int NoteID8282 = (int)AdditionalNotesRet.NoteID.GetValue(); //Get value of Date DateTime Date8283 = (DateTime)AdditionalNotesRet.Date.GetValue(); //Get value of Note string Note8284 = (string)AdditionalNotesRet.Note.GetValue(); } } if (EmployeeRet.BillingRateRef != null) { //Get value of ListID if (EmployeeRet.BillingRateRef.ListID != null) { string ListID8285 = (string)EmployeeRet.BillingRateRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.BillingRateRef.FullName != null) { string FullName8286 = (string)EmployeeRet.BillingRateRef.FullName.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo != null) { //Get value of PayPeriod if (EmployeeRet.EmployeePayrollInfo.PayPeriod != null) { ENPayPeriod PayPeriod8287 = (ENPayPeriod)EmployeeRet.EmployeePayrollInfo.PayPeriod.GetValue(); } if (EmployeeRet.EmployeePayrollInfo.ClassRef != null) { //Get value of ListID if (EmployeeRet.EmployeePayrollInfo.ClassRef.ListID != null) { string ListID8288 = (string)EmployeeRet.EmployeePayrollInfo.ClassRef.ListID.GetValue(); } //Get value of FullName if (EmployeeRet.EmployeePayrollInfo.ClassRef.FullName != null) { string FullName8289 = (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 ClearEarnings8291 = (bool)EmployeeRet.EmployeePayrollInfo.OREarnings.ClearEarnings.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList != null) { if (EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList != null) { for (int i8292 = 0; i8292 < EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.Count; i8292++) { IEarnings Earnings = EmployeeRet.EmployeePayrollInfo.OREarnings.EarningsList.GetAt(i8292); //Get value of ListID if (Earnings.PayrollItemWageRef.ListID != null) { string ListID8293 = (string)Earnings.PayrollItemWageRef.ListID.GetValue(); } //Get value of FullName if (Earnings.PayrollItemWageRef.FullName != null) { string FullName8294 = (string)Earnings.PayrollItemWageRef.FullName.GetValue(); } if (Earnings.ORRate != null) { if (Earnings.ORRate.Rate != null) { //Get value of Rate if (Earnings.ORRate.Rate != null) { double Rate8296 = (double)Earnings.ORRate.Rate.GetValue(); } } if (Earnings.ORRate.RatePercent != null) { //Get value of RatePercent if (Earnings.ORRate.RatePercent != null) { double RatePercent8297 = (double)Earnings.ORRate.RatePercent.GetValue(); } } } } } } } //Get value of IsUsingTimeDataToCreatePaychecks if (EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks != null) { bool IsUsingTimeDataToCreatePaychecks8298 = (bool)EmployeeRet.EmployeePayrollInfo.IsUsingTimeDataToCreatePaychecks.GetValue(); } //Get value of UseTimeDataToCreatePaychecks if (EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks != null) { ENUseTimeDataToCreatePaychecks UseTimeDataToCreatePaychecks8299 = (ENUseTimeDataToCreatePaychecks)EmployeeRet.EmployeePayrollInfo.UseTimeDataToCreatePaychecks.GetValue(); } if (EmployeeRet.EmployeePayrollInfo.SickHours != null) { //Get value of HoursAvailable if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable != null) { IQBTimeIntervalType HoursAvailable8300 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursAvailable.GetValue(); } //Get value of AccrualPeriod if (EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod != null) { ENAccrualPeriod AccrualPeriod8301 = (ENAccrualPeriod)EmployeeRet.EmployeePayrollInfo.SickHours.AccrualPeriod.GetValue(); } //Get value of HoursAccrued if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued != null) { IQBTimeIntervalType HoursAccrued8302 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursAccrued.GetValue(); } //Get value of MaximumHours if (EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours != null) { IQBTimeIntervalType MaximumHours8303 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.MaximumHours.GetValue(); } //Get value of IsResettingHoursEachNewYear if (EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear != null) { bool IsResettingHoursEachNewYear8304 = (bool)EmployeeRet.EmployeePayrollInfo.SickHours.IsResettingHoursEachNewYear.GetValue(); } //Get value of HoursUsed if (EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed != null) { IQBTimeIntervalType HoursUsed8305 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.SickHours.HoursUsed.GetValue(); } //Get value of AccrualStartDate if (EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate != null) { DateTime AccrualStartDate8306 = (DateTime)EmployeeRet.EmployeePayrollInfo.SickHours.AccrualStartDate.GetValue(); } } if (EmployeeRet.EmployeePayrollInfo.VacationHours != null) { //Get value of HoursAvailable if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable != null) { IQBTimeIntervalType HoursAvailable8307 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAvailable.GetValue(); } //Get value of AccrualPeriod if (EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod != null) { ENAccrualPeriod AccrualPeriod8308 = (ENAccrualPeriod)EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualPeriod.GetValue(); } //Get value of HoursAccrued if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued != null) { IQBTimeIntervalType HoursAccrued8309 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursAccrued.GetValue(); } //Get value of MaximumHours if (EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours != null) { IQBTimeIntervalType MaximumHours8310 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.MaximumHours.GetValue(); } //Get value of IsResettingHoursEachNewYear if (EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear != null) { bool IsResettingHoursEachNewYear8311 = (bool)EmployeeRet.EmployeePayrollInfo.VacationHours.IsResettingHoursEachNewYear.GetValue(); } //Get value of HoursUsed if (EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed != null) { IQBTimeIntervalType HoursUsed8312 = (IQBTimeIntervalType)EmployeeRet.EmployeePayrollInfo.VacationHours.HoursUsed.GetValue(); } //Get value of AccrualStartDate if (EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate != null) { DateTime AccrualStartDate8313 = (DateTime)EmployeeRet.EmployeePayrollInfo.VacationHours.AccrualStartDate.GetValue(); } } } //Get value of ExternalGUID if (EmployeeRet.ExternalGUID != null) { string ExternalGUID8314 = (string)EmployeeRet.ExternalGUID.GetValue(); } if (EmployeeRet.DataExtRetList != null) { for (int i8315 = 0; i8315 < EmployeeRet.DataExtRetList.Count; i8315++) { IDataExtRet DataExtRet = EmployeeRet.DataExtRetList.GetAt(i8315); //Get value of OwnerID if (DataExtRet.OwnerID != null) { string OwnerID8316 = (string)DataExtRet.OwnerID.GetValue(); } //Get value of DataExtName string DataExtName8317 = (string)DataExtRet.DataExtName.GetValue(); //Get value of DataExtType ENDataExtType DataExtType8318 = (ENDataExtType)DataExtRet.DataExtType.GetValue(); //Get value of DataExtValue string DataExtValue8319 = (string)DataExtRet.DataExtValue.GetValue(); } } } } } |