Imagara 3 éve
szülő
commit
47599383e5

+ 6 - 0
PartsWarehouse/EDM.edmx

@@ -20,11 +20,13 @@
           </Key>
           <Property Name="IdPart" Type="int" Nullable="false" />
           <Property Name="IdCar" Type="int" Nullable="false" />
+          <Property Name="PartNum" Type="int" Nullable="false" />
           <Property Name="Type" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Name" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Model" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Manufacturer" Type="nvarchar" MaxLength="50" Nullable="false" />
           <Property Name="Description" Type="nvarchar" MaxLength="50" Nullable="false" />
+          <Property Name="Original" Type="nvarchar" MaxLength="15" Nullable="false" />
           <Property Name="Image" Type="varbinary(max)" Nullable="false" />
           <Property Name="Remain" Type="int" Nullable="false" />
           <Property Name="Price" Type="float" Nullable="false" />
@@ -160,6 +162,8 @@
           <Property Name="Remain" Type="Int32" Nullable="false" />
           <Property Name="Price" Type="Double" Nullable="false" />
           <NavigationProperty Name="Car" Relationship="PartsWarehouseDataBaseModel.FK_Parts_Car" FromRole="Parts" ToRole="Car" />
+          <Property Name="PartNum" Type="Int32" Nullable="false" />
+          <Property Name="Original" Type="String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" />
         </EntityType>
         <EntityType Name="sysdiagrams">
           <Key>
@@ -246,6 +250,8 @@
           <EntitySetMapping Name="Parts">
             <EntityTypeMapping TypeName="PartsWarehouseDataBaseModel.Parts">
               <MappingFragment StoreEntitySet="Parts">
+                <ScalarProperty Name="Original" ColumnName="Original" />
+                <ScalarProperty Name="PartNum" ColumnName="PartNum" />
                 <ScalarProperty Name="Price" ColumnName="Price" />
                 <ScalarProperty Name="Remain" ColumnName="Remain" />
                 <ScalarProperty Name="Image" ColumnName="Image" />

+ 6 - 5
PartsWarehouse/MainWindow.xaml

@@ -67,19 +67,20 @@
 
             <StackPanel Background="#292b2f" 
                         Grid.Column="0">
-                <TextBox Height="30"
+                <TextBox Name="VinBox"
+                         Height="30"
                          Margin="5"
                          Text="Vin...">
-                    
                 </TextBox>
                 <Button Height="30"
                         Margin="5"
-                        Content="Поиск">
-                    
+                        Content="Поиск"
+                        Click="FindWithVin">
                 </Button>
                 <Button Height="30"
                         Margin="5"
-                        Content="Каталог">
+                        Content="Каталог"
+                        Click="CatalogButton">
 
                 </Button>
                 <Button Height="30"

+ 26 - 0
PartsWarehouse/MainWindow.xaml.cs

@@ -51,5 +51,31 @@ namespace PartsWarehouse
         {
             MainFrame.Content = new ProfilePage();
         }
+
+        private void CatalogButton(object sender, RoutedEventArgs e)
+        {
+            MainFrame.Content = new СatalogPage();
+        }
+
+        private void FindWithVin(object sender, RoutedEventArgs e)
+        {
+            try
+            {
+                if (cnt.db.UserCar.Select(item => item.Vin).Contains(Convert.ToInt32(VinBox.Text)))
+                {
+                    int vin = Convert.ToInt32(VinBox.Text);
+                    Car car = cnt.db.Car.Where(item => item.IdCar == cnt.db.UserCar.Where(uc => uc.Vin == vin).Select(uc => uc.IdCar).FirstOrDefault()).FirstOrDefault();
+                    MainFrame.Content = new СatalogPage(car.Company, car.Name, car.Generation);
+                    new ErrorWindow((car.Company, car.Name, car.Generation).ToString()).ShowDialog();
+                }
+                else
+                    new ErrorWindow("Ничего не найдено.").ShowDialog();
+            }
+            catch
+            {
+
+            }
+
+        }
     }
 }

+ 2 - 0
PartsWarehouse/Parts.cs

@@ -24,6 +24,8 @@ namespace PartsWarehouse
         public byte[] Image { get; set; }
         public int Remain { get; set; }
         public double Price { get; set; }
+        public int PartNum { get; set; }
+        public string Original { get; set; }
     
         public virtual Car Car { get; set; }
     }

+ 0 - 46
PartsWarehouse/PartsPage.xaml

