Example #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (FirstName.Length != 0)
            {
                hash ^= FirstName.GetHashCode();
            }
            if (LastName.Length != 0)
            {
                hash ^= LastName.GetHashCode();
            }
            if (Emailaddress.Length != 0)
            {
                hash ^= Emailaddress.GetHashCode();
            }
            if (IsAlive != false)
            {
                hash ^= IsAlive.GetHashCode();
            }
            if (Age != 0)
            {
                hash ^= Age.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #2
0
        internal void Register()
        {
            // Populate the Excel Data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Registration");
            Thread.Sleep(500);

            // Click the Join button on the Home page
            Join.Click();

            // Input the First name field with valid characters
            Firstname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Firstname"));

            // Input the Last name field with valid characters
            Lastname.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Lastname"));

            // Input the Email address field with valid characters
            Emailaddress.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Emailaddress"));

            // Input the Password field with valid characters
            Password.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password"));

            // Input the Confirm Password field with valid characters
            ConfirmPassword.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ConfirmPassword"));

            // Click the I agree to the terms and conditions checkbox
            Checkbox.Click();

            // Click the Join button on the Registration form page
            Joinbtn.Click();
        }
Example #3
0
        private CalendarEvent CreateCalendarEvent(MeetingRequestInput mri, MeetingSlot slot)
        {
            CalendarEvent ce  = new CalendarEvent();
            var           ema = new Emailaddress()
            {
                address = mri.OrganizerEmail,
                name    = mri.OrganizerName
            };
            var o = new Organizer()
            {
                EmailAddress = ema
            };

            ce.Organizer   = o;
            ce.IsOrganizer = true;

            ce.Location = new SimpleLocation()
            {
                DisplayName = "Skype"
            };
            // TODO: Here's where to integrate with CRM
            // Probably need three extra items:
            // ICRMOperations
            // CRMOperations
            // CRM DTO of some sort
            string bodyText = "How can I help you?";

            ce.Body = new Body()
            {
                Content = bodyText, ContentType = "text"
            };

            // TODO: This assumes we're offsetting from Pacific Time
            // https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/dateTimeTimeZone
            string timeZoneText = "Pacific Standard Time";

            ce.Start = new ZonedDateTime()
            {
                dateTime = slot.Start, timeZone = timeZoneText
            };
            ce.End = new ZonedDateTime()
            {
                dateTime = slot.Start.AddSeconds(mri.MeetingDuration.Value), timeZone = timeZoneText
            };
            ce.Subject = mri.MeetingSubject;

            var aema = new Emailaddress()
            {
                address = mri.AttendeeEmail,
                name    = mri.AttendeeName
            };
            var a = new InvitedAttendee()
            {
                EmailAddress = aema,
                Type         = "Required"
            };

            ce.Attendees         = new InvitedAttendee[] { a, };
            ce.ResponseRequested = true;

            // https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_findmeetingtimes
            ce.Type       = "0"; // Single Instance
            ce.Importance = "1"; // Normal
            ce.ShowAs     = "2"; // Busy

            ce.IsReminderOn = true;
            ce.ReminderMinutesBeforeStart = 15;

            ce.HasAttachments = false;

            return(ce);
        }
Example #4
0
        private FindMeetingTimesRequest BuildFMTR(MeetingRequestInput mri)
        {
            DateTime preferredDate   = mri.RequestedDateTime.Value;
            int      meetingDuration = mri.MeetingDuration.Value;


            FindMeetingTimesRequest fmtr = new FindMeetingTimesRequest();

            // Attendees
            // In this example, we're only looking at the organzier's
            // calendar.
            var me  = new Attendee();
            var ema = new Emailaddress()
            {
                address = mri.OrganizerEmail,
                name    = mri.OrganizerName
            };

            me.emailAddress = ema;
            me.type         = "Required";

            // Location Constraint
            var lc = new Locationconstraint();

            var l = new Location()
            {
                displayName = "Skype"
            };

            lc.locations       = new Location[] { l };
            lc.isRequired      = bool.FalseString;
            lc.suggestLocation = bool.TrueString;

            // Time Constraint
            var tc      = new Timeconstraint();
            var ztStart = new ZonedDateTime();
            var ztEnd   = new ZonedDateTime();

            // TODO: This assumes we're offsetting from Pacific Time
            // https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/dateTimeTimeZone
            var    current      = new DateTime(preferredDate.Year, preferredDate.Month, preferredDate.Day, 17, 0, 0, DateTimeKind.Utc);
            string timeZoneText = "Pacific Standard Time";

            ztStart.dateTime = current;
            ztStart.timeZone = timeZoneText;
            ztEnd.dateTime   = current.AddDays(1).AddHours(1);
            ztEnd.timeZone   = timeZoneText;

            var ts = new Timeslot()
            {
                start = ztStart,
                end   = ztEnd
            };

            tc.timeslots = new Timeslot[] { ts };

            fmtr.attendees          = new Attendee[] { me };
            fmtr.locationConstraint = lc;
            // https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_findmeetingtimes
            // The length of the meeting, denoted in ISO8601 format.
            fmtr.meetingDuration = XmlConvert.ToString(TimeSpan.FromSeconds(meetingDuration));
            fmtr.timeConstraint  = tc;
            fmtr.maxCandidates   = 3;

            return(fmtr);
        }