private void Btn_Parts_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            viewParts            = new ViewParts();
            viewParts.RoleType   = RoleType;
            viewParts.Department = Department;

            if (RoleType == "SalesMan" || RoleType == "Mechanic" || RoleType == "Surbordinate")
            {
                viewParts.can_Delete.Visibility = Visibility.Collapsed;
                _mainFrame.Navigate(viewParts);
            }

            else
            {
                _mainFrame.Navigate(viewParts);
            }
        }
Пример #2
0
        private void Can_AddParts_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            viewparts = new ViewParts();
            addparts  = new AddParts();

            viewparts.Parts_page = null;
            DependencyObject currParent = VisualTreeHelper.GetParent(this);

            while (currParent != null && viewparts.Parts_page == null)
            {
                viewparts.Parts_page = currParent as Frame;
                currParent           = VisualTreeHelper.GetParent(currParent);
            }

            if (viewparts.Parts_page != null)
            {
                viewparts.Parts_page.Source = new Uri("AddParts.xaml", UriKind.Relative);
            }
        }