public async Task ShouldReturn_Valid_EventObject(string fileName, EventResource eventResource, EventType eventType, RoomType roomType)
        {
            // Arrange
            var content = GetResource(fileName);
            var api     = GetApi <Event>(HttpMethod.Get, $"{WxTeamsConstants.EventsUrl}/MyEventId", content);

            // Act
            var teamsEvent = await api.GetEventAsync("MyEventId");

            // Assert
            teamsEvent.Id.Should().Be("Y2lzY29zcGFyazovL3VzL0VWRU5UL2JiY2ViMWFkLTQzZjEtM2I1OC05MTQ3LWYxNGJiMGM0ZDE1NAo");
            teamsEvent.ActorId.Should().Be("Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNWIzNjE4Ny1jOGRkLTQ3MjctOGIyZi1mOWM0NDdmMjkwNDY");
            teamsEvent.Created.Should().Be(new DateTimeOffset(2016, 05, 16, 21, 34, 59, 324, TimeSpan.Zero));
            teamsEvent.OrgId.Should().Be("OTZhYmMyYWEtM2RjYy0xMWU1LWExNTItZmUzNDgxOWNkYzlh");
            teamsEvent.Type.Should().Be(eventType);
            teamsEvent.EventData.Id.Should().Be("Y2lzY29zcGFyazovL3VzL01FU1NBR0UvOTJkYjNiZTAtNDNiZC0xMWU2LThhZTktZGQ1YjNkZmM1NjVk");
            teamsEvent.EventData.PersonEmail.Should().Be("*****@*****.**");
            teamsEvent.EventData.PersonId.Should().Be("Y2lzY29zcGFyazovL3VzL1BFT1BMRS9mNWIzNjE4Ny1jOGRkLTQ3MjctOGIyZi1mOWM0NDdmMjkwNDY");
            teamsEvent.EventData.RoomId.Should().Be("Y2lzY29zcGFyazovL3VzL1JPT00vYmJjZWIxYWQtNDNmMS0zYjU4LTkxNDctZjE0YmIwYzRkMTU0");
            teamsEvent.EventData.RoomType.Should().Be(roomType);
            teamsEvent.EventData.Text.Should().StartWith("PROJECT UPDATE - A new project");
            teamsEvent.TeamsApi.Should().NotBeNull();
            teamsEvent.TeamsApi.TeamsClient.Should().NotBeNull();
            teamsEvent.Resource.Should().Be(eventResource);
        }
Exemple #2
0
        public Client(Credentials credentials, IEnvironment env = null)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }

            environment = env ?? Environments.Production;
            requester   = new Requester(credentials, environment);

            Account      = new AccountResource(requester);
            Balance      = new BalanceResource(requester);
            Charges      = new ChargeResource(requester);
            Customers    = new CustomerResource(requester);
            Disputes     = new DisputeResource(requester);
            Events       = new EventResource(requester);
            Forex        = new ForexResource(requester);
            Links        = new LinkResource(requester);
            Occurrences  = new OccurrenceResource(requester);
            Receipts     = new ReceiptResource(requester);
            Recipients   = new RecipientResource(requester);
            Refunds      = new RefundResource(requester);
            Schedules    = new ScheduleResource(requester);
            Tokens       = new TokenResource(requester);
            Transactions = new TransactionResource(requester);
            Transfers    = new TransferResource(requester);
        }
Exemple #3
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var _event = EventResource.Fetch(pathSid: "AE21f24380625e4aa4abec76e39b14458d");

        Console.WriteLine(_event.ActorSid);
    }
 /// <summary>
 /// This method will call the Event resource method to set the RSVP status for a Guest of the event
 /// </summary>
 /// <param name="objGuestToAdd">An CompleteGuestList Object which contain Guest and it's RSVP status</param>
 /// <param name="objEvent">An Events Object which contain event details</param>
 public void AddRsvp(CompleteGuestList objGuestToAdd, int EventId, int UserId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         int RSVPId =objEventRes.AddRsvp(objGuestToAdd, EventId, UserId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";
        const string eventSid   = "AE21f24380625e4aa4abec76e39b14458d";

        TwilioClient.Init(accountSid, authToken);

        var e = EventResource.Fetch(eventSid);

        Console.WriteLine(e.Description);
    }
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        // DANGER! This is insecure. See http://twil.io/secure
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var _event = EventResource.Fetch(pathSid: "AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

        Console.WriteLine(_event.ActorSid);
    }
        public void TestReadEmptyResponse()
        {
            var twilioRestClient = Substitute.For<ITwilioRestClient>();
            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any<Request>())
                            .Returns(new Response(
                                         System.Net.HttpStatusCode.OK,
                                         "{\"events\": [],\"end\": 0,\"first_page_uri\": \"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0\",\"next_page_uri\": null,\"page\": 0,\"page_size\": 50,\"previous_page_uri\": null,\"start\": 0,\"uri\": \"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0\"}"
                                     ));

            var response = EventResource.Read("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);
            Assert.NotNull(response);
        }
        public void TestReadFullResponse()
        {
            var twilioRestClient = Substitute.For<ITwilioRestClient>();
            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any<Request>())
                            .Returns(new Response(
                                         System.Net.HttpStatusCode.OK,
                                         "{\"events\": [{\"request\": {\"method\": \"POST\",\"url\": \"https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json\",\"parameters\": {\"status_callback_method\": \"POST\",\"twiml\": \"<Response><Say>Hi!</Say></Response>\",\"trim\": \"trim-silence\",\"timeout\": \"55\",\"method\": \"POST\",\"from\": \"+987654321\",\"to\": \"+123456789\",\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"machine_detection_timeout\": \"0\"}},\"response\": {\"response_code\": 201,\"request_duration\": 50,\"content_type\": \"application/json\",\"response_body\": \"{\\\"sid\\\": \\\"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\\"}\",\"date_created\": \"Tue, 11 Aug 2020 17:44:08 +0000\"}}],\"end\": 0,\"first_page_uri\": \"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0\",\"next_page_uri\": null,\"page\": 0,\"page_size\": 50,\"previous_page_uri\": null,\"start\": 0,\"uri\": \"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json?PageSize=50&Page=0\"}"
                                     ));

            var response = EventResource.Read("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);
            Assert.NotNull(response);
        }
