private void ShowButton_Click(object sender, EventArgs e) { ProductsListView.Text = string.Empty; foreach (var product in PrdouctController.Read()) { ProductsListView.Text += product.Id + " . " + product.Name + " / " + product.CategoryName + " / " + product.Price + " / " + product.time.ToShortDateString() + "\r\n"; } }
private void AddButton_Click(object sender, EventArgs e) { var name = prodcutName.Text; var price = int.Parse(ProductPrice.Text); var cateName = CategorySelecter.SelectedItem.ToString(); var date = dateTimePicker1.Value; PrdouctController.Create(name, price, cateName, date); }