Esempio n. 1
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi = sender as MenuItem;

            if (mi != null)
            {
                if (mi.Name.Equals("Purchase_Order_Refresh_MenuItem"))
                {
                    RefreshPurchaseOrderList();
                }
                if (mi.Name.Equals("Purchase_Order_Part_Ordered_MenuItem"))
                {
                    Part part = Purchase_Order_DataGrid.SelectedValue as Part;
                    partOrderedWindow = new PartOrderedWindow(part, this);
                    partOrderedWindow.ShowDialog();
                }
                if (mi.Name.Equals("Purchase_Order_Copy_MenuItem"))
                {
                    if (targetedCopyCell != null)
                    {
                        Clipboard.SetText(((TextBlock)targetedCopyCell.Content).Text);
                    }
                }
            }
        }
Esempio n. 2
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi = sender as MenuItem;

            if (mi != null)
            {
                if (mi.Name.Equals("File_Refresh_All_MenuItem"))
                {
                    RefreshAllData();
                }
                if (mi.Name.Equals("File_Settings_MenuItem"))
                {
                    settingsWindow = new SettingsWindow();
                    settingsWindow.ShowDialog();
                }
                if (mi.Name.Equals("File_Logout_MenuItem"))
                {
                    LogoutUser();
                }
                if (mi.Name.Equals("File_Exit_MenuItem"))
                {
                    Close();
                }
                if (mi.Name.Equals("Stock_Parts_Ordered_MenuItem"))
                {
                    partOrderedWindow = new PartOrderedWindow(null, null);
                    partOrderedWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_New_Part_MenuItem") || mi.Name.Equals("Stock_List_New_Part_MenuItem"))
                {
                    newPartWindow = new NewPartWindow();
                    newPartWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_Return_Part_MenuItem"))
                {
                    returnPartWindow = new ReturnPartWindow(null);
                    returnPartWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_Purchase_Order_MenuItem"))
                {
                    purchaseOrderWindow = new PurchaseOrderWindow();
                    purchaseOrderWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_Statistics_MenuItem"))
                {
                    partsStatisticsWindow = new PartsStatisticsWindow();
                    partsStatisticsWindow.ShowDialog();
                }
                if (mi.Name.Equals("Job_New_Job_MenuItem") || mi.Name.Equals("Job_List_New_Job_MenuItem"))
                {
                    newJobWindow = new NewJobWindow();
                    newJobWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_List_Refresh_MenuItem"))
                {
                    mvm.RefreshStockPartList();
                    mvm.SearchStockPartList(Stock_List_Search_TextBox.Text);
                }
                if (mi.Name.Equals("Stock_List_Edit_Part_MenuItem"))
                {
                    Part part = Stock_List_DataGrid.SelectedValue as Part;
                    updatePartWindow = new UpdatePartWindow(part);
                    updatePartWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_List_Part_Ordered_MenuItem"))
                {
                    Part part = Stock_List_DataGrid.SelectedValue as Part;
                    partOrderedWindow = new PartOrderedWindow(part, null);
                    partOrderedWindow.ShowDialog();
                }
                if (mi.Name.Equals("Stock_List_Return_Part_MenuItem"))
                {
                    Part part = Stock_List_DataGrid.SelectedValue as Part;
                    returnPartWindow = new ReturnPartWindow(part);
                    returnPartWindow.ShowDialog();
                }
                if (mi.Name.Equals("Job_List_View_Job_MenuItem"))
                {
                    Job job = Job_List_DataGrid.SelectedValue as Job;
                    jobViewWindow = new JobViewWindow(job);
                    jobViewWindow.ShowDialog();
                }
                if (mi.Name.Equals("Job_List_Refresh_MenuItem"))
                {
                    mvm.RefreshJobList();
                }
                if (mi.Name.Equals("Job_List_Edit_Job_MenuItem"))
                {
                    Job job = Job_List_DataGrid.SelectedValue as Job;
                    updateJobWindow = new UpdateJobWindow(job);
                    updateJobWindow.ShowDialog();
                }
                if (mi.Name.Equals("Log_Refresh_MenuItem"))
                {
                    mvm.RefreshLogList(Log_Date_Picker);
                }
                if (mi.Name.Equals("Stock_List_Copy_MenuItem") || mi.Name.Equals("Job_List_Copy_MenuItem") ||
                    mi.Name.Equals("Log_Copy_MenuItem"))
                {
                    if (targetedCopyCell != null)
                    {
                        Clipboard.SetText(((TextBlock)targetedCopyCell.Content).Text);
                    }
                }
            }
        }