示例#1
0
        public IActionResult Appointment(BookingRequestObjects request)
        {
            service.Credentials     = new WebCredentials("*****@*****.**", "Sommar23", "cybercom.com");
            service.EnableScpLookup = false;
            //service.AutodiscoverUrl("*****@*****.**", RedirectionUrlValidationCallback);
            service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");

            Appointment meeting = new Appointment(service);

            // Set the properties on the meeting object to create the meeting.
            meeting.Subject = "Introduction to Cybercom Showroom";
            meeting.Body    = "Welcome to a introduction of the Cybercom Showroom!";

            meeting.Start = new DateTime(request.AppointDate.Year, request.AppointDate.Month, request.AppointDate.Day,
                                         request.AppointStart.Hour, request.AppointStart.Minute, 0);
            meeting.End = new DateTime(request.AppointDate.Year, request.AppointDate.Month, request.AppointDate.Day,
                                       request.AppointEnd.Hour, request.AppointEnd.Minute, 0);;
            meeting.Location = "Showroom";
            meeting.RequiredAttendees.Add(request.Email);
            meeting.AllowNewTimeProposal = false;

            meeting.ReminderMinutesBeforeStart = 15;
            // Save the meeting to the Calendar folder and send the meeting request.
            meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy);

            TempData["custdetails"] = "Booking is confirmed";

            Thread.Sleep(100);
            return(RedirectToAction("Booking"));
        }
示例#2
0
        public ActionResult Appointment(string i, string j)
        {
            Vecka vecka = GetData();
            BookingRequestObjects obj = new BookingRequestObjects();

            obj.AppointStart = vecka.Dagar[(Convert.ToInt32(i))].Tider[(Convert.ToInt32(j))].StartTime;
            obj.AppointEnd   = vecka.Dagar[(Convert.ToInt32(i))].Tider[(Convert.ToInt32(j))].EndTime;
            obj.AppointDate  = vecka.Dagar[(Convert.ToInt32(i))].Datum;


            return(View(obj));
        }