예제 #1
0
        public void Run()
        {
            Console.Clear();

            Components.Title("FIND ENDPOINT:");

            Console.WriteLine("Enter the serial number of the Endpoint:");
            var result   = Console.ReadLine();
            var endPoint = _endPointDao.Find(result);

            if (endPoint != null)
            {
                Console.WriteLine(endPoint.ToString());
                Console.WriteLine();
                Console.WriteLine("Press Enter to return...");
                Console.ReadKey();
            }
            else
            {
                Console.WriteLine();
                Console.WriteLine(@"
EndPoint not found. 

Press Enter to return...");
                Console.ReadKey();
            }
        }
예제 #2
0
        public bool Delete(EndPoint obj)
        {
            try
            {
                if (_endPointDAO.Find(obj.SerialNumber) == null)
                {
                    throw new Exception("Sorry! EndPoint not found..");
                }

                _endPointDAO.Delete(obj);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine();
                Console.WriteLine(ex.Message);
                return(false);
            }
        }
예제 #3
0
        public void Run()
        {
            Console.Clear();

            Components.Title("FORM OF INSERT ENDPOINT:");

            Console.WriteLine("Enter the serial number of the Endpoint to be edited:");
            var result   = Console.ReadLine();
            var endPoint = _endPointDao.Find(result);

            if (endPoint != null)
            {
                Console.WriteLine();
                Console.WriteLine("EndPoint in editing:");

                Console.WriteLine(endPoint.ToString());

                Console.WriteLine("Enter new data");
                Console.WriteLine();
                var newEndPoint = Components.Edition(endPoint);

                var ret = _endPointService.Edit(endPoint, newEndPoint);

                if (ret)
                {
                    Console.WriteLine();
                    Console.WriteLine("SUCCESS! Press Enter to return...");
                    Console.ReadKey();
                }
                else
                {
                    Console.WriteLine();
                    Console.Write("NOT EXECUTED! Press enter to return...");
                    Console.ReadKey();
                }
            }
            else
            {
                Console.WriteLine(@"
EndPoint not found. 

Press Enter to return...");

                Console.ReadKey();
            }
        }
예제 #4
0
        public void Run()
        {

            Console.Clear();

            Components.Title("DELETE ENDPOINT:");

            Console.WriteLine("Enter the serial number of the Endpoint to be deleted:");
            var result = Console.ReadLine();
            var endPoint = _endPointDao.Find(result);

            if (endPoint != null)
            {
                Console.WriteLine();
                Console.WriteLine("EndPoint in editing:");

                Console.WriteLine(endPoint.ToString());

                Console.WriteLine();
                string typeit;
                do
                {
                    Console.Write("Proceed with the exclusion? (Y/N):");
                    typeit = Console.ReadLine();
                } while (typeit.ToUpper() != "Y" && typeit.ToUpper() != "N");

                if (typeit.ToUpper() == "Y")
                {
                    _endPointDao.Delete(endPoint);
                    Console.WriteLine(@"
EndPoint Deleted!  

Press Enter to return...");
                    Console.ReadKey();

                }
            }
            else
            {
                Console.WriteLine("EndPoint not found. Press Enter to return...");
                Console.ReadKey();
            }
        }