public bool ReportarError(ReportarErrorRequest request)
        {
            var error = new ReportarErrorModel
            {
                Description  = request.Mensaje,
                EmailAddress = request.Email,
                FirstName    = request.Nombre,
                LastName     = request.Apellido,
                Titulo       = request.Titulo,
                WebUrl       = request.WebUrl
            };

            var usuario = Uow.Usuarios.Obtener(u => u.Identifier == request.UsuarioIdentifier);
            var ticket  = new TicketError
            {
                EstadoTicketId = EstadoTicketEnum.Pendiente,
                Fecha          = DateTime.Now,
                Mensaje        = error.Description,
                UsuarioId      = usuario.UsuarioId,
                Origen         = OrigenTicketEnum.Desktop,
                Titulo         = error.Titulo,
                Email          = error.EmailAddress
            };

            try
            {
                var result = TicketErrorNegocio.ReportarError(error, ticket);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        public List <EmailResult> ReportarError(ReportarErrorModel model, TicketError ticket)
        {
            Uow.TicketErrores.Agregar(ticket);
            Uow.Commit();

            model.TicketErrorID = ticket.TicketErrorId;
            return(_notificationService.EnviarErrorPorMail(model));
        }
Exemple #3
0
        public async Task <ActionResult> ReportarError(ReportarErrorModel error)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(error));
            }

            try
            {
                error.FirstName = UsuarioActual.Usuario.Nombre;
                error.LastName  = UsuarioActual.Usuario.Apellido;
                error.WebUrl    = AppSettings.BaseURL;

                var ticket = new TicketError
                {
                    EstadoTicketId = EstadoTicketEnum.Pendiente,
                    Fecha          = DateTime.Now,
                    Mensaje        = error.Description,
                    UsuarioId      = UsuarioActual.Usuario.UsuarioId,
                    Origen         = OrigenTicketEnum.Web,
                    Titulo         = error.Titulo,
                    Email          = error.EmailAddress
                };
                var result = TicketErrorNegocio.ReportarError(error, ticket);
                if (result == null)
                {
                    return(PartialView("ReportarErrorFail"));
                }
            }
            catch (Exception ex)
            {
                EventLogger.Log(ex);
                return(PartialView("ReportarErrorFail"));
            }

            return(PartialView("ReportarErrorSuccess"));
        }
