public virtual IEnumerable SynGanttSmartsheetProject(PXAdapter adapter)
        {
            this.Base.Actions.PressSave();
            PMProject pmProjectRow = this.Base.Project.Current;

            ProjectEntry projectEntryGraph = PXGraph.CreateInstance <ProjectEntry>();

            SmartsheetClient smartsheetClient = CheckTokenSheetSS(projectEntryGraph, pmProjectRow);

            if (smartsheetClient != null)
            {
                PXLongOperation.StartOperation(this.Base,
                                               () =>
                {
                    using (PXTransactionScope ts = new PXTransactionScope())
                    {
                        projectEntryGraph = this.Base;
                        ProjectEntrySmartsheetExt graphExtended = projectEntryGraph.GetExtension <ProjectEntrySmartsheetExt>();
                        CreateEmployeesAcuUserSS(projectEntryGraph, smartsheetClient);
                        graphExtended.CreateUpdateGanttProject(projectEntryGraph, pmProjectRow, smartsheetClient);
                        ts.Complete();
                    }
                });
            }

            return(adapter.Get());
        }
Esempio n. 2
0
 public SmartsheetSyncProcess()
 {
     Projects.SetProcessCaption("Sync");
     Projects.SetProcessAllCaption("Sync All");
     Projects.SetProcessDelegate <ProjectEntry>(
         delegate(ProjectEntry graph, PMProject projectRow)
     {
         graph.Clear();
         ProjectEntrySmartsheetExt projectEntryExtGraph = graph.GetExtension <ProjectEntrySmartsheetExt>();
         SmartsheetClient smartsheetClient = projectEntryExtGraph.CheckTokenSheetSS(graph, projectRow, "", true);
         projectEntryExtGraph.CreateEmployeesAcuUserSS(graph, smartsheetClient);
         projectEntryExtGraph.CreateUpdateGanttProject(graph, projectRow, smartsheetClient, true);
     });
 }