コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="requestFromUI"></param>
        /// <returns></returns>
        public GetAppointmentsByCriteriaCreateDateRangeResponse GetAppointmentsByCriteriaCreateDateRange(GetAppointmentsByCriteriaCreateDateRangeRequest requestFromUI)
        {
            try
            {
                service.ClientCredentials.UserName.UserName = System.Configuration.ConfigurationManager.AppSettings["UserName"];
                service.ClientCredentials.UserName.Password = System.Configuration.ConfigurationManager.AppSettings["Password"];

                appointmentSearchCriteria reqCriteria = new appointmentSearchCriteria()
                {
                    activityExternalId = requestFromUI.ActivityExternalId,
                    campaignExternalId = requestFromUI.CampaignExternalId,
                    clientExternalId   = requestFromUI.ClientExternalId,
                    programExternalId  = requestFromUI.ProgramExternalId,
                    resourceExternalId = requestFromUI.ResourceExternalId,
                    locationExternalId = requestFromUI.LocationExternalId
                };

                appointmentListResult serviceResponse = service.getAppointmentsByCriteriaCreateDateRange(reqCriteria, DateTime.Now, DateTime.Now);

                var appts = new Appointment[] { };
                for (int i = 0; i < serviceResponse.appointments.Count(); i++)
                {
                    appts[i] = new Appointment()
                    {
                        activityExternalId     = serviceResponse.appointments[i].activityExternalId,
                        activityName           = serviceResponse.appointments[i].activityName,
                        appointmentDurationMin = serviceResponse.appointments[i].appointmentDurationMin.ToString(),
                        appointmentEndDate     = serviceResponse.appointments[i].appointmentEndDate.ToString(),
                        appointmentStartDate   = serviceResponse.appointments[i].appointmentStartDate.ToString(),
                        apptOriginName         = serviceResponse.appointments[i].apptOriginName,
                        campaignExternalId     = serviceResponse.appointments[i].campaignExternalId,
                        campaignName           = serviceResponse.appointments[i].campaignName,
                        campaignTimezone       = serviceResponse.appointments[i].campaignTimezone,
                        cancelled        = serviceResponse.appointments[i].cancelled.ToString(),
                        checkedIn        = serviceResponse.appointments[i].checkedIn.ToString(),
                        checkedOut       = serviceResponse.appointments[i].checkedOut.ToString(),
                        clientExternalId = serviceResponse.appointments[i].clientExternalId,
                        clientFirstname  = serviceResponse.appointments[i].clientFirstname,
                        clientLastname   = serviceResponse.appointments[i].clientLastname,
                        clientTimezone   = serviceResponse.appointments[i].clientTimezone,
                        compoundAppointmentConfirmationNumber = serviceResponse.appointments[i].compoundAppointmentConfirmationNumber,
                        confirmationNumber   = serviceResponse.appointments[i].confirmationNumber,
                        confirmed            = serviceResponse.appointments[i].confirmed.ToString(),
                        createdByExtUserId   = serviceResponse.appointments[i].createdByExtUserId,
                        createdByUserName    = serviceResponse.appointments[i].createdByUserName,
                        createdDate          = serviceResponse.appointments[i].createdDate,
                        custom0              = serviceResponse.appointments[i].custom0,
                        custom1              = serviceResponse.appointments[i].custom1,
                        custom3              = serviceResponse.appointments[i].custom3,
                        custom2              = serviceResponse.appointments[i].custom2,
                        custom4              = serviceResponse.appointments[i].custom4,
                        custom5              = serviceResponse.appointments[i].custom5,
                        comments             = serviceResponse.appointments[i].comments,
                        custom6              = serviceResponse.appointments[i].custom6,
                        custom7              = serviceResponse.appointments[i].custom7,
                        custom8              = serviceResponse.appointments[i].custom8,
                        custom9              = serviceResponse.appointments[i].custom9,
                        lastModifiedDateTime = serviceResponse.appointments[i].lastModifiedDateTime,
                        lateCanceled         = serviceResponse.appointments[i].lateCanceled.ToString(),
                        locationExternalId   = serviceResponse.appointments[i].locationExternalId,
                        numberOfAttendees    = serviceResponse.appointments[i].numberOfAttendees.ToString(),
                        programExternalId    = serviceResponse.appointments[i].programExternalId,
                        programName          = serviceResponse.appointments[i].programName,
                        resourceExternalId   = serviceResponse.appointments[i].resourceExternalId,
                        resourceName         = serviceResponse.appointments[i].resourceName,
                        setupDurationMin     = serviceResponse.appointments[i].setupDurationMin.ToString(),
                        walkIn     = serviceResponse.appointments[i].walkIn.ToString(),
                        workFlowId = serviceResponse.appointments[i].workFlowId
                    };
                }

                var response = new GetAppointmentsByCriteriaCreateDateRangeResponse()
                {
                    Appointments = appts,
                    TTStatus     = new Entities.TTStatus()
                    {
                        Cause  = serviceResponse.status.cause,
                        Result = serviceResponse.status.result,
                        Status = serviceResponse.status.status
                    }
                };

                for (int i = 0; i < serviceResponse.result.Length; i++)
                {
                    response.Result[i].Cause  = serviceResponse.result[i].cause;
                    response.Result[i].Result = serviceResponse.result[i].result;
                    response.Result[i].Status = serviceResponse.result[i].status;
                }
                return(response);
            }
            catch (FaultException exception)
            {
                throw exception;
            }
        }
