Home

Directories

 

Introduction

A directory is a section of a medium used to delimit a group of files. Because it is a "physical" area, it can handle operations not available on files. In fact, there are many fundamental differences between both:

  • A file is used to contain data. A directory doesn't contain data
  • A directory can contain one or more files and not vice-versa
  • A directory can contain other directories
  • A file can be moved from one directory to another. This operation is not possible vice-versa since a file cannot contain a directory

The similarities of both types are:

  • A directory or a file can be created. One of the restrictions is that two files cannot have the same name inside of the same directory. Two directories cannot have the same name inside of the same parent directory.
  • A directory or a file can be renamed. If a directory is renamed, the "path" of its file(s) changes
  • A directory or a file can be deleted. If a directory is deleted, its files are deleted also
  • A directory or a file can be moved. If a directory moves, it "carries" all of its files to the new location
  • A directory or a file can be copied. A file can be copied from one directory to another. If a directory is copied to a new location, all of its files are also copied to the new location

Practical LearningPractical Learning: Introducing Directories

  1. Start Microsoft Visual C++ and create a CLR Console Application named GeorgetownCleaningServices6
  2. To create a new class, in the Solution Explorer, right-click GeorgetownCleaningServices6 -> Add -> Class...
  3. In the Templates list, click C++ Class and click Add
  4. Set the Name to CCustomer and click Finish
  5. Change the header file as follows:
     
    #pragma once
    
    using namespace System;
    
    public ref class CCustomer
    { 
    public:
        String ^ Name;
        String ^ PhoneNumber;
        CCustomer(void);
    };
  6. To create a new class, on the main menu, click Project -> Add Class...
  7. In the Templates list, click C++ Class and click Add
  8. Set the Name to CCleaningOrderDetails and press Enter
  9. Change the header file as follows:
     
    #pragma once
    
    using namespace System;
    
    public ref class CCleaningOrderDetails sealed
    {
    public:
        // The date the cleaning items were deposited
        DateTime OrderDate;
        DateTime OrderTime;
        
        // Numbers to represent cleaning items
        int NumberOfShirts;
        int NumberOfPants;
        int NumberOtherItems;
    
        // Price of items
        double PriceOneShirt;
        double PriceAPairOfPants;
        double PriceOtherItems;
        double TaxRate;
    
        // Each of these sub totals will be used for cleaning items
        double SubTotalShirts;
        double SubTotalPants;
        double SubTotalOtherItems;
    
        // Values used to process an order
        double TotalOrder;
        double TaxAmount;
        double SalesTotal;
    
        CCleaningOrderDetails(void);
    };
  10. Access the CleaningOrderDetails.cpp source file and change the constructor as follows:
     
    #include "StdAfx.h"
    #include "CleaningOrderDetails.h"
    
    CCleaningOrderDetails::CCleaningOrderDetails(void)
    {
        PriceOneShirt = 0.95;
        PriceAPairOfPants = 2.95;
        PriceOtherItems = 4.55;
        TaxRate = 0.0575;  // 5.75%
    }
  11. Save all

Directory Creation

Before using a directory, you must first have it. You can use an existing directory if the operating system or someone else had already created one. You can also create a new directory. Directories are created and managed by various classes but the fundamental class is Directory. Directory is an abstract and sealed class. All of its methods are static, which means you will never need to declare an instance of the Directory class in order to use it.

Besides the Directory class, additional operations of folders and sub-folders can be performed using the DirectoryInfo class.

To create a directory, you can call the CreateDirectory() method of the Directory class. This method is available in two versions. One of the versions uses the following syntax:

public:
    static DirectoryInfo ^ CreateDirectry(String ^path);

This method takes as argument the (complete) path of the desired directory. Here is an example:

E:\Programs\Business Orders\Customer Information

When this method is called:

  1. It first checks the parent drive, in this case E.
    If the drive doesn't exist, because this method cannot create a drive, the compiler would throw a DirectoryNotFoundException exception
  2. If the drive (in this case E) exists, the compiler moves to the first directory part of the path; in this case this would be the Programs folder in the E drive.
    If the folder doesn't exist, the compiler would create it. If that first director doesn't exist, this means that the other directory(ies), if any, under the first don't exist. So, the compiler would create it/them
  3. If the first directory exists and if there is no other directory under that directory, the compiler would stop and would not do anything further.
  4. If the directory exists and there is a sub-directory specified under it, the compiler would check the existence of that directory.
    If the sub-directory exists, the compiler would not do anything further and would stop.
    If the sub-directory doesn't exist, the compiler would create it
  5. The compiler would repeat step 4 until the end of the specified path

