public ActionResult FindVoucherByCode()
        {
            List <BetData> bets = new List <BetData>();

            try
            {
                IBetDataRepository repository = new BetDataRepository();
                bets = repository.SelectVouchersByCode(Request["tbVoucherCode"]);
            }
            catch (Exception exc)
            {
                NeoException.Handle(exc);
            }

            return(PartialView("_VoucherByCodePartial", bets));
        }
        public ActionResult VouchersCashIn(List <BetData> bets)
        {
            foreach (BetData b in bets)
            {
                if (b.CashIn)
                {
                    Guid betGUID;
                    bool isGUID = Guid.TryParse(b.Guid.ToString(), out betGUID);

                    try
                    {
                        //najprej spremenimo status stave
                        IBetDataRepository repository = new BetDataRepository();

                        if (isGUID)
                        {
                            //ČE JE BET SKLENJEN DAMO STATUS NA PRVI UNOVČEN KUPON, DRUGAČE JE PRVI KUPON UNOVČEN IN DAMO STATUS NA DRUGI UNOVČEN KUPON
                            int newBetStatusID = Convert.ToInt32(b.BetStatusID) == 110 ? 112 : 113;
                            repository.VoucherUpdateStatusAndReference(betGUID, newBetStatusID, Request["tbReference"]);
                            b.BetStatusID       = newBetStatusID.ToEnum <BetStatus>();
                            b.Voucher1Reference = Request["tbReference"];

                            //ZAPIŠEMO HISTORY!!!
                            //NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV NI PRAV
                            //UPDATE: MALO MANJ NI PRAV AMPAK ZDAJ NE VEMO KATER AGENT JE AKTIVIRAL KUPON
                            new EventData(betGUID, newBetStatusID == 112 ? -1 : -2, 204).Add();
                        }

                        bets = repository.SelectVouchersByCode(b.Voucher1Code);
                    }
                    catch (Exception exc)
                    {
                        NeoException.Handle(exc);
                    }
                }
            }

            //IBetDataRepository repository2 = new BetDataRepository();
            //bets = repository2.SelectVouchersByCode(Request["hfVoucherCode"]);


            return(PartialView("_VoucherByCodePartial", bets));
        }