コード例 #1
0
 public Customer(string i_CustomerName, string i_CustomerPhoneNumber, Vehicle i_Vehicle)
 {
     m_Vehicle             = i_Vehicle;
     m_Status              = eGarageOrderStatus.UnderRepair;
     m_CustomerName        = i_CustomerName;
     m_CustomerPhoneNumber = i_CustomerPhoneNumber;
 }
コード例 #2
0
        public static void licensePlateList(Garage i_Garage)
        {
            int                count, userInput;
            StringBuilder      sb;
            string             status;
            eGarageOrderStatus m_Status = eGarageOrderStatus.All;

            while (true)
            {
                sb    = new StringBuilder();
                count = 1;
                sb.AppendLine("List of all license plates: ");
                sb.AppendLine("----------------------------");
                foreach (KeyValuePair <string, eGarageOrderStatus> s in i_Garage.GetLicensePlateList())
                {
                    if ((m_Status == eGarageOrderStatus.All) || (m_Status == s.Value))
                    {
                        sb.AppendLine("Plate: " + s.Key + "\tStatus: " + s.Value);
                    }
                }

                sb.AppendLine("----------------------------");
                sb.AppendLine("Choose number of status to filter or 'q' to return\n");
                foreach (eGarageOrderStatus s in Enum.GetValues(typeof(eGarageOrderStatus)))
                {
                    sb.Append(count + "." + s + "\t");
                    count++;
                }

                Printer.PrintMessage(sb.ToString());
                status = Console.ReadLine();
                if (status.ToLower() == "q")
                {
                    Console.Clear();
                    break;
                }
                else
                {
                    if (int.TryParse(status, out userInput))
                    {
                        switch ((eGarageOrderStatus)int.Parse(status))
                        {
                        case eGarageOrderStatus.Fixed:
                            m_Status = eGarageOrderStatus.Fixed;
                            break;

                        case eGarageOrderStatus.Paid:
                            m_Status = eGarageOrderStatus.Paid;
                            break;

                        case eGarageOrderStatus.UnderRepair:
                            m_Status = eGarageOrderStatus.UnderRepair;
                            break;

                        default:
                            m_Status = eGarageOrderStatus.All;
                            break;
                        }
                    }
                }
            }
        }
コード例 #3
0
 public void UpdateStatus(eGarageOrderStatus i_NewStatus)
 {
     m_Status = i_NewStatus;
 }