Ejemplo n.º 1
0
        private static void GetAllpart()
        {
            ParticipantBL      bl = new ParticipantBL();
            List <Participant> l  = new List <Participant>();

            try
            {
                l = bl.GetAll();
                foreach (Participant e in l)
                {
                    Console.WriteLine($"{e.RollNo},{e.EmailId},{e.ApplicationId},{e.ScheduledProgramId}");
                }
                if (l.Count > 0)
                {
                    Console.WriteLine("Succes");
                }
                else
                {
                    Console.WriteLine("Not success");
                }
            }
            catch (UniversityException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 2
0
        private static void AddPart()
        {
            try
            {
                Participant e = new Participant()
                {
                    RollNo = "A123", EmailId = "[email protected]", ApplicationId = 8, ScheduledProgramId = "s2"
                };
                Participant e1 = new Participant()
                {
                    RollNo = "B123", EmailId = "[email protected]", ApplicationId = 8, ScheduledProgramId = "s2"
                };

                ParticipantBL bl   = new ParticipantBL();
                bool          aded = bl.Add(e);
                aded = bl.Add(e1);
                if (aded)
                {
                    Console.WriteLine("added succesfully");
                }
            }
            catch (UniversityException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 3
0
        public void AddParticipant(ParticipantBL entity)
        {
            Participant participant = new Participant
            {
                IdEvent = entity.IdEvent,
                IdUser  = entity.IdUser
            };

            serv.Create(participant);
        }
Ejemplo n.º 4
0
        private static void UpdatePart()
        {
            try
            {
                Participant e = new Participant()
                {
                    RollNo = "A125", EmailId = "[email protected]", ApplicationId = 8, ScheduledProgramId = "S4"
                };
                ParticipantBL bl    = new ParticipantBL();
                bool          updtd = bl.Update("A123", e);

                if (updtd)
                {
                    Console.WriteLine("updated succesfully");
                }
            }
            catch (UniversityException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 5
0
        private static void DeletePart()
        {
            try
            {
                Participant   e  = new Participant();
                ParticipantBL bl = new ParticipantBL();

                bool dltd = bl.Delete(e, "B123");
                if (dltd)
                {
                    Console.WriteLine("Deleted Succesfully");
                }
                else
                {
                    Console.WriteLine("not succesfully deleted");
                }
            }
            catch (UniversityException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }