public static string GenerateInvoiceNumber() { Repository repository = new Repository(); string randomGeneratedInvoiceNo = string.Empty; string newInvoiceNo = string.Empty; var listOfInvoicesNumbers = repository.GetInvoiceNumbers(); randomGeneratedInvoiceNo = RandomGeneratedInvoiceNumber(); if (listOfInvoicesNumbers.Count == 0) { randomGeneratedInvoiceNo = RandomGeneratedInvoiceNumber(); newInvoiceNo = randomGeneratedInvoiceNo; } else { foreach (var invoiceNos in listOfInvoicesNumbers) { if (randomGeneratedInvoiceNo == invoiceNos) { randomGeneratedInvoiceNo = RandomGeneratedInvoiceNumber(); newInvoiceNo = randomGeneratedInvoiceNo; } else { newInvoiceNo = randomGeneratedInvoiceNo; } } } return "INV" + newInvoiceNo; }
public CustomerLogic() { _repo = new Repository(); }
public SalesLogic() { this._repo = new Repository(); }
public InventoryLogic() { this._repo = new Repository(); }
public OrderLogic() { this._repo = new Repository(); }
public POSLogic() { this._repo = new Repository(); }
public InvoiceLogic() { this._repo = new Repository(); }
public InventoryUnitTest() { this._repo = new Repository(); this._inventoryLogic = new InventoryLogic(); }