public void finalBill()
        {
            int    totalBill       = 0;
            string discountPercent = null;
            int    discountAmount  = 0;
            int    discountBill    = 0;

            if (serviceCall.CustomerPurchasedProductDetails().Count == 0)
            {
                Console.WriteLine("Not Yet Purchased Anything");
            }
            else
            {
                Console.WriteLine("Your Total Bill");
                List <CustomerService.PurchaseProductDetail> finalBillDetails = serviceCall.FinalBillingForCustomer();
                foreach (CustomerService.PurchaseProductDetail bill in finalBillDetails)
                {
                    Console.WriteLine("PRODUCTID : {0} PRODUCTNAME : {1} (1QTY)PRICE : {2}  PRICEFORPURCHASED : {3}  QTY : {4}", bill.productID,
                                      bill.productName, (bill.price / bill.quantity), bill.price, bill.quantity);
                    totalBill       = bill.Total_Bill_Amount;
                    discountPercent = bill.Discount_Percentage;
                    discountAmount  = bill.Discounted_Amount;
                    discountBill    = bill.Discounted_Bill;
                }

                Console.WriteLine("Total Product Purchased : {0}", finalBillDetails.Count);
                Console.WriteLine("Your Total Bill is : {0}", totalBill);
                Console.WriteLine("Discount Percentage : {0}", discountPercent);
                Console.WriteLine("Discount Amount : {0}", discountAmount);
                Console.WriteLine("DisCounted Bill : {0}", discountBill);
            }
            BillingMainPage mainPage = new BillingMainPage();

            mainPage.startingPage();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            BillingMainPage billingMainPage = new BillingMainPage();

            billingMainPage.startingPage();
            Console.Read();
        }
        public void BillingDetails()
        {
            try
            {
                if (customerChoice.Equals("p"))
                {
                    Console.WriteLine("Enter the ProductID");
                    productID = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Enter The Quantity You Want To Purchase");
                    quantity = Convert.ToInt32(Console.ReadLine());

                    List <CustomerService.PurchaseProductDetail> customerPurchased = serviceCall.CurrentProductsPurchasedDetails(customerChoice, productID, quantity, customerName);

                    if (customerPurchased.Count > 0)
                    {
                        currentPurchasedBill();
                    }
                    else
                    {
                        Console.WriteLine("Product Not Avaialble");
                    }
                }

                if (customerChoice.Equals("*"))
                {
                    BillingMainPage mainPage = new BillingMainPage();
                    mainPage.startingPage();
                }
                if (customerChoice.Equals("#"))
                {
                    if (serviceCall.CustomerPurchasedProductDetails().Count == 0)
                    {
                        Console.WriteLine("Not Purchased AnyThing Please Purchase");
                    }
                    else
                    {
                        Console.WriteLine("Enter product Id Which u Purchased");
                        productID = Convert.ToInt32(Console.ReadLine());
                        List <CustomerService.PurchaseProductDetail> purchaseAfterDeleting = serviceCall.DeleteProductsFromCurrentBill(productID);
                        Console.WriteLine("CURRENT PURCHASED PRODUCT");
                        foreach (CustomerService.PurchaseProductDetail purchaseProductDeleting in purchaseAfterDeleting)
                        {
                            Console.WriteLine("PRODUCTID : {0} PRODUCTNAME : {1} PRICE : {2} AVAILABLEQTY : {3}", purchaseProductDeleting.productID,
                                              purchaseProductDeleting.productName, purchaseProductDeleting.price, purchaseProductDeleting.quantity);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                customerPurchaseSelection();
            }
            BalanceProductAvailable();
            customerPurchaseSelection();
        }
コード例 #4
0
        public void productAddition()
        {
            bool isProductAdded = false;

            try
            {
                Console.WriteLine("Enter '1' To Add Products");
                Console.WriteLine("Enter '0' to GOTO MainPage");
                adminChoice = Convert.ToInt32(Console.ReadLine());

                if (adminChoice == 1)
                {
                    Console.WriteLine("Enter productName To Add");
                    productDetails.productName = Console.ReadLine();
                    Console.WriteLine("Enter price To Add");
                    productDetails.price = Convert.ToDouble(Console.ReadLine());
                    Console.WriteLine("Enter Quantity To Add");
                    productDetails.quantity = Convert.ToInt32(Console.ReadLine());

                    string productAddingMessage = serviceCall.NewProductsAdditionToStore(productDetails);
                    if (productAddingMessage.Equals("Product Added SuccessFully"))
                    {
                        Console.WriteLine(productAddingMessage);
                        isProductAdded = true;
                    }
                }

                if (isProductAdded)
                {
                    serviceCall.DetailsOfNewProductAddition(userID, productDetails);
                }

                if (adminChoice == 0)
                {
                    BillingMainPage billingMainPage = new BillingMainPage();
                    billingMainPage.startingPage();
                }

                if (adminChoice != 0 && adminChoice != 1)
                {
                    Console.WriteLine("Choose The Correct Selection");
                    AdminCheck();
                }
                currentProducts();
                productAddition();
            }
            catch
            {
                Console.WriteLine("Enter the Correct Choice");
                productAddition();
            }
        }
コード例 #5
0
        public void AdminCheck()
        {
            try
            {
                Console.WriteLine("Enter '1' To Login");
                Console.WriteLine("Enter '0' to GOTO MainPage");
                adminChoice = Convert.ToInt32(Console.ReadLine());
                if (adminChoice == 1)
                {
                    Console.WriteLine("Enter Your UserID");
                    userID = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("Enter Your Password");
                    password = Console.ReadLine();
                    string accessGranted = serviceCall.UserValidation(userID, password);
                    if (accessGranted.Equals("YES"))
                    {
                        Console.WriteLine("LoggedIn Successfully");
                        Console.WriteLine("Products Available");
                        Console.WriteLine("\n");
                        List <AdminService.ProductDetail> productsAvailable = serviceCall.ProductsAvailableInStore();
                        foreach (AdminService.ProductDetail products in productsAvailable)
                        {
                            Console.WriteLine("PRODUCTID : {0} PRODUCTNAME : {1} PRICE : {2} AVAILABLEQTY : {3}", products.productID, products.productName,
                                              products.price, products.quantity);
                        }
                    }
                    else
                    {
                        Console.WriteLine("Enter Correct UserName And Password");
                        AdminCheck();
                    }
                }

                if (adminChoice == 0)
                {
                    BillingMainPage billingMainPage = new BillingMainPage();
                    billingMainPage.startingPage();
                }
                productAddition();
            }

            catch
            {
                Console.WriteLine("Enter Correct Choice");
                AdminCheck();
            }
        }