Ejemplo n.º 1
0
 static void MenuOptions_DeleteLog()
 {
     Console.Write("Please enter ID of Log to delete:");
     if (JMS_Commands.DeleteLog(Console.ReadLine()))
     {
         Console.WriteLine("Deleted.");
     }
     else
     {
         Console.WriteLine("Failed To Delete.");
     }
 }
Ejemplo n.º 2
0
        static void MenuOptions_GetEmployees()
        {
            Console.WriteLine("\nEmployees:");
            List <EmployeeDTO> lstEm = JMS_Commands.GetEmployees();

            if (lstEm != null)
            {
                lstEm.ForEach(j => PrintEmployee(j));
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 3
0
        static void MenuOptions_GetEquipmentList()
        {
            Console.WriteLine("\nEquipment:");
            List <EquipmentDTO> lstEq = JMS_Commands.GetEquipment();

            if (lstEq != null)
            {
                lstEq.ForEach(j => PrintEquipment(j));
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 4
0
        static void MenuOptions_GetLogs()
        {
            Console.WriteLine("\nLogs:");
            List <PrivateLog> lstEm = JMS_Commands.GetLogs();

            if (lstEm != null)
            {
                lstEm.ForEach(j => PrintLog(j));
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 5
0
        static void MenuOption_GetJobs()
        {
            Console.WriteLine("\nJobs:");
            List <JobDTO> lstJ = JMS_Commands.GetJobs();

            if (lstJ != null)
            {
                lstJ.ForEach(j => PrintJob(j));
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 6
0
        static void MenuOptions_CreateLog()
        {
            PrivateLogDTO log = new PrivateLogDTO();

            Console.Write("Please enter message to add:");
            log.Message = Console.ReadLine();
            log.UserID  = FirebaseHelper.GetUserID();
            log.ID      = Guid.NewGuid().ToString();

            JMS_Commands.CreateLog(log);

            log = null;
            GC.Collect();
        }
Ejemplo n.º 7
0
        static void MenuOptions_GetClients()
        {
            Console.WriteLine("\nClients:");
            List <ClientDTO> lstC = JMS_Commands.GetClients();

            if (lstC != null)
            {
                lstC.ForEach(j => PrintClient(j));
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 8
0
        static void MenuOptions_GetLog()
        {
            Console.Write("Please enter ID of Log:");
            string     id  = Console.ReadLine();
            PrivateLog dto = JMS_Commands.GetLog(id);

            if (dto != null)
            {
                PrintLog(dto);
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 9
0
        static void MenuOptions_GetEmployee()
        {
            Console.Write("Please enter ID of Employee:");
            string      idEm  = Console.ReadLine();
            EmployeeDTO dtoEm = JMS_Commands.GetEmployee(idEm);

            if (dtoEm != null)
            {
                PrintEmployee(dtoEm);
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 10
0
        static void MenuOptions_GetEquipment()
        {
            Console.Write("Please enter ID of Equipment:");
            string       idEq  = Console.ReadLine();
            EquipmentDTO dtoEq = JMS_Commands.GetEquipment(idEq);

            if (dtoEq != null)
            {
                PrintEquipment(dtoEq);
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 11
0
        static void MenuOptions_GetClient()
        {
            Console.Write("Please enter ID of Client:");
            string    idC  = Console.ReadLine();
            ClientDTO dtoC = JMS_Commands.GetClient(idC);

            if (dtoC != null)
            {
                PrintClient(dtoC);
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 12
0
        static void MenuOptions_GetJob()
        {
            Console.Write("Please enter ID of Job:");
            string id  = Console.ReadLine();
            JobDTO dto = JMS_Commands.GetJob(id);

            if (dto != null)
            {
                PrintJob(dto);
            }
            else
            {
                Console.WriteLine("No Results.");
            }
        }
Ejemplo n.º 13
0
        static void MenuOptions_CreateJob()
        {
            JobDTO job = new JobDTO();

            Console.Write("Please enter name of Job to add:");
            job.Name = Console.ReadLine();

            Console.Write("Please enter ID of client:");
            job.ClientID = Console.ReadLine();
            job.ID       = Guid.NewGuid().ToString();

            JMS_Commands.CreateJob(job);

            job = null;
            GC.Collect();
        }
Ejemplo n.º 14
0
        static void MenuOptions_UpdateLog()
        {
            Console.Write("Please enter the id of the log item you would like to update:");
            PrivateLog log = JMS_Commands.GetLog(Console.ReadLine());

            Console.Write("Log to update:");
            PrintLog(log);

            Console.Write("Please enter updated log message:");
            log.Message = Console.ReadLine();

            JMS_Commands.CreateLog(new PrivateLogDTO(log));

            log = null;
            GC.Collect();
        }
Ejemplo n.º 15
0
        static void MenuOptions_CreateClient()
        {
            Console.Write("Please enter name of Client to add:");
            ClientDTO client = new ClientDTO();

            client.CompanyName = Console.ReadLine();

            Console.Write("Please enter address of client:");
            client.Address = Console.ReadLine();
            client.ID      = Guid.NewGuid().ToString();

            JMS_Commands.CreateClient(client);

            client = null;
            GC.Collect();
        }
Ejemplo n.º 16
0
        static void MenuOptions_UpdateClient()
        {
            Console.Write("Please enter the id of the object you would like to update:");
            ClientDTO client = JMS_Commands.GetClient(Console.ReadLine());

            Console.Write("Client to update:");
            PrintClient(client);

            Console.Write("Please enter updated name of Client to add:");
            client.CompanyName = Console.ReadLine();

            Console.Write("Please enter updated address of client:");
            client.Address = Console.ReadLine();

            JMS_Commands.UpdateClient(client);

            client = null;
            GC.Collect();
        }
Ejemplo n.º 17
0
        static void MenuOptions_CreateEmployee()
        {
            EmployeeDTO employee = new EmployeeDTO();

            Console.Write("Please enter first name of Employee to add:");
            employee.FirstName = Console.ReadLine();

            Console.Write("Please enter last name of employee:");
            employee.LastName = Console.ReadLine();

            employee.Role = 0;

            employee.ID = Guid.NewGuid().ToString();

            JMS_Commands.CreateEmployee(employee);

            employee = null;
            GC.Collect();
        }
Ejemplo n.º 18
0
        static void MenuOptions_CreateEquipment()
        {
            Console.Write("Please enter name of Equipment to add:");
            EquipmentDTO equipment = new EquipmentDTO();

            equipment.Name = Console.ReadLine();

            Console.Write("Please enter manufacturer of equipment:");
            equipment.Manufacturer = Console.ReadLine();

            Console.Write("Please enter model of equipment:");
            equipment.Model = Console.ReadLine();

            equipment.ID = Guid.NewGuid().ToString();

            JMS_Commands.CreateEquipment(equipment);

            equipment = null;
            GC.Collect();
        }
Ejemplo n.º 19
0
        static void MenuOptions_UpdateEmployee()
        {
            Console.Write("Please enter the id of the equipment item you would like to update:");
            EmployeeDTO employee = JMS_Commands.GetEmployee(Console.ReadLine());

            Console.Write("Employee to update:");
            PrintEmployee(employee);

            Console.Write("Please enter updated first name of Employee to add:");
            employee.FirstName = Console.ReadLine();

            Console.Write("Please enter updated last name of employee:");
            employee.LastName = Console.ReadLine();

            employee.Role = 0;

            JMS_Commands.CreateEmployee(employee);

            employee = null;
            GC.Collect();
        }
Ejemplo n.º 20
0
        static void MenuOptions_UpdateJob()
        {
            Console.Write("Please enter the id of the object you would like to update:");
            JobDTO dto = JMS_Commands.GetJob(Console.ReadLine());

            Console.WriteLine("Job to update:");
            PrintJob(dto);

            Console.Write("Please enter updated name of Job to add:");
            dto.Name = Console.ReadLine();

            Console.Write("Please enter updated ID of client:");
            dto.ClientID = Console.ReadLine();
            dto.ID       = Guid.NewGuid().ToString();

            JMS_Commands.UpdateJob(dto);


            dto = null;
            GC.Collect();
        }
Ejemplo n.º 21
0
        static void MenuOptions_UpdateEquipment()
        {
            Console.Write("Please enter the id of the equipment item you would like to update:");
            EquipmentDTO equipment = JMS_Commands.GetEquipment(Console.ReadLine());

            Console.Write("Equipment to update:");
            PrintEquipment(equipment);

            Console.Write("Please enter updated name of Equipment to add:");
            equipment.Name = Console.ReadLine();

            Console.Write("Please enter updated manufacturer of equipment:");
            equipment.Manufacturer = Console.ReadLine();

            Console.Write("Please enter updated model of equipment:");
            equipment.Model = Console.ReadLine();

            JMS_Commands.UpdateEquipment(equipment);

            equipment = null;
            GC.Collect();
        }