コード例 #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="requestFromUI"></param>
        /// <returns></returns>
        public GetAppointmentsByCriteriaCreateDateRangeResponse GetAppointmentsByCriteriaCreateDateRange(GetAppointmentsByCriteriaCreateDateRangeRequest requestFromUI)
        {
            try
            {
                service.ClientCredentials.UserName.UserName = System.Configuration.ConfigurationManager.AppSettings["UserName"];
                service.ClientCredentials.UserName.Password = System.Configuration.ConfigurationManager.AppSettings["Password"];

                appointmentSearchCriteria reqCriteria = new appointmentSearchCriteria()
                {
                    activityExternalId = requestFromUI.ActivityExternalId,
                    campaignExternalId = requestFromUI.CampaignExternalId,
                    clientExternalId = requestFromUI.ClientExternalId,
                    programExternalId = requestFromUI.ProgramExternalId,
                    resourceExternalId = requestFromUI.ResourceExternalId,
                    locationExternalId = requestFromUI.LocationExternalId
                };

                appointmentListResult serviceResponse = service.getAppointmentsByCriteriaCreateDateRange(reqCriteria, DateTime.Now, DateTime.Now);

                var appts = new Appointment[] { };
                for (int i = 0; i < serviceResponse.appointments.Count(); i++)
                {
                    appts[i] = new Appointment()
                    {
                        activityExternalId = serviceResponse.appointments[i].activityExternalId,
                        activityName = serviceResponse.appointments[i].activityName,
                        appointmentDurationMin = serviceResponse.appointments[i].appointmentDurationMin.ToString(),
                        appointmentEndDate = serviceResponse.appointments[i].appointmentEndDate.ToString(),
                        appointmentStartDate = serviceResponse.appointments[i].appointmentStartDate.ToString(),
                        apptOriginName = serviceResponse.appointments[i].apptOriginName,
                        campaignExternalId = serviceResponse.appointments[i].campaignExternalId,
                        campaignName = serviceResponse.appointments[i].campaignName,
                        campaignTimezone = serviceResponse.appointments[i].campaignTimezone,
                        cancelled = serviceResponse.appointments[i].cancelled.ToString(),
                        checkedIn = serviceResponse.appointments[i].checkedIn.ToString(),
                        checkedOut = serviceResponse.appointments[i].checkedOut.ToString(),
                        clientExternalId = serviceResponse.appointments[i].clientExternalId,
                        clientFirstname = serviceResponse.appointments[i].clientFirstname,
                        clientLastname = serviceResponse.appointments[i].clientLastname,
                        clientTimezone = serviceResponse.appointments[i].clientTimezone,
                        compoundAppointmentConfirmationNumber = serviceResponse.appointments[i].compoundAppointmentConfirmationNumber,
                        confirmationNumber = serviceResponse.appointments[i].confirmationNumber,
                        confirmed = serviceResponse.appointments[i].confirmed.ToString(),
                        createdByExtUserId = serviceResponse.appointments[i].createdByExtUserId,
                        createdByUserName = serviceResponse.appointments[i].createdByUserName,
                        createdDate = serviceResponse.appointments[i].createdDate,
                        custom0 = serviceResponse.appointments[i].custom0,
                        custom1 = serviceResponse.appointments[i].custom1,
                        custom3 = serviceResponse.appointments[i].custom3,
                        custom2 = serviceResponse.appointments[i].custom2,
                        custom4 = serviceResponse.appointments[i].custom4,
                        custom5 = serviceResponse.appointments[i].custom5,
                        comments = serviceResponse.appointments[i].comments,
                        custom6 = serviceResponse.appointments[i].custom6,
                        custom7 = serviceResponse.appointments[i].custom7,
                        custom8 = serviceResponse.appointments[i].custom8,
                        custom9 = serviceResponse.appointments[i].custom9,
                        lastModifiedDateTime = serviceResponse.appointments[i].lastModifiedDateTime,
                        lateCanceled = serviceResponse.appointments[i].lateCanceled.ToString(),
                        locationExternalId = serviceResponse.appointments[i].locationExternalId,
                        numberOfAttendees = serviceResponse.appointments[i].numberOfAttendees.ToString(),
                        programExternalId = serviceResponse.appointments[i].programExternalId,
                        programName = serviceResponse.appointments[i].programName,
                        resourceExternalId = serviceResponse.appointments[i].resourceExternalId,
                        resourceName = serviceResponse.appointments[i].resourceName,
                        setupDurationMin = serviceResponse.appointments[i].setupDurationMin.ToString(),
                        walkIn = serviceResponse.appointments[i].walkIn.ToString(),
                        workFlowId = serviceResponse.appointments[i].workFlowId
                    };
                }

                var response = new GetAppointmentsByCriteriaCreateDateRangeResponse()
                {
                    Appointments = appts,
                    TTStatus = new Entities.TTStatus()
                    {
                        Cause = serviceResponse.status.cause,
                        Result = serviceResponse.status.result,
                        Status = serviceResponse.status.status
                    }
                };

                for (int i = 0; i < serviceResponse.result.Length; i++)
                {
                    response.Result[i].Cause = serviceResponse.result[i].cause;
                    response.Result[i].Result = serviceResponse.result[i].result;
                    response.Result[i].Status = serviceResponse.result[i].status;
                }
                return response;
            }
            catch (FaultException exception)
            {
                throw exception;
            }
        }