public override string ToString() { string ss; ss = Id.ToString() + "|"; ss += TargetDate.ToString() + "|"; ss += Link + "|"; ss += GetStatusString() + "|"; return(ss); }
public override string ToString() { string ss; ss = Id.ToString() + "|"; ss += TargetDate.ToString() + "|"; ss += "ftp://" + Username + @"@" + Hostname + "|"; ss += RemoteName + "|"; ss += GetStatusString() + "|"; return(ss); }
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite sitecollection = new SPSite(Url)) { using (SPWeb web = sitecollection.OpenWeb()) { SPList list = web.Lists["Aufgaben"]; SPListItem listitem = list.Items.Add(); SPContentType ConType = list.ContentTypes[ContentType.ToString()]; if (ConType != null) { listitem["ContentTypeId"] = ConType.Id; } if (!String.IsNullOrEmpty(Title) & listitem.Fields.ContainsField("Title")) { listitem["Title"] = Title.ToString(); } if (!String.IsNullOrEmpty(Descript) & (listitem.Fields.ContainsField("Beschreibung") | listitem.Fields.ContainsField("Body"))) { listitem["Beschreibung"] = Descript.ToString(); } if (!String.IsNullOrEmpty(Link) & listitem.Fields.ContainsField("Link")) { LinkFieldValue lfValue = new LinkFieldValue(); lfValue.NavigateUrl = Link.ToString(); lfValue.Text = "Link zu Dokument"; lfValue.UseDefaultIcon = false; listitem["Link"] = lfValue; } if (!String.IsNullOrEmpty(AccountName) & listitem.Fields.ContainsField("AssignedTo")) { SPUserCollection users = web.Users; SPUser user = UserExists(users, AccountName.ToString()); if (user != null) { listitem["AssignedTo"] = user; } else { SPGroupCollection groups = web.Groups; if (GroupExists(groups, AccountName.ToString())) { listitem["AssignedTo"] = web.Groups[AccountName.ToString()]; } } } if (!String.IsNullOrEmpty(Quelle) & listitem.Fields.ContainsField("Aufgabenquelle")) { listitem["Aufgabenquelle"] = Quelle.ToString(); } if ((TargetDate.ToString() != string.Empty) & (listitem.Fields.ContainsField("DueDate"))) { listitem["DueDate"] = TargetDate; } if (listitem.Fields.ContainsField("WorkflowID")) { listitem["WorkflowID"] = WorkflowID; } listitem.Update(); TaskID = listitem.ID; } } }); return(base.Execute(executionContext)); }
public override string ToString() { return(IsEnabled + " " + AlertType + " " + TargetDate?.ToString("dd/MM/yyyy HH:mm")); }