// chi cho sua ten nguoi phat hanh hoa don public static void updateInvoice(Invoice invinfo) { int inv_index = MyInvoice.find_InvIndex(invinfo.invNo); MyInvoice.myinv[inv_index].invNo = invinfo.invNo; MyInvoice.myinv[inv_index].invType = invinfo.invType; MyInvoice.myinv[inv_index].invTotalAmount = invinfo.invTotalAmount; MyInvoice.myinv[inv_index].issueDate = invinfo.issueDate; MyInvoice.myinv[inv_index].invStatus = invinfo.invStatus; MyInvoice.myinv[inv_index].Issuer = invinfo.Issuer; Invoicerw.Invoiceupdate(invinfo, inv_index); }
public static void deleteInvoice(Invoice invinfo) { int inv_index = MyInvoice.find_InvIndex(invinfo.invNo); List <int> invdtl_index = MyInvoice.find_InvdtlIndex(invinfo.invNo); for (int i = 0; i < invdtl_index.Count; i++) { MyInvoice.myinvdt.Remove(MyInvoice.myinvdt[invdtl_index[i]]); } MyInvoice.myinv.Remove(MyInvoice.myinv[inv_index]); Invoicerw.Invoicedtldelete(invdtl_index); Invoicerw.Invoicedelete(inv_index); }