@@ -1,46 +0,0 @@
-<Page x:Class="PartsWarehouse.PartsPage"
-      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-      xmlns:local="clr-namespace:PartsWarehouse"
-      mc:Ignorable="d" 
-      d:DesignHeight="421"
-      d:DesignWidth="634">
-
-    <Grid Background="#32353B">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="32*"/>
-            <RowDefinition Height="389*"/>
-        </Grid.RowDefinitions>
-
-        <Grid Grid.Row="0"
-              Background="#36393F">
-            <StackPanel Orientation="Horizontal">
-                <Label Name="ChatName"
-                   Content="ZZZZZZ" 
-                   Foreground="{StaticResource TextColor}"
-                   FontSize="14"/>
-                <Button Width="15" 
-                        Height="15">
-                    <Image Source="Resources\NotFound.png"></Image>
-                </Button>
-                <Button Width="15" 
-                        Height="15">
-                    <Image Source="Resources\NotFound.png"></Image>
-                </Button>
-            </StackPanel>
-
-        </Grid>
-
-        <Grid Grid.Row="1" Margin="0,0,0,47">
-            <ListBox Name="MessageListBox" 
-                     Background="#32353B"
-                     BorderBrush="#32353B">
-                <ScrollViewer Name="scroll"
-                              VerticalScrollBarVisibility="Visible">
-                </ScrollViewer>
-            </ListBox>
-        </Grid>
-    </Grid>
-</Page>

+ 0 - 28
PartsWarehouse/PartsPage.xaml.cs

@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace PartsWarehouse
-{
-    /// <summary>
-    /// Логика взаимодействия для PartsPage.xaml
-    /// </summary>
-    public partial class PartsPage : Page
-    {
-        public PartsPage()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 0 - 7
PartsWarehouse/PartsWarehouse.csproj

@@ -98,9 +98,6 @@
     <Compile Include="Parts.cs">
       <DependentUpon>EDM.tt</DependentUpon>
     </Compile>
-    <Compile Include="PartsPage.xaml.cs">
-      <DependentUpon>PartsPage.xaml</DependentUpon>
-    </Compile>
     <Compile Include="ProfilePage.xaml.cs">
       <DependentUpon>ProfilePage.xaml</DependentUpon>
     </Compile>
@@ -145,10 +142,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="PartsPage.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="ProfilePage.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 34 - 1
PartsWarehouse/ProfilePage.xaml

@@ -36,7 +36,6 @@
                                      Text="UserLogin"
                                      Margin="3,-5,0,0"
                                      Height="30"
-                                     Foreground="{StaticResource TextColor}" 
                                      BorderBrush="{x:Null}"
                                      SelectionBrush="{x:Null}"
                                      Background="{x:Null}"/>
@@ -75,6 +74,40 @@
 
                 </StackPanel>
             </Grid>
+
+            <ListBox Name="CarsListBox"
+                         Grid.Row="1"
+                         Margin="20"
+                     Background="#32353B"
+                     BorderBrush="#32353B">
+                <ScrollViewer Name="scroll"
+                              VerticalScrollBarVisibility="Visible">
+                </ScrollViewer>
+                <Grid Margin="10,0,10,0"
+                      Height="35"
+                      Width="480"
+                      Background="#FF44464D">
+                    <Label Margin="5"
+                           HorizontalAlignment="Left"
+                           Content="Manufacturer Name 1">
+                    </Label>
+                </Grid>
+                <Grid Margin="10,0,10,0"
+                      Height="35"
+                      Width="480"
+                      Background="#FF44464D">
+                <Button Width="35"
+                        Height="35"
+                        Content="+"
+                        FontSize="16"
+                        FontWeight="Black"
+                        Click="AddNewCar">
+                </Button>
+                    
+                </Grid>
+                
+            </ListBox>
+
         </Grid>
     </Grid>
 </Page>

+ 63 - 3
PartsWarehouse/ProfilePage.xaml.cs

@@ -15,14 +15,74 @@ using System.Windows.Shapes;
 
 namespace PartsWarehouse
 {
-    /// <summary>
-    /// Логика взаимодействия для ProfilePage.xaml
-    /// </summary>
     public partial class ProfilePage : Page
     {
         public ProfilePage()
         {
             InitializeComponent();
+            LoadingCars();
+        }
+        private void LoadingCars()
+        {
+            CarsListBox.Items.Clear();
+            foreach (UserCar uc in cnt.db.UserCar.Where(item => item.IdUser == Session.userId).ToList())
+            {
+                try
+                {
+                    AddCar(uc.Car.Company, uc.Car.Name, uc.Car.Generation, uc.Vin);
+                }
+                catch (Exception ex)
+                {
+                    new ErrorWindow(ex.ToString()).ShowDialog();
+                }
+            }
+
+
+            try
+            {
+                Grid addCarGrid = new Grid();
+                addCarGrid.Height = 35;
+                addCarGrid.Width = 485;
+                addCarGrid.Margin = new Thickness(10, 0, 10, 0);
+
+                Button addCarButton = new Button();
+                addCarButton.Width = 35;
+                addCarButton.Height = 35;
+                addCarButton.FontSize=16;
+                addCarButton.Content = "+";
+                addCarButton.FontWeight = FontWeights.Black;
+                addCarButton.Click += AddNewCar;
+
+                CarsListBox.Items.Add(addCarGrid);
+            }
+            catch (Exception ex)
+            {
+                new ErrorWindow(ex.ToString()).ShowDialog();
+            }
+
+            scroll.ScrollToEnd();
+        }
+        private void AddNewCar(object sender, RoutedEventArgs e)
+        {
+
+        }
+        private void AddCar(string company, string name, int generation, int vin)
+        {
+            Grid messageGrid = new Grid();
+            messageGrid.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x44, 0x46, 0x4D));
+            messageGrid.Height = 35;
+            messageGrid.Width = 480;
+            messageGrid.Margin = new Thickness(10, 5, 10, 5);
+
+
+            Label carLabel = new Label();
+            carLabel.Content = company + " " + name + " " + generation + "gen." + " (vin: " + vin + ")";
+            carLabel.HorizontalAlignment = HorizontalAlignment.Left;
+            carLabel.Margin = new Thickness(5);
+
+            messageGrid.Children.Add(carLabel);
+
+            CarsListBox.Items.Add(messageGrid);
         }
     }
 }