Exemple #9
0
        public EventControl(string path)
        {
            InitializeComponent();

            MenuTabs = new ToolStripMenuItem[] {
            };

            LoadedResource      = new EventResource(path);
            Story               = new StoryItem <State>(new State(LoadedResource));
            Story.ValueChanged += Story_ValueChanged;

            ResourcePath = path;
            ResourceName = Path.GetFileName(path);
        }
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        // To set up environmental variables, see http://twil.io/secure
        const string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        const string authToken  = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
        const string eventSid   = "AE21f24380625e4aa4abec76e39b14458d";

        TwilioClient.Init(accountSid, authToken);

        var e = EventResource.Fetch(eventSid);

        Console.WriteLine(e.Description);
    }
Exemple #11
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read();

        foreach (var record in events)
        {
            Console.WriteLine(record.Sid);
        }
    }
Exemple #12
0
        public void TestReadDeepResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"meta\": {\"page\": 10,\"page_size\": 5,\"first_page_url\": \"https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=5&Page=0\",\"previous_page_url\": \"https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=5&Page=9&PageToken=DP10\",\"next_page_url\": null,\"key\": \"events\",\"url\": \"https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=5&Page=10\"},\"events\": [{\"timestamp\": \"2019-09-19T22:15:23Z\",\"call_sid\": \"CA03a02b156c6faa96c86906f7e9ad0f38\",\"account_sid\": \"AC998c10b68cbfda9f67277f7d8f4439c9\",\"edge\": \"sdk_edge\",\"group\": \"connection\",\"name\": \"error\",\"level\": \"ERROR\",\"sdk_edge\": {\"error\": {\"code\": 31600},\"metadata\": {\"client_name\": \"GTI9300323095d271b890c91568931321395\",\"location\": {\"lat\": 37.4192,\"lon\": -122.0574},\"city\": \"Mountain View\",\"country_code\": \"US\",\"country_subdivision\": \"California\",\"ip_address\": \"108.177.7.83\",\"sdk\": {\"type\": \"twilio-voice-android\",\"version\": \"4.5.1\",\"platform\": \"android\",\"selected_region\": \"gll\",\"os\": {\"name\": \"android\",\"version\": \"4.3\"},\"device\": {\"model\": \"GT-I9300\",\"type\": \"GT-I9300\",\"vendor\": \"samsung\",\"arch\": \"armeabi-v7a\"}}}},\"client_edge\": null,\"carrier_edge\": null,\"sip_edge\": null}]}"
                         ));

            var response = EventResource.Read("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestReadFullResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"events\": [{\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_type\": \"account\",\"description\": null,\"event_data\": {\"friendly_name\": {\"previous\": \"SubAccount Created at 2014-10-03 09:48 am\",\"updated\": \"Mr. Friendly\"}},\"event_date\": \"2014-10-03T16:48:25Z\",\"event_type\": \"account.updated\",\"links\": {\"actor\": \"https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"resource\": \"https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},\"resource_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"resource_type\": \"account\",\"sid\": \"AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"source\": \"api\",\"source_ip_address\": \"10.86.6.250\",\"url\": \"https://monitor.twilio.com/v1/Events/AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}],\"meta\": {\"first_page_url\": \"https://monitor.twilio.com/v1/Events?PageSize=50&Page=0\",\"key\": \"events\",\"next_page_url\": null,\"page\": 0,\"page_size\": 50,\"previous_page_url\": null,\"url\": \"https://monitor.twilio.com/v1/Events?PageSize=50&Page=0\"}}"
                         ));

            var response = EventResource.Read(client: twilioRestClient);

            Assert.NotNull(response);
        }
Exemple #14
0
        public void TestFetchResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_sid\": \"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_type\": \"workspace\",\"actor_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"description\": \"Worker JustinWorker updated to Idle Activity\",\"event_data\": {\"worker_activity_name\": \"Offline\",\"worker_activity_sid\": \"WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_attributes\": \"{}\",\"worker_name\": \"JustinWorker\",\"worker_sid\": \"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_time_in_previous_activity\": \"26\",\"workspace_name\": \"WorkspaceName\",\"workspace_sid\": \"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},\"event_date\": \"2015-02-07T00:32:41Z\",\"event_type\": \"worker.activity\",\"resource_sid\": \"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"resource_type\": \"worker\",\"resource_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"sid\": \"EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"source\": \"twilio\",\"source_ip_address\": \"1.2.3.4\",\"url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}"
                         ));

            var response = EventResource.Fetch("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestReadEmptyResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"events\": [],\"meta\": {\"first_page_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0\",\"key\": \"events\",\"next_page_url\": null,\"page\": 0,\"page_size\": 50,\"previous_page_url\": null,\"url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0\"}}"
                         ));

            var response = EventResource.Read("WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);

            Assert.NotNull(response);
        }
