public void DeleteReceipt(int id) { ReceiptDetail receipt = FindReceipt(id); listReceiptDetail.Remove(receipt); IOMethod.Instance.EditData <ReceiptDetail>(path, listReceiptDetail); }
public ReceiptDetail FindReceipt(int idreceipt) { for (int i = 0; i < listReceiptDetail.Count; i++) { if (listReceiptDetail[i].idRecept == idreceipt) { return(listReceiptDetail[i]); } } ReceiptDetail receipt = new ReceiptDetail(); return(receipt); }
public void CreateReceiptDetailInfo(int idProduct, int qtyProduct) { if (listReceiptDetail.Count == 0) { ReceiptDetail.ID = 0; } else { ReceiptDetail.ID = listReceiptDetail[listReceiptDetail.Count - 1].idRecept; } int total = qtyProduct * menu_manage.FindProduct(idProduct).sellValue; ReceiptDetail receiptdetail = new ReceiptDetail(menu_manage.FindProduct(idProduct), qtyProduct, total); ReceiptDetail tempreceiptdetail = new ReceiptDetail((menu_manage.FindProduct(idProduct)), qtyProduct, total); IOMethod.Instance.WriteData <ReceiptDetail>(pathDetail, receiptdetail); listReceiptDetail.Add(receiptdetail); tempListReceiptDetail.Add(tempreceiptdetail); }