Пример #1
0
        public void Complete_Activity(Core.DocumentProperties properties, OfficeConnectorExtensionAddinRibbon MyRibbon)
        {
            List <Core.DocumentProperty> propertylist = properties.Cast <Core.DocumentProperty>().ToList();
            bool PrimaryLinkItemIdexist = propertylist.Where(x => x.Name == Settings.Default.arasPrimaryLinkItemId).Any();

            if (PrimaryLinkItemIdexist)
            {
                if ((inn = Connect_to_Aras(MyRibbon)) != null)
                {
                    ActivityForm AF = new ActivityForm()
                    {
                        inn             = inn,
                        primarylinkedid = properties[Settings.Default.arasPrimaryLinkItemId].Value
                    };

                    AF.ShowDialog();
                    Updatelabels(properties, MyRibbon);

                    MyRibbon.CompleteTaskButton.Enabled = !String.IsNullOrEmpty(MyRibbon.WorkflowNameRibbonLabel.Label);
                }
            }
        }
Пример #2
0
        public void Refresh_ribbon(Core.DocumentProperties properties, OfficeConnectorExtensionAddinRibbon MyRibbon)
        {
            if ((inn = Connect_to_Aras(MyRibbon)) != null)
            {
                List <Core.DocumentProperty> propertylist = properties.Cast <Core.DocumentProperty>().ToList();
                bool PrimaryLinkItemIdexist = propertylist.Where(x => x.Name == Settings.Default.arasPrimaryLinkItemId).Any();
                if (PrimaryLinkItemIdexist)
                {
                    UpdateWorkFlowRibbonName(properties[Settings.Default.arasPrimaryLinkItemId].Value, MyRibbon.WorkflowNameRibbonLabel);
                    UpdateActivityRibbonName(properties[Settings.Default.arasPrimaryLinkItemId].Value, MyRibbon.ActivityRibbonLabel, MyRibbon.CompleteTaskButton);
                }
                bool DocumentIdexist = propertylist.Where(x => x.Name == Settings.Default.ArasDocumentId).Any();
                if (DocumentIdexist)
                {
                    UpdateLifeCycleRibbonName(properties[Settings.Default.ArasDocumentId].Value, MyRibbon.LifeCycleRibbonLabel);
                    UpdateStateRibbonName(properties[Settings.Default.ArasDocumentId].Value, MyRibbon.StateNameRibbonLabel);
                    UpdateNextStateComboBox(properties[Settings.Default.ArasDocumentId].Value, MyRibbon);
                }
                MyRibbon.PromoteButton.Enabled = !String.IsNullOrEmpty(MyRibbon.NextStateComboBox.Text);

                //MyRibbon.CompleteTaskButton.Enabled = !MyRibbon.WorkflowNameRibbonLabel.Label.Contains("Not Assigned");
            }
        }