public ActionResult MultipleCommand(string Command, string street, TableLayout mainTable)
 {
     switch (Command)
     {
         case "Select":
             return SelectCards(street, mainTable);
         case "Random":
             return RandomCards(street);
         case "Clear":
             return ClearCards(street);
         default:
             return PartialView("DeckSection", TableLayout.BuildViewModel());
     }
 }
 private static bool HasTurn(TableLayout table)
 {
     table.disableInputTurn = String.Empty;
     if (table.txtTurn.Length == 2)
     {
         table.disableClearTurn = table.disableInputRiver = String.Empty;
         table.disableClearFlop = table.disableClearHand = "disabled";
         return true;
     }
     table.disableClearTurn = "disabled";
     return false;
 }
 private static bool HasRiver(TableLayout table)
 {
     table.disableInputRiver = String.Empty;
     if (table.txtRiver.Length == 2)
     {
         table.disableClearRiver = String.Empty;
         table.disableClearTurn = "disabled";
         return true;
     }
     table.disableClearRiver = "disabled";
     return false;
 }
 private static bool HasHand(TableLayout table)
 {
     if (table.txtHand.Length == 4)
     {
         table.disableClearHand = String.Empty;
         return true;
     }
     table.disableClearHand = "disabled";
     return false;
 }
 private static bool HasFlop(TableLayout table)
 {
     if (table.txtFlop.Length == 6)
     {
         table.disableClearFlop = String.Empty;
         return true;
     }
     table.disableClearFlop = "disabled";
     return false;
 }
        private static void EnableDisableButtons(TableLayout table)
        {
            bool hasFlop = HasFlop(table);
            bool hasHand = HasHand(table);

            if (!hasFlop || !hasHand)
            {
                DisableTurn(table);
                DisableRiver(table);
            }
            else
            {
                if (!HasTurn(table))
                {
                    DisableRiver(table);
                }
                else
                {
                    HasRiver(table);
                }
            }
        }
 private static void DisableTurn(TableLayout table)
 {
     table.disableClearTurn = table.disableInputTurn = "disabled";
 }
 private static void DisableRiver(TableLayout table)
 {
     table.disableClearRiver = table.disableInputRiver = "disabled";
 }
        public static TableLayout BuildViewModel()
        {
            var newTable = new TableLayout();
            newTable.imgFlop1 = MySession.Current.Flop[0].Image;
            newTable.imgFlop2 = MySession.Current.Flop[1].Image;
            newTable.imgFlop3 = MySession.Current.Flop[2].Image;
            newTable.imgTurn = MySession.Current.Turn[0].Image;
            newTable.imgRiver = MySession.Current.River[0].Image;
            newTable.imgHand1 = MySession.Current.Hand[0].Image;
            newTable.imgHand2 = MySession.Current.Hand[1].Image;

            newTable.txtFlop = MySession.Current.Flop[0].cardValue + MySession.Current.Flop[1].cardValue + MySession.Current.Flop[2].cardValue;
            newTable.txtTurn = MySession.Current.Turn[0].cardValue;
            newTable.txtRiver = MySession.Current.River[0].cardValue;
            newTable.txtHand = MySession.Current.Hand[0].cardValue + MySession.Current.Hand[1].cardValue;

            Hand.SetBestHandAndOuts();
            newTable.bestHand = MySession.Current.BestHand;
            newTable.listOuts = MySession.Current.listOuts;

            EnableDisableButtons(newTable);

            return newTable;
        }
 // GET: Odds
 public ActionResult Index()
 {
     var mainTable = new TableLayout();
     return View("Odds", mainTable);
 }
        private ActionResult SelectCards(string street, TableLayout mainTable)
        {
            switch (street)
            {
                case "H":
                    Operations.SelectNewCards(mainTable.txtHand, MySession.Current.Hand);
                    break;

                case "F":
                    Operations.SelectNewCards(mainTable.txtFlop, MySession.Current.Flop);
                    break;

                case "T":
                    Operations.SelectNewCards(mainTable.txtTurn, MySession.Current.Turn);
                    break;

                case "R":
                    Operations.SelectNewCards(mainTable.txtRiver, MySession.Current.River);
                    break;

                default:
                    break;
            }

            return ReturnMultipartial(new MultipartialResult(this));
        }