public void showData() { var customers = OrderProductBLL.Search(pageIndex, pageSize, sortBy, sortOrder, keyword); dgCustomers.ItemsSource = customers.Items; pageCount = customers.PageCount; }
public IHttpActionResult PostOrderProduct(OrderProductDTO orderProduct) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } OrderProductDTO op = OrderProductBLL.Add(orderProduct); return(Ok(op)); }
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(); }
public IHttpActionResult GetOrderProduct(long id) { //{ // List<ShopProductsDTO> shop = ShopProductsBLL.GetShopProductsById(id); // if (shop == null) // { // return NotFound(); // } // return Ok(shop); //} List <OrderProductDTO> orderProducts = OrderProductBLL.GetOrderProductsById(id); //OrderProduct orderProduct = db.OrderProducts.Find(id); if (orderProducts == null) { return(NotFound()); } return(Ok(orderProducts)); }
void loadProductsOfOrder() { opDTO = new OrderProductDTO(orderId); opBLL = new OrderProductBLL(); ArrayList arr = opBLL.search(opDTO); dataGridView.Rows.Clear(); dataGridView.Refresh(); foreach (object o in arr) { OrderProductDTO orderDTO = (OrderProductDTO)o; ProductDTO DTO = new ProductDTO(orderDTO.PRODUCTID); productBLL = new ProductManagementBLL(); string productName = productBLL.prodIdToName(DTO); int a = dataGridView.Rows.Add(); dataGridView.Rows[a].Cells[0].Value = productName; dataGridView.Rows[a].Cells[1].Value = orderDTO.QUANTITY; dataGridView.Rows[a].Cells[2].Value = orderDTO.SIZE; } }