/// <summary> /// Thêm Hóa đơn nhập chi tiết /// </summary> /// <param name="receiptId">Mã hóa đơn nhập</param> /// <param name="productId">Mã mặt hàng</param> /// <param name="quantityReceipt">Số lượng nhập</param> /// <param name="price">Thành tiền</param> /// <param name="total"></param> private void InsertReceiptDetails(string receiptId, string productId, int quantityReceipt, int price, int total) { var receiptDetail = new ReceiptDetail() { ReceiptID = receiptId, ProductID = productId, Quantity = quantityReceipt, Price = price, Active = true, Total = total, }; try { _receiptDetailService.Add(receiptDetail); } catch (SqlException ex) { messagebox.InnerHtml = string.Format("<div class='alert alert-danger'>" + "<strong>Lỗi!</strong> {0} .</div>", ex.Message); } catch (Exception ex) { messagebox.InnerHtml = string.Format("<div class='alert alert-danger'>" + "<strong>Lỗi!</strong> {0} .</div>", ex.Message); } }
/// <summary> /// Thêm Hóa đơn nhập chi tiết /// </summary> /// <param name="receiptId">Mã hóa đơn nhập</param> /// <param name="productId">Mã mặt hàng</param> /// <param name="quantity">Số lượng nhập</param> /// <param name="price">Thành tiền</param> /// <param name="total"></param> private void InsertReceiptDetails(string receiptId, string productId, int quantity, int price, int total) { var receiptDetail = new ReceiptDetail() { ReceiptID = receiptId, ProductID = productId, Quantity = quantity, Price = price, Active = true, Total = total, }; try { _receiptDetailService.Add(receiptDetail); } catch (SqlException ex) { MessageBoxHelper.ShowMessageBoxError(ex.Message); } catch (Exception ex) { MessageBoxHelper.ShowMessageBoxError(ex.Message); } }