Update My Task Using PSI in Project Server 2013

Update My Task Using PSI in Project Server 2013:-

Update My Task Using PSI in Project Server 2013. My Task is those task on which a particular resource is assigned. There are multiple projects created by the project manager and assign the project task to all resource on pwa. Here is the description of the project tasks i.e assign to a particular resource. How to update my task using PSI.

Firstly add projectserverservice web reference. if you don’t know how to create and add¬†projectserverservice.dll in gac and add reference then go to my previous post.

How to Create Project Server Service dll

How to Register a dll in GAC

[AdSense-A]

Update My task using psi

 

Below is code for Update My Task Using PSI in Project Server 2013:-

[AdSense-A]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;

namespace UpdateMyTask
{
    class Program
    {
        public static string ENDPOINT_PROJECT = "basicHttp_Project";
        public static string ENDPOINT_RESOURCE = "basicHttp_Resource";
        public static string ENDPOINT_TIMESHEET = "basicHttp_TimeSheet";
        public static string ENDPOINT_ADMIN = "basicHttp_Admin";
        public static string ENDPOINT_QUEUESYSTEM = "basicHttp_QueueSystem";
        private static SvcStatusing.StatusingClient statusingClient;
        public static string PWAUrl = "http://ServerName/PWA";
        static void Main(string[] args)
            {
            SetClientEndpoint(PWAUrl);
            string ProjId = "32AAB956-1610-E511-AAA8-00155D013B17", AssnId = "D8C08780-B218-E511-8FF0-00155D012427", ResID = "8D872362-B0E8-E411-B560-00155D013B12";
            DateTime FinishDate = Convert.ToDateTime("2015-04-21 17:00:00.000");
            DateTime StartDate = Convert.ToDateTime("2015-04-21 17:00:00.000");
            int workhr = 10 * 60000, Remaininghr = 5* 60000;
            // Statusing statusing = new Statusing { Credentials = CredentialCache.DefaultCredentials, Url = "http://ntpc/PWA/_vti_bin/psi/Statusing.asmx" };
            
            StringBuilder str = new StringBuilder("<Changes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">");
            str.Append(string.Format("<Proj ID="{0}">", ProjId));
            str.Append(string.Format("<Assn ID="{0}" ResID="{1}">", AssnId, ResID));
            str.Append("<Change PID="251658256">" + StartDate + "</Change>");
            str.Append("</Assn>");
            str.Append("</Proj>");
            str.Append(string.Format("<Proj ID="{0}">", ProjId));
            str.Append(string.Format("<Assn ID="{0}" ResID="{1}">", AssnId, ResID));
            str.Append("<Change PID="251658257">" + FinishDate + "</Change>");
            str.Append("</Assn>");
            str.Append("</Proj>");
            str.Append(string.Format("<Proj ID="{0}">", ProjId));
            str.Append(string.Format("<Assn ID="{0}" ResID="{1}">", AssnId, ResID));
            str.Append("<Change PID="251658250">" + workhr + "</Change>");
            str.Append("</Assn>");
            str.Append("</Proj>");
            str.Append(string.Format("<Proj ID="{0}">", ProjId));
            str.Append(string.Format("<Assn ID="{0}" ResID="{1}">", AssnId, ResID));
            str.Append("<Change PID="251658248">" + Remaininghr + "</Change>");
            str.Append("</Assn>");
            str.Append("</Proj>");
            str.Append("</Changes>");
            
            statusingClient.UpdateStatus(str.ToString());
            statusingClient.SubmitStatus(null, "Submitted by PSI");
            
            }
        
    }
}

Click Here to Download Code


Comments

  1. Thank you for the auspicious writeup. It in fact
    was a amusement account it. Look advanced to more added agreeable from you!

    By the way, how can we communicate?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!