예제 #1
0
        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;
        }
예제 #2
0
 public CustomerLogic()
 {
     _repo = new Repository();
 }
예제 #3
0
 public SalesLogic()
 {
     this._repo = new Repository();
 }
예제 #4
0
 public InventoryLogic()
 {
     this._repo = new Repository();
 }
예제 #5
0
 public OrderLogic()
 {
     this._repo = new Repository();
 }
예제 #6
0
 public POSLogic()
 {
     this._repo = new Repository();
 }
예제 #7
0
 public InvoiceLogic()
 {
     this._repo = new Repository();
 }
예제 #8
0
 public InventoryUnitTest()
 {
     this._repo = new Repository();
     this._inventoryLogic = new InventoryLogic();
 }