The Directory::CreateDirectory() method returns a DirectoryInfo object that you can use as you see fit.

Checking for a Directory Existence

Before using or creating a directory, you can first check if it exists. This is because, if a directory already exists in the location where you want to create it, you would be prevented from creating one with the same name. In the same way, if you just decide to directly use a directory that doesn't exist, the operation you want to perform may fail because the directory would not be found.

Before using or creating a directory, to first check whether it exists or not, you can call the Directory::Exists() Boolean method. Its syntax is:

public:
    static bool Exists(String ^path);

This method receives the (complete) path of the directory. If the path exists, the method returns true. If the directory doesn't exist, the method returns false.

To create a directory, you can call the CreateDirectory() method of the Directory class.

Locating a File

One of the most routine operations performed in a directory consists of looking for a file. Both Microsoft Windows operating systems and the user's intuition have different ways of addressing this issue. The .NET Framework also provides its own means of performing this operation, through various techniques. You can start by checking the sub-directories and files inside of a main directory.

To look for files in a directory, the DirectoryInfo class can assist you with its GetFiles() method, which is overloaded with three versions.

Practical LearningPractical Learning: Using Directories and Files

  1. To create a new class, in the Class View, right-click GeorgetownCleaningOrder6 -> Add -> Class...
  2. In the Templates list, click C++ Class and click Add
  3. Set the Name to CCleaningDeposit and press Enter
  4. Change the header file as follows:
     
    #pragma once
    
    #include "Customer.h"
    #include "CleaningOrderDetails.h"
    
    public ref class CCustomerOrder abstract
    {
    public:
        virtual void ProcessOrder() = 0;
        virtual void ShowReceipt() = 0;
    };
    
    public ref class CCleaningDeposit abstract : CCustomerOrder
    {
    private:
        CCustomer ^ custInfo;
        double AmountTended;
        double Difference;
    
    public:
        CCleaningOrderDetails ^ depot;
        CCleaningDeposit(void);
    };
  5. In the Class View, right-click CCleaningDeposit -> Add -> Add Function
  6. Set the Return Type to CCustomer ^
  7. Set the Function Name to IdentifyCustomer and click Finish
  8. In the CleaningDeposit.cpp source file, implement the IdentifyCustomer method as follows:
     
    #include "StdAfx.h"
    #include "CleaningDeposit.h"
    
    using namespace System;
    using namespace System::IO;
    
    CCleaningDeposit::CCleaningDeposit(void)
    {
        this->custInfo = gcnew CCustomer;
        this->depot    = gcnew CCleaningOrderDetails;
    }
    
    CCustomer ^ CCleaningDeposit::IdentifyCustomer(void)
    {
        String ^ strCustomerName;
        String ^ strTelephoneNumber, ^ strPhoneFormatted;
    
        Console::Write(L"Enter Customer Phone Number: ");
        strTelephoneNumber = Console::ReadLine();
    
        // Remove the spaces, parentheses, if any, and dashes, if any
        strTelephoneNumber = strTelephoneNumber->Replace(L" ", "");
        strTelephoneNumber = strTelephoneNumber->Replace(L"(L", "");
        strTelephoneNumber = strTelephoneNumber->Replace(L")", "");
        strTelephoneNumber = strTelephoneNumber->Replace(L"-", "");
    
        if( strTelephoneNumber->Length != 10 )
        {
            Console::WriteLine(L"Invalid telphone number: {0} " 
                               L"characters instead of 10 digits",
                               strTelephoneNumber->Length);
            return nullptr;
        }
    
    	strPhoneFormatted = String::Concat(L"(L",
    		                   strTelephoneNumber->Substring(0, 3),
                                      L") ",
    			           strTelephoneNumber->Substring(3, 3),
                                       L"-",
    				   strTelephoneNumber->Substring(6, 4));
    
        String ^ strFilename = strTelephoneNumber + L".gcs";
        String ^ strPath = L"C:\\Georgetown Cleaning Services\\Customers\\" 
                           L"\\" + strFilename;
    
    	if( File::Exists(strPath) )
        {
            FileStream ^ stmCustomer =
    		File::Open(strPath, FileMode::Open, FileAccess::Read);
            BinaryReader ^ bnrCustomer = gcnew BinaryReader(stmCustomer);
    
            custInfo->Name = bnrCustomer->ReadString();
            custInfo->PhoneNumber = bnrCustomer->ReadString();
    
            Console::WriteLine(L"\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
            Console::WriteLine(L"-/- Georgetown Cleaning Services -/-");
            Console::WriteLine(L"------------------------------------");
            Console::WriteLine(L"Customer Name: {0}", custInfo->Name);
            Console::WriteLine(L"Phone Number:  {0}", custInfo->PhoneNumber);
            Console::WriteLine(L"------------------------------------\n");
        }
        else // If the customer information was not found in a file
        {
            Console::WriteLine(L"It looks like this is the first time you " 
                               L"are trusting  us with your cleaning order");
            Directory::CreateDirectory(
    		L"C:\\Georgetown Cleaning Services\\Customers");
    		FileStream ^ stmCustomer = File::Create(strPath);
            BinaryWriter ^ bnwCustomer =
                        gcnew BinaryWriter(stmCustomer);
            Console::Write(L"Enter Customer Name: ");
            strCustomerName = Console::ReadLine();
            bnwCustomer->Write(strCustomerName);
            bnwCustomer->Write(strPhoneFormatted);
    
            custInfo->Name = strCustomerName;
            custInfo->PhoneNumber = strTelephoneNumber;
        }
            
        return custInfo;
    }
  9. In the Class View, right-click CCleaningDeposit -> Add -> Add Function
  10. Set the Return Type to void
  11. Set the Function Name to ProcessOrder and click the Virtual check box
  12. Click Finish
  13. In the CleaningDeposit.h header file, on the left side of the semi-colon of the ProcessOrder line, type override
  14. In the CleaningDeposit.cpp source file, implement the ProcessOrder method as follows:
     
    void CCleaningDeposit::ProcessOrder(void)
    {
    	Console::WriteLine(L"-/- Georgetown Cleaning Services -/-");
        CCustomer ^ client = this->IdentifyCustomer();
    
        try {
            Console::Write(L"Enter the order date(mm/dd/yyyy):  ");
    		this->depot->OrderDate = DateTime::Parse(Console::ReadLine());
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"The value you entered is not a valid date");
        }
    
        try {
            Console::Write(L"Enter the order time(hh:mm AM/PM): ");
    		this->depot->OrderTime = DateTime::Parse(Console::ReadLine());
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"The value you entered is not a valid time");
        }
    
        // Request the quantity of each category of items
        try {
            Console::Write(L"Number of Shirts:      ");
            this->depot->NumberOfShirts =
                        int::Parse(Console::ReadLine());
    
            if( this->depot->NumberOfShirts < int::MinValue)
                throw gcnew OverflowException(L"Negative value not " 
                                            L"allowed for shirts");
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"The value you typed for the number of " 
                               L"shirts is not a valid number");
        }
        try {
            Console::Write(L"Number of Pants:       ");
            this->depot->NumberOfPants =
                        int::Parse(Console::ReadLine());
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"The value you typed for the number of " 
                               L"pair or pants is not a valid number");
        }
        try {
            Console::Write(L"Number of Other Items: ");
            this->depot->NumberOtherItems = int::Parse(Console::ReadLine());
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"The value you typed for the number of " 
                               L"other items is not a valid number");
        }
    
        // Perform the necessary calculations
        this->depot->SubTotalShirts =
                    this->depot->NumberOfShirts * this->depot->PriceOneShirt;
        this->depot->SubTotalPants =
                    this->depot->NumberOfPants * this->depot->PriceAPairOfPants;
        this->depot->SubTotalOtherItems =
                    this->depot->NumberOtherItems * this->depot->PriceOtherItems;
        // Calculate the "temporary" total of the order
        this->depot->TotalOrder = this->depot->SubTotalShirts +
                                  this->depot->SubTotalPants +
                                  this->depot->SubTotalOtherItems;
    
        // Calculate the tax amount using a constant rate
        this->depot->TaxAmount = this->depot->TotalOrder * this->depot->TaxRate;
        // Add the tax amount to the total order
        this->depot->SalesTotal = this->depot->TotalOrder + 
    					this->depot->TaxAmount;
    
        // Communicate the total to the user...
        Console::WriteLine(L"\nThe Total order is: {0:C}", 
    		this->depot->SalesTotal);
        // and request money for the order
        try {
            Console::Write(L"Amount Tended? ");
    		AmountTended = double::Parse(Console::ReadLine());
        }
        catch(FormatException ^)
        {
            Console::WriteLine(L"You were asked to enter an " 
                               L"amount of money but...");
        }
        // Calculate the difference owed to the customer
        // or that the customer still owes to the store
        Difference = AmountTended - this->depot->SalesTotal;
    
        this->ShowReceipt();
        this->Save();
    }
  15. In the Class View, right-click CCleaningDeposit -> Add -> Add Function
  16. Set the Return Type to void
  17. Set the Function Name to Save and click Finish
  18. In the CleaningDeposit.cpp source file, implement the Save method as follows:
     
    void CCleaningDeposit::Save(void)
    {
        String ^ strPhoneNumber = this->custInfo->PhoneNumber;
    
        // Remove the spaces, parentheses, and dashes
        strPhoneNumber = strPhoneNumber->Replace(L" ", "");
        strPhoneNumber = strPhoneNumber->Replace(L"(L", "");
        strPhoneNumber = strPhoneNumber->Replace(L")", "");
        strPhoneNumber = strPhoneNumber->Replace(L"-", "");
    
        String ^ strMonth = depot->OrderDate.Month.ToString();
        if( depot->OrderDate.Month < 10 )
            strMonth = L"0" + strMonth;
    
        String ^ strDay = depot->OrderDate.Day.ToString();
        if( depot->OrderDate.Day < 10 )
            strDay = L"0" + strDay;
    
        String ^ strYear = depot->OrderDate.Year.ToString();
    
        String ^ strFilename = strMonth + strDay + strYear + L".gcs";
    
        String ^ strPath = L"C:\\Georgetown Cleaning Services\\Cleaning Orders\\" 
                           L"\\" + strPhoneNumber + L"\\" + strFilename;
    
        Directory::CreateDirectory(
    		L"C:\\Georgetown Cleaning Services\\Cleaning Orders\\"
                                          + strPhoneNumber);
    
    	FileStream ^ stmCleaningOrder = File::Create(strPath);
        BinaryWriter ^ bnwCleaningOrder =
                    gcnew BinaryWriter(stmCleaningOrder);
    
        bnwCleaningOrder->Write(this->custInfo->Name);
        bnwCleaningOrder->Write(this->custInfo->PhoneNumber);
        bnwCleaningOrder->Write(this->depot->OrderDate.ToString());
        bnwCleaningOrder->Write(this->depot->OrderTime.ToString());
        bnwCleaningOrder->Write(this->depot->NumberOfShirts.ToString());
        bnwCleaningOrder->Write(this->depot->NumberOfPants.ToString());
        bnwCleaningOrder->Write(this->depot->NumberOtherItems.ToString());
        bnwCleaningOrder->Write(this->depot->PriceOneShirt.ToString());
        bnwCleaningOrder->Write(this->depot->PriceAPairOfPants.ToString());
        bnwCleaningOrder->Write(this->depot->PriceOtherItems.ToString());
        bnwCleaningOrder->Write(this->depot->TaxRate.ToString());
        bnwCleaningOrder->Write(this->depot->SubTotalShirts.ToString());
        bnwCleaningOrder->Write(this->depot->SubTotalPants.ToString());
        bnwCleaningOrder->Write(this->depot->SubTotalOtherItems.ToString());
        bnwCleaningOrder->Write(this->depot->TotalOrder.ToString());
        bnwCleaningOrder->Write(this->depot->TaxAmount.ToString());
        bnwCleaningOrder->Write(this->depot->SalesTotal.ToString());
    }
  19. To create a new class, in the Solution Explorer, right- click GeorgetownCleaningOrder6 -> Add -> Class...
  20. In the Templates list, click C++ Class and click Add
  21. Set the Name to CCleaningRetrieval and press Enter
  22. Change the CleaningRetrieval.h header file as follows:
     
    #pragma once
    #include "Customer.h"
    #include "CleaningOrderDetails.h"
    
    using namespace System;
    using namespace System::IO;
    
    ref class CCleaningRetrieval
    {
    private:
        CCustomer ^ custInfo;
        CCleaningOrderDetails ^ depot;
        String ^ strPhoneNumber;
    
    public:
        CCleaningRetrieval(void);
    };
  23. Change the CleaningRetrieval.cpp source file as follows:
     
    #include "StdAfx.h"
    #include "CleaningRetrieval.h"
    
    CCleaningRetrieval::CCleaningRetrieval(void)
    {
        this->custInfo = gcnew CCustomer;
        this->depot    = gcnew CCleaningOrderDetails;
    }
  24. In the Class View, right-click CCleaningRetrieval -> Add -> Add Function
  25. Set the Return Type to void
  26. Set the Function Name to Open and click the virtual check box
  27. Click Finish
  28. In the CleaningRetrieval.cpp source file, implement the Open method as follows:
     
    void CCleaningRetrieval::Open(void)
    {
    	Console::Write(L"Enter Receipt Number: ");
        String ^ strFilename = Console::ReadLine();
    
        String ^ strPath = L"C:\\Georgetown Cleaning Services\\Cleaning Orders\\" 
                           L"\\" + strFilename + L"\\" + strFilename + ".gcs";
    
        DirectoryInfo ^ di =
             gcnew DirectoryInfo(
    		L"C:\\Georgetown Cleaning Services\\Cleaning Orders");
        array<FileInfo ^> ^ aryFiles =
    	 di->GetFiles(L"*", SearchOption::AllDirectories);
    
        String ^ strFileFullname = L"";
        bool found = false;
    
        for each(FileInfo ^ fle in aryFiles)
        {
            if( fle->Name == (strFilename + L".gcs") )
            {
                found = true;
                strFileFullname = fle->FullName;
            }
        }
    
        if( found == true )
        {
            FileStream ^ stmCleaningOrder =
    			File::Open(strFileFullname,
                            FileMode::Open,
                            FileAccess::Read);
            BinaryReader ^ bnrCleaningOrder = gcnew BinaryReader(stmCleaningOrder);
            this->custInfo->Name = bnrCleaningOrder->ReadString();
            this->custInfo->PhoneNumber = bnrCleaningOrder->ReadString();
            this->depot->OrderDate = 
    		DateTime::Parse(bnrCleaningOrder->ReadString());
            this->depot->OrderTime = 
    		DateTime::Parse(bnrCleaningOrder->ReadString());
            this->depot->NumberOfShirts = 
    		int::Parse(bnrCleaningOrder->ReadString());
            this->depot->NumberOfPants = 
    		int::Parse(bnrCleaningOrder->ReadString());
            this->depot->NumberOtherItems = 
    			int::Parse(bnrCleaningOrder->ReadString());
            this->depot->PriceOneShirt = 
    			double::Parse(bnrCleaningOrder->ReadString());
            this->depot->PriceAPairOfPants = 
    			double::Parse(bnrCleaningOrder->ReadString());
            this->depot->PriceOtherItems = 
    			double::Parse(bnrCleaningOrder->ReadString());
    	this->depot->TaxRate = double::Parse(bnrCleaningOrder->ReadString());
            this->depot->SubTotalShirts = 
    				double::Parse(bnrCleaningOrder->ReadString());
            this->depot->SubTotalPants = 
    			double::Parse(bnrCleaningOrder->ReadString());
            this->depot->SubTotalOtherItems = 
    			double::Parse(bnrCleaningOrder->ReadString());
    	this->depot->TotalOrder = 
    		double::Parse(bnrCleaningOrder->ReadString());
    	this->depot->TaxAmount = 
    		double::Parse(bnrCleaningOrder->ReadString());
    	this->depot->SalesTotal = 
    		double::Parse(bnrCleaningOrder->ReadString());
    
    	this->strPhoneNumber = String::Concat(L"(L", 
                                     this->custInfo->PhoneNumber->Substring(0, 3),
    			         L") ", 
                                     this->custInfo->PhoneNumber->Substring(3, 3),
                                     L"-",
    		                this->custInfo->PhoneNumber->Substring(6, 4));
            this->ShowReceipt();
        }
        else
            Console::WriteLine(L"No cleaning order of "
    				           L"that receipt number was found");
    }
  29. In the Class View, right-click CCleaningRetrieval -> Add -> Add Function
  30. Set the Return Type to void
  31. Set the Function Name to ShowReceipt and click Finish
  32. In the CleaningRetrieval.cpp source file, implement the ShowReceipt method as follows:
     
    void CCleaningRetrieval::ShowReceipt(void)
    {
        Console::WriteLine();
        // Display the receipt
        Console::WriteLine(L"====================================");
        Console::WriteLine(L"-/- Georgetown Cleaning Services -/-");
        Console::WriteLine(L"====================================");
        Console::WriteLine(L"Customer:    {0}", this->custInfo->Name);
        Console::WriteLine(L"Home Phone:  {0}", this->custInfo->PhoneNumber);
        Console::WriteLine(L"Order Date:  {0:D}", this->depot->OrderDate);
        Console::WriteLine(L"Order Time:  {0:t}", this->depot->OrderTime);
        Console::WriteLine(L"------------------------------------");
        Console::WriteLine(L"Item Type   Qty Unit/Price Sub-Total");
        Console::WriteLine(L"------------------------------------");
        Console::WriteLine(L"Shirts      {0,3}   {1,4}      {2,6}",
                           this->depot->NumberOfShirts,
                           this->depot->PriceOneShirt,
                           this->depot->SubTotalShirts);
        Console::WriteLine(L"Pants       {0,3}   {1,4}      {2,6}",
                           this->depot->NumberOfPants,
                           this->depot->PriceAPairOfPants,
                           this->depot->SubTotalPants);
        Console::WriteLine(L"Other Items {0,3}   {1,4}      {2,6}",
                           this->depot->NumberOtherItems,
                           this->depot->PriceOtherItems,
                           this->depot->SubTotalOtherItems);
        Console::WriteLine(L"------------------------------------");
        Console::WriteLine(L"Total Order:   {0,6}",
                           this->depot->TotalOrder.ToString(L"C"));
        Console::WriteLine(L"Tax Rate:      {0,6}",
                           this->depot->TaxRate.ToString(L"P"));
        Console::WriteLine(L"Tax Amount:    {0,6}",
                           this->depot->TaxAmount.ToString(L"C"));
        Console::WriteLine(L"Net Price:     {0,6}",
                           this->depot->SalesTotal.ToString(L"C"));
        Console::WriteLine(L"====================================");
    }
  33. Access the GeorgetownCleaningServices6.cpp source file and change it as follows:
     
    // GeorgetownCleaningServices6.cpp : main project file.
    
    #include "stdafx.h"
    #include "CleaningDeposit.h"
    #include "CleaningRetrieval.h"
    
    using namespace System;
    
    int main(array<System::String ^> ^args)
    {
        String ^ answer = L"q";
    
        Console::WriteLine(L"Is this a new order or the customer is "
                           L"retrieving items previously left for cleaning?");
        Console::WriteLine(L"0. Quit");
        Console::WriteLine(L"1. This is a new order");
        Console::WriteLine(L"2. The customer is retrieving an existing order");
        Console::Write(L"Your Choice: ");
        answer = Console::ReadLine();
    
        if( answer == L"1" )
        {
            CCleaningDeposit ^ depotOrder = gcnew CCleaningDeposit;
            depotOrder->ProcessOrder();
        }
        else if( answer == L"2" )
        {
            CCleaningRetrieval ^ previousOrder = gcnew CCleaningRetrieval;
            previousOrder->Open();
        }
    
        Console::WriteLine();
        return 0;
    }
  34. Execute the application and test it. Here is an example:
     
    Is this a new order or the customer is retrieving 
    items previously left for cleaning?
    0. Quit
    1. This is a new order
    2. The customer is retrieving an existing order
    Your Choice: 0
    
    Press any key to continue . . .
  35. Close the DOS window
  36. Execute the application and create a new order. Here is an example:
     
    Is this a new order or the customer is retrieving 
    items previously left for cleaning?
    0. Quit
    1. This is a new order
    2. The customer is retrieving an existing order
    Your Choice: 1
    -/- Georgetown Cleaning Services -/-
    Enter Customer Phone Number: 202 103 0443
    It looks like this is the first time you are trusting 
    us with your cleaning order
    Enter Customer Name: Arsene Cranston
    Enter the order date(mm/dd/yyyy):  11/20/2007
    Enter the order time(hh:mm AM/PM): 08:12 AM
    Number of Shirts:      6
    Number of Pants:       4
    Number of Other Items: 2
    
    The Total order is: $28.13
    Amount Tended? 30
    
    ====================================
    -/- Georgetown Cleaning Services -/-
    ====================================
    Customer:    Arsene Cranston
    Home Phone:  2021030443
    Order Date:  Tuesday, November 20, 2007
    Order Time:  8:12 AM
    ------------------------------------
    Item Type    Qty Unit/Price Sub-Total
    ------------------------------------
    Shirts        6   0.95        5.70
    Pants         4   2.95       11.80
    Other Items   2   4.55        9.10
    ------------------------------------
    Total Order:   $26.60
    Tax Rate:      5.75 %
    Tax Amount:     $1.53
    Net Price:     $28.13
    ------------------------------------
    Amount Tended: $30.00
    Difference:     $1.87
    ====================================
    
    Press any key to continue . . .
  37. Remember the date you provided and close the DOS window
  38. Execute the application and create a new order. Here is an example:
     
    Is this a new order or the customer is retrieving items 
    previously left for cleaning?
    0. Quit
    1. This is a new order
    2. The customer is retrieving an existing order
    Your Choice: 1
    -/- Georgetown Cleaning Services -/-
    Enter Customer Phone Number: 301-022-1077
    It looks like this is the first time you are trusting 
    us with your cleaning order
    Enter Customer Name: Helene Craft
    Enter the order date(mm/dd/yyyy):  11/21/2007
    Enter the order time(hh:mm AM/PM): 9:25
    Number of Shirts:      3
    Number of Pants:       0
    Number of Other Items: 5
    
    The Total order is: $27.07
    Amount Tended? 40
    
    ====================================
    -/- Georgetown Cleaning Services -/-
    ====================================
    Customer:    Helene Craft
    Home Phone:  3010221077
    Order Date:  Wednesday, November 21, 2007
    Order Time:  9:25 AM
    ------------------------------------
    Item Type    Qty Unit/Price Sub-Total
    ------------------------------------
    Shirts        3   0.95        2.85
    Pants         0   2.95        0.00
    Other Items   5   4.55       22.75
    ------------------------------------
    Total Order:   $25.60
    Tax Rate:      5.75 %
    Tax Amount:     $1.47
    Net Price:     $27.07
    ------------------------------------
    Amount Tended: $40.00
    Difference:    $12.93
    ====================================
    
    Press any key to continue . . .
  39. Remember the date you provided and close the DOS window
  40. Execute the application and choose to open an existing order. Here is an example:
     
    Is this a new order or the customer is retrieving 
    items previously left for cleaning?
    0. Quit
    1. This is a new order
    2. The customer is retrieving an existing order
    Your Choice: 2
    Enter Receipt Number: 11202006
    
    ====================================
    -/- Georgetown Cleaning Services -/-
    ====================================
    Customer:    Arsene Cranston
    Home Phone:  2021030443
    Order Date:  Monday, November 20, 2006
    Order Time:  8:12 AM
    ------------------------------------
    Item Type   Qty Unit/Price Sub-Total
    ------------------------------------
    Shirts        6   0.95        5.70
    Pants         4   2.95       11.80
    Other Items   2   4.55        9.10
    ------------------------------------
    Total Order:   $26.60
    Tax Rate:      5.75 %
    Tax Amount:     $1.53
    Net Price:     $28.13
    ====================================
    
    Press any key to continue . . .
  41. Close the DOS window

Previous Copyright © 2005-2012, FunctionX, Inc. Home