Project Server calls the PSI Shutdown task for update lockout tasks

Source: Internet
Author: User



/// <summary> ///Locking and unlocking project tasks/// </summary> /// <param name= "Projectuid" >Project UID</param> /// <param name= "Islock" >is locked</param> /// <returns></returns> Public BOOLCloseprojecttask (Guid Projectuid,BOOLIslock) { Try{queuesystemutils queuesystemutils=Newqueuesystemutils (); Projectdataset DST=Getprojectbyuid (PROJECTUID); Statusingwebsvc.projectdataset STATUSING_PRO_DST=NewStatusingwebsvc.projectdataset (); foreach(ProjectWebSvc.ProjectDataSet.TaskRow TaskrowinchDST. Task) {if(Taskrow. Task_lockdown_by_manager! =Islock) {Taskrow. Task_lockdown_by_manager=Islock; Statusing_pro_dst. Task.importrow (Taskrow); } } if(STATUSING_PRO_DST. Task.count >0) { inttemp =0; intTotal_update_count =0; intTotalCount =STATUSING_PRO_DST. Task.count; Statusingwebsvc.projectdataset statusing_pro_dst_update=NewStatusingwebsvc.projectdataset (); foreach(StatusingWebSvc.ProjectDataSet.TaskRow IteminchSTATUSING_PRO_DST. Task) {Temp++; Total_update_count++; Statusing_pro_dst_update. Task.importrow (item); if(Total_update_count >= -|| Temp >=totalcount) {Guid Jobuid=Guid.NewGuid (); Statusingclient.queuelockdowntasks (Jobuid, Projectuid, statusing_pro_dst_update); Queuesystemutils. Waitforqueue (JOBUID); Total_update_count=0; Statusing_pro_dst_update=NewStatusingwebsvc.projectdataset (); } } } return true; } Catch(Exception ex) {NewLoghelper (). WriteLine (ex. ToString ()); return false; } }

Note: If the number of scheduled tasks exceeds 500, an error occurs, the task must be processed in batches, call Queuelockdowntasks to close the project task has been updated, lock and unlock the project scheduled task

Project Server calls the PSI Shutdown task for update lockout tasks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.