+ 1 - 1
PartsWarehouse/Session.cs

@@ -2,7 +2,7 @@
 {
     public class Session
     {
-        public static int userId { get; set; }
+        public static int userId = 1; //{ get; set; }
         public static int carId { get; set; }
     }
 }

+ 24 - 2
PartsWarehouse/Styles/Style.xaml

@@ -1,14 +1,36 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     x:Class="PartsWarehouse.Style">
-    
-    
+
+
     <LinearGradientBrush x:Key="TextColor">
         <GradientStopCollection>
             <GradientStop Color="White" Offset="0"/>
         </GradientStopCollection>
     </LinearGradientBrush>
 
+    <Style TargetType="Label">
+        <Setter Property="Foreground" Value="White"/>
+    </Style>
+
+    <Style TargetType="TextBox">
+        <Setter Property="Foreground" Value="White"/>
+        <Setter Property="BorderBrush" Value="Black"/>
+        <Setter Property="Background" Value="#33363C"/>
+    </Style>
+
+    <Style TargetType="ComboBox">
+        <Setter Property="Foreground" Value="White"/>
+        <Setter Property="BorderBrush" Value="Black"/>
+        <Setter Property="Background" Value="#33363C"/>
+    </Style>
+    
+    
+    <Style TargetType="ComboBoxItem">
+        <Setter Property="Background" Value="#33363C"/>
+        <Setter Property="BorderBrush" Value="Black"/>
+    </Style>
+
 
     <Style TargetType="Button">
         <Setter Property="Template">

+ 71 - 51
PartsWarehouse/СatalogPage.xaml

@@ -14,7 +14,9 @@
             <RowDefinition Height="4*"/>
         </Grid.RowDefinitions>
 
-        <Border CornerRadius="15" Background="#2F3136" Margin="5">
+        <Border CornerRadius="15" 
+                Background="#2F3136" 
+                Margin="5">
             <Grid Grid.Row="0">
                 <Grid.RowDefinitions>
                     <RowDefinition/>
@@ -24,59 +26,74 @@
                 <StackPanel Orientation="Horizontal"
                             Grid.Row="0"
                             HorizontalAlignment="Center">
