public static void addHyperLinkAndProjects(List <ArticleModel> inv)
 {
     foreach (ArticleModel article in inv)
     {
         if (article.Supplier == "Mouser")
         {
             article.SupplierOrGoogleLink = "https://www.mouser.ch/Search/Refine?Keyword=" + article.SupplierPartNumber;
         }
         else if (article.Supplier == "Digi-Key")
         {
             article.SupplierOrGoogleLink = "https://www.digikey.com/products/en?keywords=" + article.SupplierPartNumber;
         }
         else if (article.Supplier == "Distrelec")
         {
             article.SupplierOrGoogleLink = "https://www.distrelec.ch/search?q=" + article.SupplierPartNumber;
         }
         else if (article.Manufacturer == "Mini-Circuits")
         {
             article.SupplierOrGoogleLink = "https://ww2.minicircuits.com/WebStore/modelSearch.html?model=" + article.ManufacturerPartNumber + "&search=1";
         }
         else
         {
             article.SupplierOrGoogleLink = "https://www.google.com/search?q=" + article.SupplierPartNumber + " " + article.ManufacturerPartNumber + " " + article.Supplier + " " + article.Manufacturer;
         }
         article.Project = Article_ProjectController.getProjects(article.ArticleID.ToString());
     }
 }
        private void DtGridInventarListe_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dtGridInventarListe.SelectedItem != null)
            {
                ArticleModel inv = (ArticleModel)dtGridInventarListe.SelectedItem;

                addupdate.txtArticleType.Text = inv.ArticleID.ToString();
                addupdate.txtDescription.Text = inv.Description;

                addupdate.txtManufacturer.Text           = inv.Manufacturer;
                addupdate.txtManufacturerPartNumber.Text = inv.ManufacturerPartNumber;
                addupdate.txtPricing.Text            = inv.Pricing.ToString();
                addupdate.txtLocation.Text           = inv.Location;
                addupdate.txtQuantity.Text           = inv.Quantity.ToString();
                addupdate.txtProjects.Text           = Article_ProjectController.getProjects(inv.ArticleID.ToString());
                addupdate.txtProjects.ToolTip        = Article_ProjectController.getProjects(inv.ArticleID.ToString()).Replace(",", "\n");
                addupdate.txtSupplier.Text           = inv.Supplier;
                addupdate.txtSupplierPartNumber.Text = inv.SupplierPartNumber;
                addupdate.cbxStatus.SelectedIndex    = 0;

                addupdate.btnAddArticle.Content = "Update";
                addupdate.itsAnUpdate           = true;

                addupdate.txtArticleType.IsReadOnly = true;
                addupdate.itsAnUpdate = true;
            }
        }
        public static void archivInsert(ArticleModel article)
        {
            SQLiteConnection con = new SQLiteConnection(InventoryDBSqliteConnection.LoadConnectionString());

            con.Open();
            string query = "INSERT INTO Archiv_Article( " +
                           "old_ArticleID, old_Description, " +
                           "old_Category, old_Pricing, " +
                           "old_Projects, " +
                           "old_SupplierPartNumber, " +
                           "old_ManufacturerPartNumber, " +
                           "old_Manufacturer, " +
                           "old_Supplier, " +
                           "old_Status," +
                           "old_Created, " +
                           "old_Deleted) " +
                           "VALUES(" +
                           "@old_ArticleID, @old_Description, " +
                           "@old_Category, @old_Pricing, " +
                           "@old_Projects, " +
                           "@old_SupplierPartNumber, " +
                           "@old_ManufacturerPartNumber, " +
                           "@old_Manufacturer, " +
                           "@old_Supplier, " +
                           "@old_Status," +
                           "@old_Created, " +
                           "@old_Deleted )";
            SQLiteCommand cmd = new SQLiteCommand(query, con);

            cmd.Parameters.AddWithValue("@old_ArticleID", article.ArticleID);
            cmd.Parameters.AddWithValue("@old_Description", article.Description);
            cmd.Parameters.AddWithValue("@old_Category", article.Category);
            cmd.Parameters.AddWithValue("@old_Pricing", article.Pricing);
            cmd.Parameters.AddWithValue("@old_Projects", Article_ProjectController.getProjects(article.ArticleID.ToString()));
            cmd.Parameters.AddWithValue("@old_SupplierPartNumber", article.SupplierPartNumber);
            cmd.Parameters.AddWithValue("@old_ManufacturerPartNumber", article.ManufacturerPartNumber);
            cmd.Parameters.AddWithValue("@old_Manufacturer", article.Manufacturer);
            cmd.Parameters.AddWithValue("@old_Supplier", article.Supplier);
            cmd.Parameters.AddWithValue("@old_Status", article.Status);
            cmd.Parameters.AddWithValue("@old_Created", article.Created);
            cmd.Parameters.AddWithValue("@old_Created", article.Created);
            cmd.Parameters.AddWithValue("@old_Deleted", DateTime.Now.ToString("dd/MM/yyyy"));
            cmd.ExecuteNonQuery();
            con.Close();
        }