Ejemplo n.º 1
0
        private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //they selected a person - close the dialog and populate the edit fields on the parent form

            PersonDTO item = (sender as ListView).SelectedValue as PersonDTO;

            if (item != null)
            {
                if (customerParentWnd != null)
                {
                    customerParentWnd.AddPersonSelection(item);
                    customerParentWnd = null;
                }
                else if (vendorParentWnd != null)
                {
                    vendorParentWnd.AddPersonSelection(item);
                    vendorParentWnd = null;
                }
                else if (workOrderParentWnd != null)
                {
                    workOrderParentWnd.AddPersonSelection(item);
                    workOrderParentWnd = null;
                }
            }

            this.Close();
        }
Ejemplo n.º 2
0
        public ArrangementPage(AddArrangementRequest arrangementRequest)
        {
            InitializeComponent();

            currentArrangement = arrangementRequest;

            GetUsers();

            ObservableCollection <KeyValuePair <long, string> > list2 = new ObservableCollection <KeyValuePair <long, string> >();

            list2.Add(new KeyValuePair <long, string>(0, "180"));
            list2.Add(new KeyValuePair <long, string>(1, "360"));

            Style.ItemsSource = list2;

            containers.Add(new KeyValuePair <long, string>(1, "New container"));

            Container.ItemsSource = containers;

            MainWindow wnd = Application.Current.MainWindow as MainWindow;

            if (wnd.PageIsOnStack(typeof(WorkOrderPage)))
            {
                WorkOrderPage wo = (WorkOrderPage)wnd.GetPageFromStack(typeof(WorkOrderPage));

                if (wo != null)
                {
                    currentArrangement.Arrangement.WorkOrderId = wo.CurrentWorkOrderId;

                    Customer = wo.Customer;

                    if (Customer != null && Customer.person_id != 0)
                    {
                        LoadCustomerContainers(Customer.person_id);
                    }
                }
            }

            ObservableCollection <WorkOrderViewModel> list3 = new ObservableCollection <WorkOrderViewModel>();

            arrangementInventoryList = currentArrangement.ArrangementInventory;
            notInInventory           = currentArrangement.NotInInventory;

            ArrangementInventoryListView.ItemsSource = new ObservableCollection <WorkOrderViewModel>();

            ReloadListData();
        }
Ejemplo n.º 3
0
        private void WorkOrdersButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow wnd = Window.GetWindow(this) as MainWindow;

            wnd.NavigationStack.Push(this);
            WorkOrderPage workOrderPage = new WorkOrderPage();

            wnd.NavigationStack.Push(workOrderPage);
            wnd.ButtonContent.Content = new Frame()
            {
                Content = new ButtonPage(), Visibility = Visibility.Visible
            };
            wnd.MainContent.Content = new Frame()
            {
                Content = workOrderPage
            };
        }
        private void EditWorkOrder_Click(object sender, RoutedEventArgs e)
        {
            Button b = sender as Button;

            if (b != null)
            {
                //the button's command parmeter is a WoorkOrderResponse object
                WorkOrderResponse response = (WorkOrderResponse)b.CommandParameter;

                if (response != null)
                {
                    //navigate to the Work Order page and load this selection
                    MainWindow    wnd           = Application.Current.MainWindow as MainWindow;
                    WorkOrderPage workOrderPage = new WorkOrderPage(response);
                    wnd.NavigationStack.Push(workOrderPage);
                    wnd.MainContent.Content = new Frame()
                    {
                        Content = workOrderPage
                    };
                }
            }
        }