Exemple #4
0
        /// <summary>
        /// Eintrag aus Ticket löschen
        /// </summary>
        /// <param name="p"></param>



        public static void UpdateSystemOrCombiticket(bool reset, TicketStates ticketState, ref TipListInfo tipListInfo, ObservableCollection <TipItem> tipItems)
        {
            decimal oddVal         = 1;
            decimal multiWayOddVal = 1;
            int     minCombMax     = 0;
            int     bonusTipsCount = 0;

            Dictionary <int, List <TipItem> > tipItemDict = new Dictionary <int, List <TipItem> >();

            foreach (TipItem t in tipItems)
            {
                int iSvrMatchId = (int)t.Match.SvrMatchID;

                if (tipItemDict.ContainsKey(iSvrMatchId))
                {
                    tipItemDict[iSvrMatchId].Add(t);
                }
                else
                {
                    List <TipItem> list = new List <TipItem>();
                    list.Add(t);
                    tipItemDict.Add(iSvrMatchId, list);
                }
            }
            // de: Anzahl der Wege berechnen                // en: Number of ways to calculate
            // de: höchste Quote der Mehrwege finden        // en: highest rate of multipath are
            //
            int pathCount = 0;
            int rowCount  = 1;

            foreach (List <TipItem> list in tipItemDict.Values)
            {
                if (list.Count >= 1)
                {
                    decimal maxOdd = 1;
                    foreach (TipItem tip in list)
                    {
                        if (maxOdd < tip.Odd.Value)
                        {
                            maxOdd = tip.Odd.Value;
                        }
                    }
                    TipItem t = list[0];
                    if (t.IsBank || list.Count > 1)
                    {
                        pathCount++;
                        rowCount       *= list.Count;
                        multiWayOddVal *= maxOdd;
                    }
                    else
                    {
                        oddVal *= maxOdd;
                    }
                    int curCombMax = minCombinationOfAll(t);
                    if (curCombMax > minCombMax)
                    {
                        minCombMax = curCombMax;
                    }
                    if (list.Count == 1 && ticketState == TicketStates.Combi)
                    {
                        if (t.Odd.Value >= BonusFromOdd)
                        {
                            //Bonus gibt es nicht bei Mehrwegen
                            bonusTipsCount++;
                        }
                    }
                }
            }

            tipListInfo.MinCombination    = minCombMax;
            tipListInfo.NumOfTipps        = tipItemDict.Count;
            tipListInfo.PathCount         = pathCount;
            tipListInfo.RowCount          = rowCount;
            tipListInfo.MultiWayOddFactor = multiWayOddVal;

            if (tipItems.Count > 0 && tipItems[0] != null && tipItems[0].Match != null)
            {
                if (!tipItems[0].Match.IsLiveBet)
                {
                    //Use manipulationFee only on Sport Bet, not on Live Bet according to Harri 2010-02-22 GMU
                    tipListInfo.ManipulationFeePercentage =
                        LimitHandling.ManipulationFeePercentage(tipListInfo.NumOfTipps);
                    tipListInfo.BonusFactor = LimitHandling.CombiBetSuperBonus(bonusTipsCount);
                }
                else
                {
                    // ale 14.07.2011: use manipulationfee also on livebet
                    tipListInfo.ManipulationFeePercentage =
                        LimitHandling.ManipulationFeeLivebetPercentage(tipListInfo.NumOfTipps);
                    tipListInfo.BonusFactor = 1;
                }
            }
            else
            {
                tipListInfo.ManipulationFeePercentage = 0;
                tipListInfo.BonusFactor = 1;
            }
            switch (ticketState)
            {
            case TicketStates.Single:
                UpdateSingleticketItems(ref tipListInfo, tipItems);
                break;

            case TicketStates.Combi:
                tipListInfo.FullOddFactor = oddVal * multiWayOddVal * tipListInfo.BonusFactor;
                if (tipListInfo.FullOddFactor >= MaxOdd)
                {
                    tipListInfo.IsMaxOddBet = true;
                    if (tipListInfo.FullOddFactor > MaxOdd)
                    {
                        tipListInfo.IllegalOddFactor = tipListInfo.FullOddFactor;
                    }
                    tipListInfo.FullOddFactor = MaxOdd;
                    tipListInfo.OddOfTipps    = MaxOdd;
                }
                else
                {
                    tipListInfo.OddOfTipps       = oddVal * multiWayOddVal;
                    tipListInfo.IllegalOddFactor = 0;
                    tipListInfo.IsMaxOddBet      = false;
                }
                tipListInfo.MinBet = MinStakeCombiBet;
                tipListInfo.MaxBet = Math.Round(LimitHandling.CombiMaxStake(tipListInfo.FullOddFactor * (100 - tipListInfo.ManipulationFeePercentage) / 100, tipItems.Count) * rowCount, 1);

                tipListInfo.MinWin = tipListInfo.FullOddFactor * tipListInfo.MinBet / rowCount * (100 - tipListInfo.ManipulationFeePercentage) / 100;
                tipListInfo.MaxWin = tipListInfo.FullOddFactor * tipListInfo.MaxBet / rowCount * (100 - tipListInfo.ManipulationFeePercentage) / 100;

                tipListInfo.PossWin = (tipListInfo.FullOddFactor * tipListInfo.Bet / rowCount * (100 - tipListInfo.ManipulationFeePercentage) / 100);

                tipListInfo.NumOfBets = 1;
                if ((tipListInfo.BonusFactor < 0.999m || tipListInfo.BonusFactor > 1.001m)
                    )
                {
                    tipListInfo.BonusDesc = "!TERMINAL_BONUS!";
                }

                break;

            case TicketStates.System:
                tipListInfo.BonusFactor      = 1;
                tipListInfo.FullOddFactor    = 0;                      //TODO: Calc system
                tipListInfo.IllegalOddFactor = 0;

                int ind = 0;
                TicketError = TicketError.NoError;
                if (!LimitHandling.SystemBetYAllowed(tipListInfo.NumSystemY))
                {                          //avoid useless time and memory consuming calculations
                    tipListInfo.ResetNumXY();
                    tipListInfo.NumOfBets          = 0;
                    tipListInfo.MinBet             = 0;
                    tipListInfo.OddOfTipps         = 0;
                    tipListInfo.MaxBet             = 0;
                    tipListInfo.MinWin             = 0;
                    tipListInfo.MaxWin             = 0;
                    tipListInfo.EnableSystemAddBtn = false;
                    tipListInfo.EnableSystemSubBtn = false;
                    return;
                }


                if (reset)
                {
                    tipListInfo.ResetNumXY();
                }

                tipListInfo.EnableSystemAddBtn = tipListInfo.NumSystemX < tipListInfo.NumSystemY - 1;
                tipListInfo.EnableSystemSubBtn = minCombMax <tipListInfo.NumSystemX + pathCount && tipListInfo.NumSystemX> TipListInfo.MinSystemX;


                decimal[] oddVals        = new decimal[tipListInfo.NumSystemY];
                bool      disableBankBtn = tipListInfo.PathCount + TipListInfo.MinSystemY >= tipListInfo.NumOfTipps;

                foreach (TipItem t in tipItems)
                {
                    if (!t.IsBank && t.Odd != null)
                    {
                        if (ind < oddVals.Length)
                        {
                            oddVals[ind++] = t.Odd.Value;
                        }
                        else
                        {
                            //_logger.Error("System Y value smaller as expected");


                            t.EnableBankBtn = !disableBankBtn;
                        }
                    }
                }
                tipListInfo.NumOfBets = (decimal)MathNet.Numerics.Fn.BinomialCoefficient(tipListInfo.NumSystemY, tipListInfo.NumSystemX) * tipListInfo.RowCount;
                decimal maxOdd = Nbt.Common.Odd.OddUtilities.AllCombinationsSum(oddVals, tipListInfo.NumSystemX);
                if (oddVals.Length < tipListInfo.NumSystemX)
                {                        //GMU 2011-02-01 fixed wrong || statement
                    string msg = ("in UpdateSystemOfCombiTicket reset=" + reset + " OddVals.Length: " + oddVals.Length + " smaller than " + tipListInfo.NumSystemX);
                    //_logger.Debug(msg);
                    //NbtLogSr.WriteNbtLogEntry(msg, NBTLogBO.PRIORITY_MEDIUM, StationSettings.GetSettings.StationNumber, NBTLogBO.MSG_TERMINAL);
                    return;
                }
                decimal minOdd = Nbt.Common.Odd.OddUtilities.MinCombinationsSum(oddVals, tipListInfo.NumSystemX);
                if (!LimitHandling.SystemBetOddAllowed(maxOdd, tipListInfo.MultiWayOddFactor, tipListInfo.RowCount))
                {
                    throw new Exception(TicketError.SystemItemsRangeError.ToString());
                }
                else
                {
                    //ViewControl.SetTicketErrorMessage(TicketError.NoError);
                    tipListInfo.MinBet = MinStakeSystemBet;
                    //tipListInfo.MaxBet = StationSettings.Station.MaxStakeSystemBet;
                    tipListInfo.OddOfTipps = maxOdd;
                    tipListInfo.MaxBet     = LimitHandling.SystemMaxStake(maxOdd * tipListInfo.MultiWayOddFactor) * tipListInfo.RowCount;

                    tipListInfo.MinWin  = tipListInfo.MinBet * maxOdd * tipListInfo.MultiWayOddFactor / tipListInfo.RowCount;
                    tipListInfo.MaxWin  = tipListInfo.MaxBet * maxOdd * tipListInfo.MultiWayOddFactor / tipListInfo.RowCount;
                    tipListInfo.PossWin = tipListInfo.Bet * maxOdd * tipListInfo.MultiWayOddFactor / tipListInfo.RowCount;
                }
                tipListInfo.FullOddFactor = maxOdd;
                tipListInfo.OddOfTipps    = maxOdd;

                break;
            }

            if (tipListInfo.ManipulationFeePercentage > 0)
            {
                tipListInfo.ManipulationFeeDesc = BetDomainSr.ManipulationFeeString + " " + String.Format("{0:F2}%", tipListInfo.ManipulationFeePercentage);
            }
            //ViewControl.UpdateBetNowButton();TODO: Removed by GMU 2008-09-04 because of beeing redundant
        }