Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Customer customer = new Customer
            {
                CustomerID = 124,
                Name       = "sanjay ",
                CardNo     = 123456,
                Balance    = 100,
            };

            CustomerCollection repository = new CustomerCollection();
            List <Customer>    list       = repository.CustomersList();
            Banking            banking    = new Banking();

            banking.Customers = list;

            ATM atm = new ATM()
            {
                TotalAmount = 100.99
            };


            bool repeat = false;

            do
            {
                int option = (int)KeyboardHelper.ReadNumber("1. Withdraw 2. Deposite 3. Transactions");
                switch (option)
                {
                case 1:
                    KeyboardHelper.Status(banking.Withdraw(atm, customer));
                    repeat = true;
                    break;

                case 2:
                    KeyboardHelper.Status(banking.Deposit(atm, customer));
                    repeat = true;
                    break;

                case 3:
                    print(banking.ViewTransactions(customer));
                    repeat = true;
                    break;

                case 4:
                    KeyboardHelper.print(banking.Balance(customer));
                    repeat = true;
                    ;
                    break;

                case 5:
                    Console.WriteLine("Thank you for visiting us.");
                    repeat = false;
                    ;
                    break;
                }
                option = 0;
            } while (repeat);
        }
Exemplo n.º 2
0
        public ActionResult Deposit(DepositViewModel deposit)
        {
            deposit.Username = Session["username"].ToString();
            if (Banking.Deposit(deposit))
            {
                TempData["Msg"] = "🎉 Deposit Successful !!!";
                return(RedirectToAction("Main"));
            }

            TempData["Msg"] = "😢 Oops! Something went wrong please contact your Financial Institution";
            return(RedirectToAction("Main"));
        }
Exemplo n.º 3
0
        public override int OnLoop(IScriptEngine se)
        {
            var localPlayer = Players.LocalPlayer;

            if (localPlayer == null)
            {
                context.State = "Failed to find local player!";
                return(10_000);
            }

            if (!config.VaultArea.RealArea(Api).Contains(localPlayer.ThreadSafeLocation))
            {
                context.State = "Walking to vault...";

                var config = new PointPathFindConfig();
                config.ClusterName = this.config.VaultClusterName;
                config.UseWeb      = false;
                config.Point       = this.config.VaultDest.RealVector3();
                config.UseMount    = true;

                Movement.PathFindTo(config);
                return(0);
            }

            if (config.FleeOnLowHealth && localPlayer.HealthPercentage <= config.FleeHealthPercent)
            {
                return(1000);
            }

            if (!Banking.IsOpen)
            {
                context.State = "Opening vault...";

                var bank = Objects.BankChain.Closest(localPlayer.ThreadSafeLocation);
                if (bank == null)
                {
                    context.State = "Failed to find vault!";
                    return(5000);
                }

                bank.Click();
                Time.SleepUntil(() =>
                {
                    return(Banking.IsOpen);
                }, 4000);
            }

            if (Banking.IsOpen)
            {
                context.State = "FDepositing items...";

                var beginWeight = localPlayer.WeighedDownPercent;
                var allItems    = Inventory.GetItemsBySubstring("_ROCK", "_ORE", "_HIDE", "_WOOD", "_FIBER");
                var toDeposit   = new List <IItemStack>();
                foreach (var stack in allItems)
                {
                    if (!stack.UniqueName.Contains("JOURNAL"))
                    {
                        toDeposit.Add(stack);
                    }
                }

                if (toDeposit.Count == 0 || Banking.Deposit(toDeposit.ToArray()))
                {
                    if (localPlayer.TotalHoldWeight < 99)
                    {
                        if (config.RepairDest != null && Api.HasBrokenItems())
                        {
                            parent.EnterState("repair");
                        }
                        else
                        {
                            parent.EnterState("gather");
                        }
                        return(0);
                    }
                }
            }

            return(100);
        }