internal void InitUCAllProducts(UCAllProducts uCAllProducts) { uCAllProducts.DgvProducts.DataSource = Communication.Communication.Instance.GetAllProducts(); uCAllProducts.DgvProducts.Columns["ProductId"].Visible = false; uCAllProducts.DgvProducts.Columns["Name"].HeaderText = "Naziv"; uCAllProducts.DgvProducts.Columns["PriceWithoutVAT"].HeaderText = "Cena"; uCAllProducts.DgvProducts.Columns["VAT"].HeaderText = "PDV"; uCAllProducts.DgvProducts.Columns["PriceWithVAT"].HeaderText = "Cena sa PDV-om"; uCAllProducts.DgvProducts.Columns["Currency"].HeaderText = "Valuta"; uCAllProducts.DgvProducts.Columns["Type"].HeaderText = "Tip"; uCAllProducts.DgvProducts.Columns["User"].HeaderText = "Radnik"; }
internal void Search(UCAllProducts uCAllProducts) { string text = uCAllProducts.TxtSearch.Text; Product product = new Product { Name = text }; List <Product> products = Communication.Communication.Instance.SearchProducts(product); uCAllProducts.DgvProducts.DataSource = products; if (products.Count == 0) { MessageBox.Show("Sistem ne može da nađe proizvode po zadatoj vrednosti!"); } }