What do you want to do? Do you want to solve your approval tasks without going to the company?
I can give you a good idea.
We can use the mobile phone text message service to implement Event Callback through ws,
You only need one text message to approve or reject your request.
I just want to tell you how to do this.
:
The following column is an unattended review.
The code is implemented as follows:
Above is my
Below is the code
Using system;
Using system. collections;
Using system. Collections. Generic;
Using system. text;
Using Microsoft. SharePoint;
Using Microsoft. Sharepoint. workflow;
Using system. Data;
Namespace spworkflowtaskdemo
{
Class Program
{
Static void main (string [] ARGs)
{
Try
{
Spsite site = NULL;
Spsecurity. runwithelevatedprivileges (delegate ()
{
Site = new spsite (@ "http: // LH-vnmpc: 6060 /");
Spweb web = site. openweb ();
Web. allowunsafeupdates = true;
Site. allowunsafeupdates = true;
Splist lists = web. Lists ["Application List"];
Spworkflowmanager manager = site. workflowmanager;
Spworkflowtaskcollection tasks = lists. items [lists. Items. Count-1]. workflows [0]. tasks;
Int Index = tasks. Count-1;
// Foreach (spfield field in tasks [Index]. fields)
//{
// Console. writeline ("Name: {0} --- value: {1}", field. internalname, tasks [Index] [field. internalname]);
//}
Tasks [Index] ["status"] = "approved ";
Tasks [Index] ["completed"] = "true ";
Tasks [Index] ["percentcomplete"] = 1;
Tasks [Index] ["workflowoutcome"] = "approved ";
Tasks [Index]. properties [spbuiltinfieldid. Comment] = "approved ";
Tasks [Index]. properties ["ows_taskstatus"] = "@";
Hashtable ht = new hashtable ();
Ht. Add ("status", "completed ");
Ht. Add ("completed", true );
Ht. Add ("ows_taskstatus ","#");
Ht. Add ("workflowoutcome", "OK ");
Spworkflowtask. altertask (tasks [Index], HT, true );
Tasks [Index]. Update ();
Web. Close ();
Web. Dispose ();
Site. Close ();
Site. Dispose ();
});
}
Catch (exception E)
{
Console. writeline (E. tostring ());
}
The Code has no practical value, but I hope you can learn something in it,