// Use this for initialization
    void Start()
    {
        activitymanager = transform.GetComponent <activityManager> ();
        animationscript = transform.GetComponent <animationScript> ();
        loginactivity   = transform.GetComponent <loginActivity> ();

        dictionaryCustomer = loginActivity.getCustomerDictionary();
        dictionaryMechanic = loginActivity.getMechanicDictionary();
        dictionaryStaff    = loginActivity.getStaffDictionary();
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        animationscript = transform.GetComponent <animationScript>();
        activitymanager = transform.GetComponent <activityManager> ();


        //creating customers
        Customer customer1 = new Customer(1, "harry", "hazelton", "h", "p");
        Customer customer2 = new Customer(2, "Connor", "Jones", "c", "p");

        //adding customers to dictionary

        dictionaryCustomer.Add(customer1.getEmail(), customer1);
        dictionaryCustomer.Add(customer2.getEmail(), customer2);



        Mechanic mechanic1 = new Mechanic(3, "Steve", "Harvey", "s", "p");
        Mechanic mechanic2 = new Mechanic(4, "Aladin", "Harvey", "a", "p");

        //adding mechanics to dictionary
        dictionaryMechanic.Add(mechanic1.getEmail(), mechanic1);
        dictionaryMechanic.Add(mechanic2.getEmail(), mechanic2);

        //create service request
        customer2.car = new Car();
        customer2.car.setMake("toyota");
        customer2.car.setModel("aurion");
        print(customer1.car.getMake());
        activitymanager.addServiceRequest(new serviceRequestReciept("fuel", 29f));
        activitymanager.getServiceRequest(0).customerId = customer2.getID();
        activitymanager.getServiceRequest(0).car        = new Car();
        activitymanager.getServiceRequest(0).car.setMake("toyota");
        activitymanager.getServiceRequest(0).car.setModel("aurion");
        customer2.addServiceRequest(activitymanager.getServiceRequest(0));

        Data data = new Data();

        data.saveCustomer(customer2);
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     activitymanager = transform.GetComponent <activityManager> ();
     animationscript = transform.GetComponent <animationScript> ();
 }
示例#4
0
    // Use this for initialization
    void Start()
    {
        animationscript = transform.GetComponent <animationScript>();
        activitymanager = transform.GetComponent <activityManager> ();


        //creating customers
        //Customer customer1 = new Customer(1,"harry","hazelton","h","p");
        //Customer customer2 = new Customer(2,"Connor","Jones","c","p");

        //adding customers to dictionary

        //dictionaryCustomer.Add (customer1.getID(), customer1);
        //dictionaryCustomer.Add (customer2.getID(), customer2);



        //Mechanic mechanic1 = new Mechanic(3,"Steve","Harvey","s","p");
        //Mechanic mechanic2 = new Mechanic(4,"Aladin","Harvey","a","p");

        //adding mechanics to dictionary
        //dictionaryMechanic.Add (mechanic1.getID, mechanic1);
        //dictionaryMechanic.Add (mechanic2.getID, mechanic2);

        //use to delete all saved variables
        //PlayerPrefs.DeleteAll ();

        loadTotalIDCount();
        loadCustomerIDList();
        loadCustomersIntoDictionary();

        loadMechanicIDList();
        loadMechanicsIntoDictionary();

        loadReciepts();
        activitymanager.serviceRequestReceipts = serviceRequestReciepts;
        print(activitymanager.serviceRequestReceipts.Count);

        // creating customers
        if (dictionaryCustomer.Count == 0)
        {
            Customer customer1 = new Customer(1, "harry", "hazelton", "h", "p");
            Customer customer2 = new Customer(2, "Connor", "Jones", "c", "p");

            //adding customers to dictionary
            listOfCustomerID.Add(1);
            listOfCustomerID.Add(2);
            saveCustomer(customer1);
            saveCustomer(customer2);
            dictionaryCustomer.Add(customer1.getID(), customer1);
            dictionaryCustomer.Add(customer2.getID(), customer2);
        }
        if (dictionaryMechanic.Count == 0)
        {
            Mechanic mechanic1 = new Mechanic(3, "Steve", "Harvey", "s", "p");
            Mechanic mechanic2 = new Mechanic(4, "Aladin", "Harvey", "a", "p");

            //adding mechanics to dictionary
            listOfMechanicID.Add(3);
            listOfMechanicID.Add(4);
            saveMechanic(mechanic1);
            saveMechanic(mechanic2);
            dictionaryMechanic.Add(mechanic1.getID(), mechanic1);
            dictionaryMechanic.Add(mechanic2.getID(), mechanic2);
        }
        if (dictionaryStaff.Count == 0)
        {
            Staff staff1 = new Staff(5, "David", "Azzi", "d", "a", "admin");
            Staff staff2 = new Staff(6, "Peter", "Alexander", "d", "a", "frontend");
            listOfStaffID.Add(5);
            listOfStaffID.Add(6);
            saveStaff(staff1);
            saveStaff(staff2);
            dictionaryStaff.Add(staff1.getID(), staff1);
            dictionaryStaff.Add(staff2.getID(), staff2);
        }
    }