Exemple #16
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var _event = EventResource.Fetch(
            pathWorkspaceSid: "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "EVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
            );

        Console.WriteLine(_event.ActorSid);
    }
        public void TestReadEmptyResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"events\": [],\"meta\": {\"first_page_url\": \"https://monitor.twilio.com/v1/Events?PageSize=50&Page=0\",\"key\": \"events\",\"next_page_url\": null,\"page\": 0,\"page_size\": 50,\"previous_page_url\": null,\"url\": \"https://monitor.twilio.com/v1/Events?PageSize=50&Page=0\"}}"
                         ));

            var response = EventResource.Read(client: twilioRestClient);

            Assert.NotNull(response);
        }
        public void TestReadFullResponse()
        {
            var twilioRestClient = Substitute.For <ITwilioRestClient>();

            twilioRestClient.AccountSid.Returns("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
            twilioRestClient.Request(Arg.Any <Request>())
            .Returns(new Response(
                         System.Net.HttpStatusCode.OK,
                         "{\"events\": [{\"account_sid\": \"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_sid\": \"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"actor_type\": \"workspace\",\"actor_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"description\": \"Worker JustinWorker updated to Idle Activity\",\"event_data\": {\"worker_activity_name\": \"Offline\",\"worker_activity_sid\": \"WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_attributes\": \"{}\",\"worker_name\": \"JustinWorker\",\"worker_sid\": \"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_time_in_previous_activity\": \"26\",\"worker_time_in_previous_activity_ms\": \"26123\",\"workspace_name\": \"WorkspaceName\",\"workspace_sid\": \"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},\"event_date\": \"2015-02-07T00:32:41Z\",\"event_date_ms\": 987654321111,\"event_type\": \"worker.activity\",\"resource_sid\": \"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"resource_type\": \"worker\",\"resource_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"sid\": \"EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"source\": \"twilio\",\"source_ip_address\": \"1.2.3.4\",\"workspace_sid\": \"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}],\"meta\": {\"first_page_url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0\",\"key\": \"events\",\"next_page_url\": null,\"page\": 0,\"page_size\": 50,\"previous_page_url\": null,\"url\": \"https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0\"}}"
                         ));

            var response = EventResource.Read("WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", client: twilioRestClient);

            Assert.NotNull(response);
        }
Exemple #19
0
        public async Task <IActionResult> PutAsync(int id, [FromBody] EventResource resource)
        {
            var eventToUpdate = _mapper.Map <EventResource, Event>(resource);

            var result = await _eventService.Update(id, eventToUpdate);

            if (!result.Success)
            {
                return(BadRequest(new ErrorResource(result.Message)));
            }

            var eventResource = _mapper.Map <Event, EventResource>(result.Resource);

            return(Ok(eventResource));
        }
Exemple #20
0
        public async Task <bool> AddEvent(EventResource resource)
        {
            Event e = new Event()
            {
                AdministratorId = resource.UserId,
                OrganizatorId   = resource.OrganizatorId,
                PlaceId         = resource.PlaceId,
                BeginDate       = resource.BeginDate,
                FinishDate      = resource.FinishDate,
                Name            = resource.Name
            };

            await _eventRepository.AddEvent(e);

            return(true);
        }
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid  = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken   = "your_auth_token";
        const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(resourceSid: resourceSid);

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
Exemple #22
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        // DANGER! This is insecure. See http://twil.io/secure
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(resourceSid: "PN4aa51b930717ea83c91971b86d99018f");

        foreach (var record in events)
        {
            Console.WriteLine(record.Sid);
        }
    }
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid   = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken    = "your_auth_token";
        const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(workspaceSid);

        foreach (var e in events)
        {
            Console.WriteLine(e.EventType);
        }
    }
Exemple #24
0
        public Client(Credentials credentials) {
            if (credentials == null) throw new ArgumentNullException("credentials");
            requester = new Requester(credentials);

            Account = new AccountResource(requester);
            Balance = new BalanceResource(requester);
            Cards = new CardResourceShim(requester);
            Charges = new ChargeResource(requester);
            Customers = new CustomerResource(requester);
            Disputes = new DisputeResource(requester);
            Events = new EventResource(requester);
            Recipients = new RecipientResource(requester);
            Refunds = new RefundResourceShim(requester);
            Tokens = new TokenResource(requester);
            Transactions = new TransactionResource(requester);
            Transfers = new TransferResource(requester);
        }
Exemple #25
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        // To set up environmental variables, see http://twil.io/secure
        const string accountSid   = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        const string authToken    = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
        const string workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(workspaceSid);

        foreach (var e in events)
        {
            Console.WriteLine(e.EventType);
        }
    }
        public IList <EventResource> TerhiqEventet()
        {
            IList <EventResource> oListEvents = new List <EventResource>();


            EventResource event1 = new EventResource();

            event1.id          = 1;
            event1.allDay      = false;
            event1.title       = "event 1";
            event1.description = "test description 1";
            event1.start       = new System.DateTime(2020, 01, 25, 17, 20, 30);;
            event1.end         = new System.DateTime(2020, 01, 25, 17, 40, 30);
            oListEvents.Add(event1);

            EventResource event2 = new EventResource();

            event2.id          = 2;
            event2.allDay      = false;
            event2.title       = "event 2";
            event2.description = "test description 2";
            event2.start       = new System.DateTime(2020, 01, 28, 17, 00, 30);
            event2.end         = new System.DateTime(2020, 01, 28, 17, 20, 30);
            oListEvents.Add(event2);

            EventResource event3 = new EventResource();

            event3.id          = 3;
            event3.allDay      = false;
            event3.title       = "event 3";
            event3.description = "test description 3";
            event3.start       = new System.DateTime(2020, 01, 30, 13, 00, 30);
            event3.end         = new System.DateTime(2020, 01, 30, 14, 20, 30);
            oListEvents.Add(event3);

            EventResource event4 = new EventResource();

            event4.id          = 4;
            event4.allDay      = false;
            event4.title       = "event 4";
            event4.description = "test description 4";
            event4.start       = new System.DateTime(2020, 01, 31, 14, 00, 30);
            event4.end         = new System.DateTime(2020, 01, 31, 15, 20, 30);
            oListEvents.Add(event4);
            return(oListEvents);
        }
