Example #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ListViewItem     wf = listView.SelectedItem as ListViewItem;
            ExistingWorkFlow ew = wf.Tag as ExistingWorkFlow;

            PartyCalculatorWebServiceWrapper.PartyCalculatorService.EndWorkflow(ew.WorkflowId);

            workflows.Remove(ew);
            listView.Items.Remove(wf);
            mainPage.Navigate(typeof(ExistingWorkFlow));
        }
Example #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var result = PartyCalculatorWebServiceWrapper.PartyCalculatorService.GetWorkFlows();

            if (result == null)
            {
                return;
            }

            workflows = new List <ExistingWorkFlow>();

            foreach (var item in result)
            {
                if (IsUserSame(item.Owner.ToServiceUser(), mainPage.Owner))
                {
                    var          w    = new ExistingWorkFlow(item.WorkflowId, item.Owner.ToServiceUser(), "Owner");
                    ListViewItem temp = new ListViewItem();
                    temp.Content = w.WorkflowId + " " + w.UserName.userName + " " + w.Role;
                    temp.Tag     = w;
                    workflows.Add(w);
                    listView.Items.Add(temp);
                }

                if (item.Participants == null)
                {
                    continue;
                }
                foreach (var subItem in item.Participants)
                {
                    var user = new user();
                    user.userName = subItem;
                    if (IsUserSame(user, mainPage.Owner))
                    {
                        var          w    = new ExistingWorkFlow(item.WorkflowId, user, "Participant");
                        ListViewItem temp = new ListViewItem();
                        temp.Content = w.WorkflowId + " " + w.UserName.userName + " " + w.Role;
                        temp.Tag     = w;
                        workflows.Add(w);
                    }
                }
            }
        }