Пример #1
0
        public static bool AddCenter(string centerName, string agentName, string password, string seatName)
        {
            List <Seats>           lSeat      = DatabaseHandler.GetAllSeats();
            List <ViewAbleCenters> viewCenter = GetViewAbleCenters(seatName);
            int id = 0;

            foreach (ViewAbleCenters vCenter in viewCenter)
            {
                if (vCenter.CenterName == centerName)
                {
                    return(false);
                }
            }
            foreach (Seats s in lSeat)
            {
                if (s.SeatName == seatName)
                {
                    id = s.SeatId;
                    break;
                }
            }
            DatabaseHandler.AddCenter(centerName, agentName, password, id);
            return(true);
        }