public virtual List <IStaff> GetStaff()
        {
            var request = new GetStaffRequest
            {
                SourceCredentials = new SourceCredentials
                {
                    SourceName = "MBO.Russel.Fritch",
                    Password   = "******",
                    SiteIDs    = new ArrayOfInt {
                        -31100
                    }
                },
            };

            var            proxy    = new StaffServiceSoapClient();
            GetStaffResult response = proxy.GetStaff(request);

            return(response.StaffMembers.Where((member) => member.ID > 0).Select((member) => new StaffModel
            {
                ID = member.ID,
                FirstName = member.FirstName,
                LastName = member.LastName,
                Name = member.Name,
            }).Cast <IStaff>().ToList());
        }
        public List <IStaff> GetStaffMembers()
        {
            var request = new GetStaffRequest
            {
                // Set Source Credentials
                SourceCredentials = new SourceCredentials
                {
                    SourceName = "apidevhomework",
                    Password   = "******",
                    SiteIDs    = new ArrayOfInt {
                        -31100
                    }
                },
                // Set Staff Credentials
                StaffCredentials = new StaffCredentials
                {
                    Username = @"Owner",
                    Password = @"apidemo1234",
                    SiteIDs  = new ArrayOfInt {
                        -31100
                    }
                },
                // Set Filters
                Filters = new[]
                {
                    StaffFilter.StaffViewable,
                    StaffFilter.AppointmentInstructor
                }
            };

            var            proxy    = new StaffServiceSoapClient();
            GetStaffResult response = proxy.GetStaff(request);

            return(response.StaffMembers.Select(member => new StaffModel
            {
                Id = member.ID,
                Address = member.Address,
                Bio = member.Bio,
                City = member.City,
                Country = member.Country,
                FirstName = member.FirstName,
                HomePhone = member.HomePhone,
                IsMale = member.isMale,
                LastName = member.LastName,
                MobilePhone = member.MobilePhone,
                Name = member.Name,
                State = member.State,
                PostalCode = member.PostalCode,
            }).Cast <IStaff>().ToList());
        }
Example #3
0
        public IEnumerable <MindBodyDemo.StaffService.Staff> GetAllStaff()
        {
            GetStaffRequest staffRequest = new GetStaffRequest();

            StaffService.SourceCredentials credentials = new StaffService.SourceCredentials();
            credentials.SourceName = "MBO.Hsiang-Ting.Yang";
            credentials.Password   = "******";
            int[] ids = new int[1];
            ids[0] = -31100;
            credentials.SiteIDs = ids;

            staffRequest.SourceCredentials = credentials;

            MindBodyDemo.StaffService.StaffService s = new StaffService.StaffService();

            GetStaffResult result = s.GetStaff(staffRequest);

            IEnumerable <MindBodyDemo.StaffService.Staff> validStaff = from staff in result.StaffMembers
                                                                       where staff.ID > 0
                                                                       select staff;

            return(validStaff);
        }