Exemple #27
0
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            startDate: new DateTime(2015, 3, 1),
            endDate: new DateTime(2015, 4, 1));

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
Exemple #28
0
        public BreweryDbClient(string key)
        {
            ApplicationKey = key;

            Beers = new BeerResource<Beer>(this);
            Breweries = new BreweryResource<Brewery>(this);
            Categories = new CategoryResource<Category>(this);
            Adjuncts = new AdjunctResource<Adjunct>(this);
            Yeasts = new YeastResource<Yeast>(this);
            SocialSites = new SocialSiteResource<SocialSite>(this);
            Events = new EventResource<Event>(this);
            Features = new FeatureResource<Feature>(this);
            Guildes = new GuildResource<Guild>(this);
            Fermentables = new FermentableResource<Fermentable>(this);
            FluidSizes = new FluidSizeResource<FluidSize>(this);
            Changes = new ChangeResource<Change>(this);
        }
        /// <summary>
        /// Checks and gets resource data.
        /// </summary>
        /// <typeparam name="TTeamsData">Type of resource data.</typeparam>
        /// <param name="eventResource"><see cref="EventResource"/> to be checked.</param>
        /// <returns>Resource data.</returns>
        private TTeamsData checkAndGetResourceData <TTeamsData>(EventResource eventResource)
            where TTeamsData : TeamsData, new()
        {
            TTeamsData result;

            if (this.Resource == eventResource)
            {
                result = this.GetResourceData <TTeamsData>();
            }
            else
            {
                result           = new TTeamsData();
                result.HasValues = false;
            }

            return(result);
        }
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        // To set up environmental variables, see http://twil.io/secure
        const string accountSid  = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        const string authToken   = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");
        const string resourceSid = "PN4aa51b930717ea83c91971b86d99018f";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(resourceSid: resourceSid);

        foreach (var e in events)
        {
            Console.WriteLine(e.Description);
        }
    }
Exemple #31
0
            public void ToResource(EventResource r)
            {
                r.Actions.Clear();
                for (int i = 0; i < Actions.Length; i++)
                {
                    r.Actions.Add(new EventResource.Action());
                    r.Actions[i].Type    = Actions[i].Type;
                    r.Actions[i].Link    = Actions[i].Link;
                    r.Actions[i].OffsetX = Actions[i].OffsetX;
                    r.Actions[i].OffsetY = Actions[i].OffsetY;
                }

                r.MinDelay = MinDelay;
                r.MaxDelay = MaxDelay;

                r.BackColor   = BackColor;
                r.GridEnabled = GridEnabled;
            }
Exemple #32
0
            public State(EventResource r)
            {
                Actions = new Action[r.Actions.Count];

                for (int i = 0; i < r.Actions.Count; i++)
                {
                    Actions[i].Type    = r.Actions[i].Type;
                    Actions[i].Link    = r.Actions[i].Link;
                    Actions[i].OffsetX = r.Actions[i].OffsetX;
                    Actions[i].OffsetY = r.Actions[i].OffsetY;
                }

                MinDelay = r.MinDelay;
                MaxDelay = r.MaxDelay;

                BackColor   = r.BackColor;
                GridEnabled = r.GridEnabled;
            }
