如何通过PSI以编程方式将用户添加到Project Server 2010。 [英] How to add User Programatically to Project server 2010 through PSI.

查看:80
本文介绍了如何通过PSI以编程方式将用户添加到Project Server 2010。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以有人 帮助我如何通过PSI以编程方式将用户添加到Project Server 2010?

Can Somebody  help me How to add User to Project server 2010 programmatically through PSI ?

谢谢。

推荐答案

您需要引用资源WCF / Web服务,调用资源数据集并添加包含信息的资源行, 参考它有一个好例子的
SDK ,下面是摘录表格 

You need to reference the resource WCF / Web service, call the resource dataset and add resource row with information, refer to the SDK it has good examples to start with, below is an excerpt form it 

 private static SvcResource.ResourceDataSet PopulateData(
            SvcResource.ResourceDataSet resDs, string resName, double unitsAvail)
        {
            SvcResource.ResourceDataSet.ResourcesRow resRow = resDs.Resources.NewResourcesRow();
            SvcResource.ResourceDataSet.ResourceAvailabilitiesRow resAvailRow = 
                resDs.ResourceAvailabilities.NewResourceAvailabilitiesRow();

            resRow.RES_NAME = resName;
            resRow.RES_UID = Guid.NewGuid();
            resRow.RES_TYPE = (int)PSLibrary.Resource.Type.WorkResource;
            resRow.RES_INITIALS = resName.Substring(0, 1) 
                + (resName.IndexOf(" ") > 0
                ? resName.Substring(resName.IndexOf(" ") + 1, 1)
                : string.Empty);
            resDs.Resources.AddResourcesRow(resRow);

            resAvailRow.RES_UID = resRow.RES_UID;
            resAvailRow.SetRES_AVAIL_FROMNull();
            resAvailRow.SetRES_AVAIL_TONull();
            resAvailRow.RES_AVAIL_UNITS = unitsAvail;
            resDs.ResourceAvailabilities.AddResourceAvailabilitiesRow(resAvailRow);
            return resDs;
        }


这篇关于如何通过PSI以编程方式将用户添加到Project Server 2010。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