private void Connections_OnSelectedRowsChanged()
 {
     SelectedRange[] selected = Connections.GetSelectedRows();
     if (selected.Length > 0)
     {
         // Set the selected contact in the grid
         Connection connection = (Connection)Connections.GetItem(selected[0].FromRow.Value);
         SelectedConnection.SetValue(connection);
     }
 }
Example #2
0
        private void Contacts_OnSelectedRowsChanged()
        {
            List <int> selectedRows = DataViewBase.RangesToRows(Contacts.GetSelectedRows());

            if (selectedRows.Count == 1)
            {
                AllowOpen.SetValue(true);
            }
            else
            {
                AllowOpen.SetValue(false);
            }
        }
Example #3
0
        public void DeleteSelectedCommand()
        {
            List <int> selectedRows = DataViewBase.RangesToRows(Connections.GetSelectedRows());

            if (selectedRows.Count == 0)
            {
                return;
            }

            Utility.ConfirmDialog(
                String.Format(ResourceStrings.ConfirmDeleteSelectedConnection, selectedRows.Count),
                delegate()
            {
                List <Entity> itemsToRemove = new List <Entity>();
                foreach (int row in selectedRows)
                {
                    itemsToRemove.Add((Entity)Connections.GetItem(row));
                }
                try
                {
                    foreach (Entity item in itemsToRemove)
                    {
                        OrganizationServiceProxy.Delete_(item.LogicalName, new Guid(item.Id));
                    }
                }
                catch (Exception ex)
                {
                    ErrorMessage.SetValue(ex.ToString());
                }
                Connections.RaiseOnSelectedRowsChanged(null);
                Connections.Reset();
                Connections.Refresh();
            }, null);
        }
Example #4
0
        void jobsViewModel_OnSelectedRowsChanged()
        {
            // Get the selected bulk delete
            SelectedRange[] selectedRows = JobsViewModel.GetSelectedRows();
            if (selectedRows.Length > 0)
            {
                ScheduledJob job = SelectedJob.GetValue();

                dev1_ScheduledJob item = (dev1_ScheduledJob)JobsViewModel.GetItem(selectedRows[0].FromRow.Value);

                job.RecurrancePattern.SetValue(item.dev1_RecurrancePattern);
                RecurrancePatternMapper.DeSerialise(job, item.dev1_RecurrancePattern);
                job.ScheduledJobId.SetValue(item.dev1_ScheduledJobId);
                job.Name.SetValue(item.dev1_Name);
                job.StartDate.SetValue(item.dev1_StartDate);
                job.RecurrancePattern.SetValue(item.dev1_RecurrancePattern);

                EntityReference entityName = new EntityReference(null, null, item.dev1_WorkflowName);

                job.WorkflowId.SetValue(entityName);

                // Update the dependant data grid
                string fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' returntotalrecordcount='true' no-lock='true' distinct='false' count='{0}' paging-cookie='{1}' page='{2}'>
                            <entity name='bulkdeleteoperation'>
                            <attribute name='name' />
                            <attribute name='createdon' />
                            <attribute name='asyncoperationid' />
                            <filter type='and'>
                            <condition attribute='name' operator='like' value='%" + item.dev1_ScheduledJobId.Value + @"%' />
                            </filter>
                            <link-entity name='asyncoperation' to='asyncoperationid' from='asyncoperationid' link-type='inner' alias='a0'>
                            <attribute name='postponeuntil' alias='asyncoperation_postponeuntil' />
                            <attribute name='statecode' alias='asyncoperation_statecode' />
                            <attribute name='statuscode'  alias='asyncoperation_statuscode' />
                            <attribute name='recurrencepattern'  alias='asyncoperation_recurrencepattern' />
                            </link-entity>{3}
                            </entity>
                            </fetch>";

                bulkDeleteJobsViewModel.FetchXml = fetchXml;
                bulkDeleteJobsViewModel.Reset();
                bulkDeleteJobsViewModel.Refresh();
            }
        }
 public void OnSelectedRowsChanged()
 {
     SelectedRange[] selectedContacts = Contacts.GetSelectedRows();
     if (selectedContacts.Length > 0)
     {
         SelectedContact.GetValue().SetValue((Contact)Contacts.GetItem(selectedContacts[0].FromRow.Value));
     }
     else
     {
         SelectedContact.GetValue().SetValue(null);
     }
 }
Example #6
0
        private void OnSelectedRowsChanged()
        {
            SelectedRange[] selectedContacts = Lines.GetSelectedRows();
            if (selectedContacts.Length > 0)
            {
                ObservableQuoteDetail observableQuoteDetail = SelectedQuoteDetail.GetValue();
                if (observableQuoteDetail.InnerQuoteDetail != null)
                {
                    observableQuoteDetail.InnerQuoteDetail.PropertyChanged -= quote_PropertyChanged;
                }

                QuoteDetail selectedQuoteDetail = (QuoteDetail)Lines.GetItem(selectedContacts[0].FromRow.Value);
                if (selectedQuoteDetail != null)
                {
                    selectedQuoteDetail.PropertyChanged += quote_PropertyChanged;
                }

                SelectedQuoteDetail.GetValue().SetValue(selectedQuoteDetail);
            }
            else
            {
                SelectedQuoteDetail.GetValue().SetValue(null);
            }
        }