Exemple #33
0
    static void Main(string[] args)
    {
        // Find your Account Sid and Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken  = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var events = EventResource.Read(
            endDate: MarshalConverter.DateTimeFromString("2015-04-01"),
            startDate: MarshalConverter.DateTimeFromString("2015-03-01")
            );

        foreach (var record in events)
        {
            Console.WriteLine(record.Sid);
        }
    }
 /// <summary>
 /// This method will call the Event resource method to get the event theme for particulat theme
 /// </summary>
 /// <param name="eventThemeID">id of the theme</param>
 /// <returns></returns>
 public EventTheme GetEventThemeByID(int eventThemeID)
 {
     EventTheme objEventTheme = null;
     try
     {
         EventResource objEventRes = new EventResource();
         objEventTheme = objEventRes.GetEventThemeByID(eventThemeID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objEventTheme;
 }
 /// <summary>
 /// Get Folder Name for Update and delete theme in Admin portal By Ashu
 /// </summary>
 /// <param name="themeid"></param>
 /// <returns></returns>
 public string GetFoldername(int themeid)
 {
     string objFolderName = "";
     try
     {
         EventResource objEventRes = new EventResource();
         objFolderName = objEventRes.GetFoldername(themeid);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objFolderName;
 }
 /// <summary>
 /// This method will call the Event resource method to save the RSVPs for a Guest of the event
 /// </summary>
 /// <param name="objGuestToAdd">An CompleteGuestList Object which contain Guest and it's RSVP status</param>
 //public void SaveRsvp(IList<CompleteGuestList> objGuestToAdd, int EventId, int counter, IList<CompleteGuestList> lstCompleteGuestList, int countRSVP)
 //{
 //    try
 //    {
 //        EventResource objEventRes = new EventResource();
 //        objEventRes.SaveRsvp(objGuestToAdd, EventId, counter, lstCompleteGuestList, countRSVP);
 //    }
 //    catch (Exception ex)
 //    {
 //        throw ex;
 //    }
 //}
 public IList<CompleteGuestList> SaveRsvp(IList<CompleteGuestList> objGuestToAdd, int EventId)
 {
     IList<CompleteGuestList> objCompleteGuestList = new List<CompleteGuestList>();
     try
     {
         EventResource objEventRes = new EventResource();
         objCompleteGuestList =objEventRes.SaveRsvp(objGuestToAdd, EventId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objCompleteGuestList;
 }
 /// <summary>
 /// To delete theme from database By Ashu
 /// </summary>
 /// <param name="themeId"></param>
 public void DeleteTheme(int themeId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         objEventRes.DeleteTheme(themeId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// This method will call the Event resource method to get the event theme information
 /// for particular event invitation category and tributetype
 /// </summary>
 /// <param name="eventInvitationCategoryID">id of event invitation category</param>
 /// <param name="tributeType">tributetype</param>
 /// <returns>list of object having eventtheme information</returns>
 public IList<EventTheme> EventThemeInfo(int eventInvitationCategoryID, string tributeType)
 {
     IList<EventTheme> objEventThemeList = null;
     try
     {
         EventResource objEventRes = new EventResource();
         objEventThemeList = objEventRes.EventThemeInfo(eventInvitationCategoryID, tributeType);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objEventThemeList;
 }
 public List<CompleteGuestList> GetEmailIdsForEvent(int GuestId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         return objEventRes.GetEmailIdsForEvent(GuestId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// This method will call the Event resource method to invite the guest for the event
        /// </summary>
        /// <param name="objEvent">An Event Object which contain event id and Guest List</param>
        public int InviteGuest(Events objEvent)
        {
            int count = 0;

            try
            {
                StateManager objStateManager = StateManager.Instance;
                SessionValue objSessionValue = (SessionValue)objStateManager.Get(PortalEnums.SessionValueEnum.objSessionvalue.ToString(), StateManager.State.Session);

                StateManager objStateManager_ = StateManager.Instance;
                Tributes objTribute = (Tributes)objStateManager_.Get(PortalEnums.SessionValueEnum.TributeSession.ToString(), StateManager.State.Session);

                TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
                string Servername = (string)stateManager.Get("SERVERNAME", TributesPortal.Utilities.StateManager.State.Session);

                EventResource objEventRes = new EventResource();
                Events objEventDetails = objEventRes.GetEventInfo(objEvent);

                //Added by amit
                objEventDetails.EventID = objEvent.EventID;
                objEventDetails.TributeId = objEvent.TributeId;
                objEventDetails.IsActive = true;
                objEventDetails.UserId = objEvent.UserId;
                objEventDetails.ModifiedBy = objEvent.UserId;
                objEventDetails.TributeType = objEvent.TributeType;
                objEventDetails.EventThemeID = objEvent.EventThemeID;
                objEventDetails.EventMessage = objEvent.EventMessage;
                objEventDetails.State = objEvent.State;
               // objEventDetails.IsAskForMeal = objEventRes.IsAskForMeal;
                objEventRes.UpdateEvent(objEventDetails);

                string EmailSubject = objSessionValue.FirstName + " " + objSessionValue.LastName + " invited you to the event \"" + objEventDetails.EventName + "\"";
                for (int i = 0; i < objEvent.EventAwaiting.Count; i++)
                {
                    Events emailEvent = new Events();
                    emailEvent.EventID = objEvent.EventID;
                    emailEvent.EmailId = objEvent.EventAwaiting[i].UserName.ToString();
                    emailEvent.IsAskForMeal = objEventDetails.IsAskForMeal;
                    emailEvent.MealOptions = objEventDetails.MealOptions;
                    object identity = objEventRes.InviteGuest(emailEvent);
                    if (identity != null)
                    {
                        if (int.Parse(identity.ToString()) != 0)
                        {
                            //Insert the Hashcode for the Guest
                            string Hashcode = GetHashCode(int.Parse(identity.ToString()));
                            objEventRes.InsertHashCodeForGuest(int.Parse(identity.ToString()), Hashcode);

                            EmailMessages objEmail = EmailMessages.Instance;

                            EventTheme objTheme = GetEventThemeByID(objEventDetails.EventThemeID);

                            StringBuilder objEmailBody = new StringBuilder();
                            objEmailBody.Append("<html>");
                            objEmailBody.Append("<head>");
                            objEmailBody.Append("<title>Event Invitation Mail</title>");
                            objEmailBody.Append("</head>");
                            objEmailBody.Append("<body text='#000000' link='#000000'>");
                            objEmailBody.Append("<table width='700' border='0' align='center' cellpadding='0' cellspacing='0'>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><table width='100%' border='0' cellspacing='10' cellpadding='0'>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Having trouble seeing this email? <a href='http://" + objEventDetails.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "/event.aspx?EventID=" + objEventDetails.EventID + "'> Visit our Event webpage.</a></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("</table></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td><table width='520' height='650' border='0' align='center' cellpadding='0' cellspacing='10' bgcolor='" + objTheme.ThemeBackgroundColor + "'>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><img src='" + GetImageURL(objTheme.ThemeFullSizeImage) + "' alt='Invitation Photo' /></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>&nbsp;</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><strong><font size='4' face='Verdana, Arial, Helvetica, sans-serif'>" + objEventDetails.EventName + " </font></strong></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>" + objEventDetails.EventMessage + " </font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong>When:</strong></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>" + DateTime.Parse(objEventDetails.EventDate.ToString()).ToString("MMMM dd, yyyy") + ", " + objEventDetails.EventStartTime + " - " + objEventDetails.EventEndTime + "</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong>Where:</strong></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>" + objEventDetails.EventPlace + "</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong>Website:</strong></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><a href='http://" + objEventDetails.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "/'>http://" + objEventDetails.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "/</a></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>&nbsp;</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("</table>");
                            objEmailBody.Append("</td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td><table width='100%' border='0' cellspacing='10' cellpadding='0'>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><a href='http://" + objEventDetails.TributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "/event.aspx?EventID=" + objEventDetails.EventID + "&TributeID=" + objEventDetails.TributeId + "&Hashcode=" + Hashcode + "'><b><font size='4' face='Verdana, Arial, Helvetica, sans-serif'>Please visit our " + objEventDetails.TributeType + " Tribute to RSVP</font></b></a></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("</table>");
                            objEmailBody.Append("</td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td><table width='100%' border='0' cellspacing='5' cellpadding='0'>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>This email has a unique link just for you, please do not forward it to others.</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Your Tribute respects your privacy. For any privacy concerns please <a href='"+ WebConfig.AppBaseDomain +"privacy.aspx'>click here.</a></font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>Your Tribute, Inc.</font></td>");
                            objEmailBody.Append("</tr>");
                            objEmailBody.Append("<tr>");
                            objEmailBody.Append("<td align='center'><font color='#666666' size='1' face='Verdana, Arial, Helvetica, sans-serif'>2875 North Lamb Blvd. Bldg 8, Las Vegas, NV 89115</font></td>");
                            objEmailBody.Append("</tr></table></td>");
                            objEmailBody.Append("</tr></table></body></html>");

                            bool val = objEmail.SendMessages("Your Tribute<" + WebConfig.NoreplyEmail + ">", emailEvent.EmailId, EmailSubject, objEmailBody.ToString(), EmailMessages.TextFormat.Html.ToString());
                            count++;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return count;
        }
        /// <summary>
        /// This method will call the Event Resource class method to Delete the event in the database
        /// And send the email to all admin about the event deletion for all public event and also
        /// resend the mail to all guest list about teh event deletion
        /// </summary>
        /// <param name="objEvent">An Event Object which contain event id which wants to delete</param>
        public void DeleteEvent(Events objEvent)
        {
            try
            {
                EventResource objEventRes = new EventResource();

                // First get the Guest List for the event which are going to update
                Events guestList = objEventRes.GetEventGuestList(objEvent);
                TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
                //string Servername = (string)stateManager.Get("SERVERNAME", TributesPortal.Utilities.StateManager.State.Session);

                // Now Delete the Event and Guest List
                objEventRes.DeleteEvent(objEvent);

                // Send the email to all the adminstrator that event has been updated
                if ((objEvent != null) && (objEvent.CustomError == null) && (objEvent.IsPrivate == false))
                {
                    string EmailSubject = string.Empty;

                    if (!string.IsNullOrEmpty(objEvent.LastName))
                        EmailSubject = objEvent.FirstName + " " + objEvent.LastName + " cancelled the event \"" + objEvent.EventName + "\"";
                    else
                        EmailSubject = objEvent.FirstName + " cancelled the event \"" + objEvent.EventName + "\"";
                    string EmailBody = "<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objEvent.FirstName + " " + objEvent.LastName + " cancelled the event \"" + objEvent.EventName + "\"" + " in the " + objEvent.TributeName + " " + objEvent.TributeType + "  Tribute." +
                        "<br/><br/>" + "To view the tribute, follow the link below:" + "<br/>";
                    //string href = "<a href='http://" + objEvent.TributeType.Trim().ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "'> http://" + Servername + "/" + objEvent.TributeURL + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";
                    string href = "<a href='http://" + objEvent.TributeType.Trim().ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "'> http://" + objEvent.TributeType.Trim().ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";
                    EmailBody += href;

                    SendEmail(objEvent.TributeId, EmailSubject, EmailBody);
                }

                if (guestList.EventAwaiting != null)
                {
                    // Send the email to all the Guest who are invited for the event that event has been updated
                    for (int i = 0; i < guestList.EventAwaiting.Count; i++)
                    {
                        Events emailEvent = new Events();
                        emailEvent.EventID = objEvent.EventID;
                        emailEvent.EmailId = guestList.EventAwaiting[i].UserName.ToString();
                        string EmailSubject = string.Empty;

                        if (!string.IsNullOrEmpty(objEvent.LastName))
                            EmailSubject = objEvent.FirstName + " " + objEvent.LastName + " cancelled the event \"" + objEvent.EventName + "\"";
                        else
                            EmailSubject = objEvent.FirstName + " cancelled the event \"" + objEvent.EventName + "\"";

                        string EmailBody = "<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objEvent.FirstName + " " + objEvent.LastName + "  cancelled the event \"" + objEvent.EventName + "\"" + " in the " + objEvent.TributeName + " " + objEvent.TributeType + " Tribute." +
                        "<br/><br/>" + "To view the tribute, follow the link below:" + "<br/>";
                        //string href = "<a href='http://" + objEvent.TributeType.Trim().ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "'> http://" + Servername + "/" + objEvent.TributeURL + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";
                        string href = "<a href='http://" + objEvent.TributeType.Trim().ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "'> http://" + objEvent.TributeType.Trim().ToLower().Replace("new baby", "newbaby") + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";
                        //string href = "<a href='http://" + objEvent.TributeType.Trim().ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "'> http://" + objEvent.TributeType.Trim().ToLower() + "." + WebConfig.TopLevelDomain + "/" + "/" + objEvent.TributeURL + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";
                        EmailBody += href;

                        EmailMessages objEmail = EmailMessages.Instance;
                        bool val = objEmail.SendMessages("Your Tribute<" + WebConfig.NoreplyEmail + ">", emailEvent.EmailId, EmailSubject, CreateBody(EmailBody), EmailMessages.TextFormat.Html.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// This method will call the Event Resource class method to Add the event in the database
        /// And send the email to all admin about the event insertion for all public event
        /// </summary>
        /// <param name="objEvent">An Event Object which contain Event information</param>
        public void SaveEvent(Events objEvent)
        {
            try
            {
                EventResource objEventRes = new EventResource();
                object identity = objEventRes.SaveEvent(objEvent);

                // Send the email to all the adminstrator if event is public that event has been created
                if ((objEvent != null) && (objEvent.CustomError == null) && (identity != null)
                    && (int.Parse(identity.ToString()) != 0) && (objEvent.IsPrivate == false))
                {
                    string EmailSubject = objEvent.FirstName + " " + objEvent.LastName + " added a new event on Your " + WebConfig.ApplicationWordForInternalUse.ToString() + "...";
                    string EmailBody = "<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objEvent.FirstName + " " + objEvent.LastName + " added a new event in the " + objEvent.TributeName + " " + objEvent.TributeType + " " + WebConfig.ApplicationWordForInternalUse.ToString() + ".</p><p> To view the event, follow the link below: <br/> " + objEvent.ServerURL + " </p>" + "<p>----" + "<br/>" + "Your " + WebConfig.ApplicationWord.ToString() + " Team</p></font>";

                    SendEmail(objEvent.TributeId, EmailSubject, EmailBody.Replace("##", identity.ToString()));
                }

                // If an event name an event type combination already exist in database then
                // return an error message
                if (int.Parse(identity.ToString()) == 0)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = "This Event Name '" + objEvent.EventName + "' with this Event Type already exist";
                    objEvent.CustomError = objError;
                }
                else    // otherwise return the eventid
                {
                    objEvent.EventID = int.Parse(identity.ToString());
                }

                SessionValue objSessionValue = null;
                StateManager objStateManager = StateManager.Instance;
                objSessionValue = (SessionValue)objStateManager.Get(PortalEnums.SessionValueEnum.objSessionvalue.ToString(), StateManager.State.Session);
                if ((objEvent != null) && (objEvent.CustomError == null) && (identity != null)
                   && (int.Parse(identity.ToString()) != 0))
                {
                   object value =  objEventRes.SaveRsvpForCreator(objEvent,objSessionValue);
                   if (value != null)
                   {
                       if (int.Parse(value.ToString()) != 0)
                       {
                           //Insert the Hashcode for the Guest
                           string Hashcode = GetHashCode(int.Parse(value.ToString()));
                           objEventRes.InsertHashCodeForGuest(int.Parse(value.ToString()), Hashcode);
                       }
                   }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// This method will call the event resource save event theme method 
 /// </summary>
 /// <param name="objEventTheme"></param>
 /// <returns></returns>
 public object SaveEventTheme(EventTheme objEventTheme)
 {
     object identity = null;
     try
     {
         EventResource objEventRes = new EventResource();
         identity = objEventRes.SaveEventTheme(objEventTheme);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return identity;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="objGuestToAdd"></param>
 /// <returns></returns>
 public object UpdateRsvp(CompleteGuestList objGuestToAdd)
 {
     object identity = null;
     try
     {
         EventResource objEventRes = new EventResource();
         identity = objEventRes.UpdateRsvp(objGuestToAdd);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return identity;
 }
        /// <summary>
        /// This method will call the Event Resource class method to Update the event in the database
        /// And send the email to all admin about the event updation for all public event and also
        /// resend the mail to all guest list about teh event updation
        /// </summary>
        /// <param name="objEvent">An Event Object which contain updated Event information</param>
        public void UpdateEvent(Events objEvent)
        {
            try
            {
                EventResource objEventRes = new EventResource();

                // First get the Guest List for the event which are going to update
                Events guestList = objEventRes.GetEventGuestList(objEvent);

                // Now Update the Event Detail
                object identity = objEventRes.UpdateEvent(objEvent);

                // Send the email to all the adminstrator if event is public that event has been updated
                if ((objEvent != null) && (objEvent.CustomError == null) && (identity != null)
                    && (int.Parse(identity.ToString()) != 0) && (objEvent.IsPrivate == false))
                {
                    string EmailSubject = objEvent.FirstName + " " + objEvent.LastName + " updated the event \"" + objEvent.EventName + "\"";
                    string EmailBody = "<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objEvent.FirstName + " " + objEvent.LastName + " updated the event \"" + objEvent.EventName + "\"<br/> <br/> To see more details, follow the link below: <br/> " + objEvent.ServerURL.ToLower() + "<br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";

                    SendEmail(objEvent.TributeId, EmailSubject, EmailBody.Replace("##", objEvent.EventID.ToString()));
                }

                // If an event name an event type combination already exist in database then
                // return an error message
                if (int.Parse(identity.ToString()) == 0)
                {
                    Errors objError = new Errors();
                    objError.ErrorMessage = "This Event Name '" + objEvent.EventName + "' with this Event Type already exist";
                    objEvent.CustomError = objError;
                }
                else   // Otherwise send the mail to all Guests about the updation
                {
                    // Send the email to all the Guest who are invited for the event that event has been updated
                    if (guestList.EventAwaiting != null)
                    {
                        for (int i = 0; i < guestList.EventAwaiting.Count; i++)
                        {
                            Events emailEvent = new Events();

                            emailEvent.EventID = objEvent.EventID;
                            emailEvent.EmailId = guestList.EventAwaiting[i].UserName.ToString();

                            string EmailSubject = objEvent.FirstName + " " + objEvent.LastName + " invited you to the event " + objEvent.TributeName;
                            string EmailBody = "<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + objEvent.FirstName + " " + objEvent.LastName + " invited you to the event '" + objEvent.EventName + "' in the " + objEvent.TributeName + " Tribute. <br/> <br/> To RSVP and see more details, follow the link below: <br/> <br/>";

                            string href = objEvent.InviteGuestURL + "?EventID=" + objEvent.EventID + "&TributeID=" + objEvent.TributeId + "&mode=emailPage" + "&Email=" + emailEvent.EmailId;
                            EmailBody += href + "'>" + "http://" + objEvent.TributeType.ToLower() + "." + WebConfig.TopLevelDomain + "/" + objEvent.TributeURL + "/event.aspx?&EventId=" + objEvent.EventID + "</a>" + "<br/> <br/>" + "----" + "<br/>" + "Your Tribute Team</p></font>";

                            EmailMessages objEmail = EmailMessages.Instance;
                            bool val = objEmail.SendMessages("Your Tribute<" + WebConfig.NoreplyEmail + ">", emailEvent.EmailId, EmailSubject, CreateBody(EmailBody), EmailMessages.TextFormat.Html.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 /// <summary>
 /// This method will call the Event Resource class method to get the event list from the database
 /// </summary>
 /// <param name="objEvent">An Event Object which contain Tribute Id for which wants to get the event list</param>
 /// <returns>This method will return the list of Events object which contain the Event list</returns>
 public IList<Events> GetEventList(Events objEvent)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         return objEventRes.GetEventList(objEvent);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public int GetUserIdByTributeId(int tributeId)
 {
     int userId;
     try
     {
         EventResource objEventRes = new EventResource();
         userId = objEventRes.GetUserIdByTributeId(tributeId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return userId;
 }
 /// <summary>
 /// Get Themes for delete and  Update theme in Admin portal By Ashu
 /// </summary>
 /// <param name="strCategoryName"></param>
 /// <param name="strSubCategoryName"></param>
 public IList<Themes> GetThemesList(string strSubCategory, string strSubCategoryName, string applicationType)
 {
     IList<Themes> objThemesSubCategoryList = null;
     try
     {
         EventResource objEventRes = new EventResource();
         objThemesSubCategoryList = objEventRes.GetThemesList(strSubCategory, strSubCategoryName, applicationType);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objThemesSubCategoryList;
 }
 public List<CompleteGuestList> GetCompleteGuestList(int EventId, string Hashcode, bool isCreator)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         return objEventRes.GetCompleteGuestList(EventId, Hashcode, isCreator);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 //Get CategoryList
 public IList<Themes> GetSubCategoryList(string strSubCategory)
 {
     IList<Themes> objThemesSubCategoryList = null;
     try
     {
         EventResource objEventRes = new EventResource();
         objThemesSubCategoryList = objEventRes.GetSubCategoryList(strSubCategory);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objThemesSubCategoryList;
 }
 /// <summary>
 /// This method will call the Event resource method to get the all event invitation 
 /// categories for passed tributetype
 /// </summary>
 /// <param name="tributeType">TributeType</param>
 /// <returns>list of objects having EventInvitationCategory information</returns>
 public IList<EventInvitationCategory> EventInvitationCategories(string tributeType)
 {
     IList<EventInvitationCategory> objEventInvitationCategoryList = null;
     try
     {
         EventResource objEventRes = new EventResource();
         objEventInvitationCategoryList = objEventRes.EventInvitationCategories(tributeType);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return objEventInvitationCategoryList;
 }
 public CompleteGuestList GetMealOptions(int GuestId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         return objEventRes.GetMealOptionList(GuestId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="guestId"></param>
 /// <param name="additionalGuestId"></param>
 public void DeleteRsvp(int guestId, int additionalGuestId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         objEventRes.DeleteRsvp(guestId, additionalGuestId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// This method will call the Event Resource class method to get the event detail in the database
 /// </summary>
 /// <param name="objEvent">An Event Object which contain Event Id for which wants to get the detail of the event</param>
 /// <returns>This method will return the Events object which contain the Event information</returns>
 public Events GetFullEvent(Events objEvent)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         return objEventRes.GetFullEvent(objEvent);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// This method will call the event resource save category based theme method 
 /// </summary>
 /// <param name="objEventTheme"></param>
 /// <returns></returns>
 public object SaveCategoryBasedTheme(Themes objThemes)
 {
     object identity = null;
     try
     {
         EventResource objEventRes = new EventResource();
         identity = objEventRes.SaveCategoryBasedTheme(objThemes);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return identity;
 }
 /// <summary>
 /// This method will call the event resource save event invitation category method
 /// </summary>
 /// <param name="objEventInvitationCategory"></param>
 /// <returns></returns>
 public object SaveInvitationCategory(EventInvitationCategory objEventInvitationCategory)
 {
     object identity = null;
     try
     {
         EventResource objEventRes = new EventResource();
         identity = objEventRes.SaveInvitationCategory(objEventInvitationCategory);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return identity;
 }