-                    <ComboBox Name="CarCompanyCombo"
-                              Margin="5"
-                              Width="120"
-                              Text="Марка">
-
-                    </ComboBox>
-
-                    <ComboBox Name="CarNameCombo"
-                      Margin="5"
-                      Width="120">
-
-                    </ComboBox>
-                    
-                    <ComboBox Name="CarGenerationCombo"
-                      Margin="5"
-                      Width="120">
-
-                    </ComboBox>
-
-                    <ComboBox Name="PartTypeCombo"
-                      Margin="5"
-                      Width="120">
-
-                    </ComboBox>
+                    <TextBox Name="CarCompanyBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Марка"
+                             PreviewMouseLeftButtonUp="CarCompanyBox_PreviewMouseLeftButtonUp"
+                             LostFocus="CarCompanyBox_LostFocus">
+                    </TextBox>
+
+                    <TextBox Name="CarNameBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Название"
+                             PreviewMouseLeftButtonUp="CarNameBox_PreviewMouseLeftButtonUp"
+                             LostFocus="CarNameBox_LostFocus">
+                    </TextBox>
+
+                    <TextBox Name="CarGenerationBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Поколение"
+                             PreviewMouseLeftButtonUp="CarGenerationBox_PreviewMouseLeftButtonUp"
+                             LostFocus="CarGenerationBox_LostFocus">
+
+                    </TextBox>
+
+                    <TextBox Name="PartTypeBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Тип запчасти"
+                             PreviewMouseLeftButtonUp="PartTypeBox_PreviewMouseLeftButtonUp"
+                             LostFocus="PartTypeBox_LostFocus">
+
+                    </TextBox>
                 </StackPanel>
 
                 <StackPanel Orientation="Horizontal"
                             Grid.Row="1"
                             HorizontalAlignment="Center">
-                    <ComboBox Name="NameCombo"
+                    <TextBox Name="NameBox"
                               Margin="5"
                               Width="120"
-                              Text="Марка">
-
-                    </ComboBox>
-
-                    <ComboBox Name="ModelCombo"
-                      Margin="5"
-                      Width="120">
-
-                    </ComboBox>
-
-                    <ComboBox Name="OriginalCombo"
-                      Margin="5"
-                      Width="120">
-
-                    </ComboBox>
+                              Text="Название запчасти"
+                             PreviewMouseLeftButtonUp="NameBox_PreviewMouseLeftButtonUp"
+                             LostFocus="NameBox_LostFocus">
+
+                    </TextBox>
+
+                    <TextBox Name="ModelBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Модель"
+                             PreviewMouseLeftButtonUp="ModelBox_PreviewMouseLeftButtonUp"
+                             LostFocus="ModelBox_LostFocus">
+                    </TextBox>
+
+                    <TextBox Name="OriginalBox"
+                             Margin="5"
+                             Width="120"
+                             Text="Оригинал: Не важно"
+                             PreviewMouseLeftButtonUp="OriginalBox_PreviewMouseLeftButtonUp"
+                             LostFocus="OriginalBox_LostFocus">
+                    </TextBox>
 
                     <Button Name="FindPartButton"
                             Margin="5"
                             Width="120"
-                            Content="Поиск">
-
+                            Content="Поиск"
+                            Click="FindPartButton_Click">
                     </Button>
 
                 </StackPanel>
@@ -84,17 +101,20 @@
             </Grid>
         </Border>
 
-        
-        <Grid Grid.Row="1">
-            
-        </Grid>
 
-        <!--<ComboBox Grid.RowSpan="2">
-            <ComboBox.ItemsPanel>
+        <ListBox Name="PartsListBox"
+                 Grid.Row="1" 
+                 Background="#2F3136">
+            <ScrollViewer VerticalScrollBarVisibility="Visible"/>
+
+        </ListBox>
+
+        <!--<TextBox Grid.RowSpan="2">
+            <TextBox.ItemsPanel>
                 <ItemsPanelTemplate>
                     <WrapPanel Orientation="Vertical" Height="100" />
                 </ItemsPanelTemplate>
-            </ComboBox.ItemsPanel>
+            </TextBox.ItemsPanel>
 
             <ComboBoxItem Content="Value 1" />
             <ComboBoxItem Content="Value 2" />
@@ -112,6 +132,6 @@
             <ComboBoxItem Content="Value 14" />
             <ComboBoxItem Content="Value 15" />
 
-        </ComboBox>-->
+        </TextBox>-->
     </Grid>
 </Page>

+ 138 - 5
PartsWarehouse/СatalogPage.xaml.cs

