| AgilePoint Developer / AgilePoint Web Controls |
The implementation of this Web Control shows a user Task List on the page at run time. The AgilePoint Task List supports the following functions:
You must create a QueryTaskListData event by double-clicking the QueryTaskListData property.
Here is some sample code in the QueryTaskListData Event.
IWFWorkflowService api = GetAPI();
string statusList = string.Format("{0};{1};{2}",
WFManualWorkItem.ASSIGNED, WFManualWorkItem.OVERDUE,
WFManualWorkItem.PSEUDO);
WFManualWorkItem[] wks =
api.GetWorkListByUserID(GetCurrentUser(), statusList);
if (wks == null) wks = new WFManualWorkItem[0];
TaskGridControl.QueryTaskListEventArgs qArgs =
e as TaskGridControl.QueryTaskListEventArgs;
qArgs.Data = wks;
You can write TaskGridControl1.Binding(); in the update page function.
If you have set a command in the Context Menu, you need to design the RowCommand event by double-clicking the RowCommand property.
Below is sample code:
int index;
if (!int.TryParse(e.CommandArgument as string,
out index)) return;
DataKey data = TaskGridControl1.DataKeys[index];
string wid = data.Values["WorkItemID"] as string;
string TaskForm = data.Values["Name"] as string;
string pid = data.Values["ProcInstID"] as string;
switch (e.CommandName)
{
case "DoTask":
Response.Redirect("../" + TaskForm +
".aspx?WID=" + wid);
break;
case "ViewProcess":
string url = "ProcessViewer.aspx?PIID=" + pid;
string script = @"<script
language='javascript'> " +
@"var szFeatures = 'scrollbars=yes,
width=770,height=500,resizable=yes';" +
@"window.top.open('" + url + "',
'ProcessViewer', szFeatures);" + @"
</script> ";
Page.ClientScript.RegisterStartupScript(Page.GetType(),
"", script);
break;
case "CreateLinkWorkItem":
IWFWorkflowService api = base.GetAPI();
api.CreateLinkedWorkItem(wid, TaskForm,
"Administrator", null, null);
break;
case "Test":
int[] i = this.TaskGridControl1.GetSelectedIndices();
IWFWorkflowService api1 = base.GetAPI();
foreach (int s in i)
{
DataKey d = TaskGridControl1.DataKeys[s];
string id = data.Values["WorkItemID"] as string;
//api1.CompleteWorkItem(id);
}
break;
default:
break;
}
UpdatePage();