Exemplo n.º 1
0
        Ticket pri(Ticket tk, string counterID)
        {
            if (tk != null)
            {
                if (!string.IsNullOrWhiteSpace(counterID))
                {
                    var counter = socController.GetCounterByID(counterID, dicAllCounters);

                    if (counter != null && counter.Pservices != null && counter.Pservices.Any(m => m == tk.Services[0]))
                    {
                        tk.ticket_priority.priority_service = 1;
                    }

                    if (counter.Pservices != null && counter.Pservices.Length > 0)
                    {
                        tk.PriorityService = tk.Services.Any(n => counter.Pservices.Contains(n));
                    }
                }
                tk.PriorityTicket = socController.MathPriority(tk.ticket_priority, resPri);
                if (socController.LogicVip(tk.PriorityTicket, resPri.min_priority_restricted))
                {
                    if (tk.Ticket_Booking != null && !string.IsNullOrWhiteSpace(tk.Ticket_Booking.Id))
                    {
                        tk.IsVipKing = true;
                    }
                    else
                    {
                        tk.IsVip = true;
                    }
                }
                else if (tk.Ticket_Booking != null && !string.IsNullOrWhiteSpace(tk.Ticket_Booking.Id))
                {
                    tk.IsBooking = true;
                }
                else if (tk.PriorityService)
                {
                    tk.IsPService = true;
                }
                else
                {
                    tk.IsNomarl = true;
                }
            }
            return(tk);
        }