void deleteProductOfOrder(string product) { ProductDTO DTO = new ProductDTO(1, product); productBLL = new ProductManagementBLL(); Int64 productID = productBLL.prodNameToID(DTO); OrderProductDTO opDTO = new OrderProductDTO(orderId, productID); opBLL = new OrderProductBLL(); opBLL.delete(opDTO); }
private void btnAdd_Click(object sender, EventArgs e) { string pname = cmbProduct.Text; string pcategory = cmbCategory.Text; string pQuantity = tbQuantity.Text; string pSize = cmbSize.Text; ProductDTO dto = new ProductDTO(0, pname, "", "", "", 1, pcategory); ////// To productBLL = new ProductManagementBLL(); /////////////////////////// Convert product name Int64 productID = productBLL.prodNameToID(dto); ///////////////////////////////////// to ID OrderProductDTO oDTO = new OrderProductDTO(orderId, productID, pQuantity, pSize); orderProductBLL = new OrderProductBLL(); orderProductBLL.insert(oDTO); ClearAllFields(); }