@@ -20,15 +20,148 @@ namespace PartsWarehouse
     /// </summary>
     public partial class СatalogPage : Page
     {
-        public СatalogPage(string carCompany = null, string carName = null, string carGeneration = null)
+        public СatalogPage(string carCompany = null, string carName = null, int carGeneration = -1)
         {
             InitializeComponent();
-            if(carCompany != null && carName != null)
+            if (carCompany != null && carName != null && carGeneration != -1)
             {
-                CarCompanyCombo.Text = carCompany;
-                CarNameCombo.Text = carName;
-                CarGenerationCombo.Text = carGeneration;
+                CarCompanyBox.Text = carCompany;
+                CarNameBox.Text = carName;
+                CarGenerationBox.Text = carGeneration.ToString();
             }
         }
+
+        private void CarCompanyBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            CarCompanyBox.Text = string.Empty;
+        }
+
+        private void CarCompanyBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            CarCompanyBox.Text = "Марка";
+        }
+
+        private void CarNameBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            CarNameBox.Text = string.Empty;
+        }
+
+        private void CarNameBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            CarNameBox.Text = "Название";
+        }
+
+        private void CarGenerationBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            CarGenerationBox.Text = string.Empty;
+        }
+
+        private void CarGenerationBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            CarGenerationBox.Text = "Поколение";
+        }
+
+        private void PartTypeBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            PartTypeBox.Text = string.Empty;
+        }
+
+        private void PartTypeBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            PartTypeBox.Text = "Тип запчасти";
+        }
+
+        private void NameBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            NameBox.Text = string.Empty;
+        }
+
+        private void NameBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            NameBox.Text = "Название запчасти";
+        }
+
+        private void ModelBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            ModelBox.Text = string.Empty;
+        }
+
+        private void ModelBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            ModelBox.Text = "Модель";
+        }
+
+        private void OriginalBox_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            OriginalBox.Text = string.Empty;
+        }
+
+        private void OriginalBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            OriginalBox.Text = "Оригинал: Не важно";
+        }
+
+        private void FindPartButton_Click(object sender, RoutedEventArgs e)
+        {
+            PartsUpdate();
+        }
+        private void PartsUpdate()
+        {
+            PartsListBox.Items.Clear();
+            foreach (Parts part in cnt.db.Parts.Where(item => item.Car.Company == CarCompanyBox.Text && item.Car.Name == CarNameBox.Text).ToList())
+            {
+                BitmapImage img = new BitmapImage();
+                if (part.Image != null)
+                    img = new BitmapImage(new Uri("../Resources/NotFound.png", UriKind.RelativeOrAbsolute));
+                //else
+                //    img = ImagesManip.NewImage(cnt.db.User.Where(item => item.Id == idAuthor).FirstOrDefault());
+                AddPart(part.Name, part.Description, part.PartNum, img);
+            }
+        }
+        private void AddPart(string name, string desc, int partNum, BitmapImage imageSource)
+        {
+            Grid partGrid = new Grid();
+            partGrid.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x40, 0x44, 0x4B));
+            partGrid.Height = 45;
+            partGrid.Width = 590;
+            partGrid.Margin = new Thickness(10, 5, 10, 5);
+
+            Image partImage = new Image();
+            partImage.Source = imageSource;
+            partImage.Width = 35;
+            partImage.Height = 35;
+            partImage.Margin = new Thickness(5);
+            partImage.HorizontalAlignment = HorizontalAlignment.Left;
+            partGrid.Children.Add(partImage);
+
+            StackPanel stackpanel = new StackPanel();
+            stackpanel.Orientation = Orientation.Horizontal;
+
+            Label partNameLabel = new Label();
+            partNameLabel.Content = name;
+            partNameLabel.Foreground = Brushes.White;
+            partNameLabel.FontWeight = FontWeights.Bold;
+            partNameLabel.HorizontalAlignment = HorizontalAlignment.Left;
+            partNameLabel.VerticalAlignment = VerticalAlignment.Top;
+            partNameLabel.Margin = new Thickness(40, 0, 0, 0);
+
+            Label dateLabel = new Label();
+            dateLabel.Content = partNum.ToString();
+            dateLabel.Foreground = Brushes.White;
+
+            stackpanel.Children.Add(partNameLabel);
+            stackpanel.Children.Add(dateLabel);
+            partGrid.Children.Add(stackpanel);
+
+            Label descLabel = new Label();
+            descLabel.Content = desc;
+            descLabel.Foreground = Brushes.White;
+            descLabel.HorizontalAlignment = HorizontalAlignment.Left;
+            descLabel.VerticalAlignment = VerticalAlignment.Bottom;
+            descLabel.Margin = new Thickness(40, 0, 0, 0);
+            partGrid.Children.Add(descLabel);
+
+            PartsListBox.Items.Add(partGrid);
+        }
     }
 }