/// <summary> /// Creates the XML payload for the UpdateStandardTerm Term API Request /// </summary> /// <param name="request"><see cref="UpdateStandardTermRequest">object</see></param> /// <returns><see cref="API.StandardTermEx"/>object</returns> private API.StandardTermEx SetUpdateStandardTermRequest(UpdateStandardTermRequest request) { // Initialize and Set the UpdateStandardTermRequest API.StandardTermEx updateTerm = new API.StandardTermEx(); updateTerm.ClientString = request.ClientString; updateTerm.BillingClassificationType = request.BillingClassificationType.ToString(); updateTerm.Name = request.Name; updateTerm.TermTypeCode = API.TermType.Standard; // If specified update the Nodes the Term is associated with if (request.AssociatedEPOrganization != null) updateTerm.AssociatedEPOrganization = request.AssociatedEPOrganization; // If specified update the Course Dates if (request.CourseActualStartDate != null || request.CourseActualEndDate != null) { updateTerm.CourseActualTimeFrame = new API.TimeFrame(); if (request.CourseActualStartDate != null) updateTerm.CourseActualTimeFrame.StartDate = request.CourseActualStartDate; if (request.CourseActualEndDate != null) updateTerm.CourseActualTimeFrame.EndDate = request.CourseActualEndDate; } // If specified update the Add Drop Dates if (request.DropAddPeriodStartDate != null || request.DropAddPeriodEndDate != null) { updateTerm.DropAddPeriodTimeFrame = new API.TimeFrame(); if (request.DropAddPeriodStartDate != null) updateTerm.DropAddPeriodTimeFrame.StartDate = request.DropAddPeriodStartDate; if (request.DropAddPeriodEndDate != null) updateTerm.DropAddPeriodTimeFrame.EndDate = request.DropAddPeriodEndDate; } // If specified update the Term Dates if (request.TermStartDate != null || request.TermEndDate != null) { updateTerm.TermTimeFrame = new API.TimeFrame(); if (request.TermStartDate != null) updateTerm.TermTimeFrame.StartDate = request.TermStartDate; if (request.TermEndDate != null) updateTerm.TermTimeFrame.EndDate = request.TermEndDate; } // If specified update the Registration Dates if (request.RegistrationStartDate != null || request.RegistrationEndDate != null) { updateTerm.RegistrationTimeFrame = new API.TimeFrame(); if (request.RegistrationStartDate != null) updateTerm.RegistrationTimeFrame.StartDate = request.RegistrationStartDate; if (request.RegistrationEndDate != null) updateTerm.RegistrationTimeFrame.EndDate = request.RegistrationEndDate; } // If specified update the WithdrawPeriodEndsOn if (request.WithdrawPeriodEndsOn != null) updateTerm.WithdrawPeriodEndsOn = request.WithdrawPeriodEndsOn; // If specified update the Description if (request.Description != null) updateTerm.Description = request.Description; // Set the Term Identifier accordingly updateTerm.ID = new API.TermIdentifier(); if (request.TermSourcedId != null) { updateTerm.ID.ID = request.TermSourcedId; updateTerm.ID.MappingType = API.MappedTermIDType.SourcedID; } else { updateTerm.ID.ID = request.TermId; updateTerm.ID.MappingType = API.MappedTermIDType.TermID; } return updateTerm; }
/// <summary> /// Creates the XML payload for the CreateStandardTerm Term API Request /// </summary> /// <param name="request"><see cref="CreateStandardTermRequest">object</see></param> /// <returns><see cref="API.StandardTermEx"/>object</returns> private API.StandardTermEx SetCreateStandardTermRequest(CreateStandardTermRequest request) { // Initialize and Set the CreateStandardTermRequest API.StandardTermEx createTerm = new API.StandardTermEx(); createTerm.ClientString = request.ClientString; createTerm.BillingClassificationType = request.BillingClassificationType.ToString(); // Set the Nodes the Term will be tied to accordingly if (request.AssociatedEPOrganization != null) createTerm.AssociatedEPOrganization = request.AssociatedEPOrganization; else createTerm.AssociatedEPOrganization = new string[] { ALL_NODES }; // Set the various Term timeframe properties createTerm.CourseActualTimeFrame = new API.TimeFrame(); createTerm.CourseActualTimeFrame.StartDate = request.CourseActualStartDate; createTerm.CourseActualTimeFrame.EndDate = request.CourseActualEndDate; createTerm.DropAddPeriodTimeFrame = new API.TimeFrame(); createTerm.DropAddPeriodTimeFrame.StartDate = request.DropAddPeriodStartDate; createTerm.DropAddPeriodTimeFrame.EndDate = request.DropAddPeriodEndDate; createTerm.TermTimeFrame = new API.TimeFrame(); createTerm.TermTimeFrame.StartDate = request.TermStartDate; createTerm.TermTimeFrame.EndDate = request.TermEndDate; if (request.RegistrationStartDate != null) { createTerm.RegistrationTimeFrame = new API.TimeFrame(); createTerm.RegistrationTimeFrame.StartDate = request.RegistrationStartDate; createTerm.RegistrationTimeFrame.EndDate = request.RegistrationEndDate; } if (request.WithdrawPeriodEndsOn != null) createTerm.WithdrawPeriodEndsOn = request.WithdrawPeriodEndsOn; createTerm.Name = request.Name; createTerm.Description = request.Description; createTerm.TermTypeCode = API.TermType.Standard; // Set the Destination Term Identifier createTerm.ID = new API.TermIdentifier(); createTerm.ID.ID = request.TermSourcedId; createTerm.ID.MappingType = API.MappedTermIDType.SourcedID; return createTerm; }