protected override void Execute(CodeActivityContext context) { // Get the connection string DBConnection ext = context.GetExtension <DBConnection>(); if (ext == null) { throw new InvalidProgramException("No connection string available"); } RequestDataContext dc = new RequestDataContext(ext.ConnectionString); // Create and initialize a Request object Request r = new Request(); r.UserName = UserName.Get(context); r.UserEmail = UserEmail.Get(context); r.RequestType = RequestType.Get(context); r.Comment = Comment.Get(context); r.CreateDate = DateTime.UtcNow; r.RequestKey = RequestKey.Get(context); r.QueueInstanceKey = QueueInstanceKey.Get(context); // Insert the Request record PersistRequest persist = context.GetExtension <PersistRequest>(); persist.AddRequest(r); }
protected override Task <bool> ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken, Application client) { var collectionName = CollectionName.Get(context); var email = UserEmail.Get(context); return(client.RemoveUserFromCustomCollection(collectionName, email)); }
protected override Task <bool> ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken, Application client) { var collectionName = CollectionName.Get(context); var email = UserEmail.Get(context); var permission = UserPermission; return(client.AddUserToCustomCollection(collectionName, email, permission)); }
/// <summary> /// This is main function for this class /// It will create Exchange service object as output /// </summary> /// <param name="context"></param> protected override void Execute(CodeActivityContext context) { // getting the input values ************************ string userEmailaddress = UserEmail.Get(context); string userEmailPassword = new System.Net.NetworkCredential(string.Empty, UserPassword.Get(context)).Password; string url = Url.Get(context); ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013); service.Credentials = new System.Net.NetworkCredential(userEmailaddress, userEmailPassword, ""); service.Url = new Uri(url); ObjExchangeService.Set(context, service); }