public List<products> getAllProducts() { List<products> products = new List<products>(); products product = new products(1, null, "test", null, null, "", 0, null); products.Add(product); return products; }
public billingItem(int billItemId, serviceProducts service, products product , int quantiy, decimal total, String type) { this.billItemId = billItemId; this.service = service; this.product = product; this.quantiy = quantiy; this.total = total; this.type = type; }
private void btnAddProduct_Click(object sender, EventArgs e) { String pCode = ((txtProductCode.Text).Replace(" ", string.Empty)).Clone().ToString(); String pName = ((txtProductName.Text).Replace(" ", string.Empty)).Clone().ToString(); String pPrice = ((txtProductPrc.Text).Replace(" ", string.Empty)).Clone().ToString(); itemCategory pCategory = ((KeyValuePair<itemCategory, string>)combProCat.SelectedItem).Key; if (pCode == "") { pcodeVerify.Show(); hideLabelsTimer(); } else if (pName == "") { pnameVerify.Show(); hideLabelsTimer(); } else if (pPrice == "") { ppriceVerify.Show(); hideLabelsTimer(); } else if (pCategory.ItemCategoryName == "Default") { cmbCatVerify.Show(); hideLabelsTimer(); } else { String proCode = (txtProductCode.Text).Clone().ToString(); String proName = (txtProductName.Text).Clone().ToString(); String proMake = (txtProductMake.Text).Clone().ToString(); String proModel = (txtProductModel.Text).Clone().ToString(); String proDescription = (txtProductDesc.Text).Clone().ToString(); String proPrice = (txtProductPrc.Text).Clone().ToString(); decimal convProdPrice = decimal.Parse(proPrice); itemCategory psCategory = ((KeyValuePair<itemCategory, string>)combProCat.SelectedItem).Key; products newProduct = new products(-1, proCode, proName, proMake, proModel, proDescription, convProdPrice, psCategory); stockDataManipulations stockDataManipulations = new stockDataManipulations(); Boolean productInsertionFlag = stockDataManipulations.addNewProduct(newProduct); if (productInsertionFlag) { productInsertionSuccessMsg.Show(); hideLabelsTimer(); } else { productInsertFailureMsg.Show(); hideLabelsTimer(); } } }
public Boolean addNewProduct(products category) { return true; }
private void itemDataBindings(List<products> products) { Dictionary<products, string> item = new Dictionary<products, string>(); products product = new products(-1, null, "Default", null, null, null, 0, null); item.Add(product, "Default"); foreach (products productItm in products) { item.Add(productItm, productItm.ProductName); } txtItem.DataSource = new BindingSource(item, null); txtItem.DisplayMember = "Value"; txtItem.ValueMember = "Key"; }