public void PrintTicket()
        {
            FileStream   fs = null;
            StreamWriter sw = null;

            try
            {
                fs = new FileStream("../../../documents/ticketPrinted/ticket_" + ticketNr + ".txt", FileMode.Create, FileAccess.Write);
                sw = new StreamWriter(fs);

                sw.WriteLine("      Latitude Music Festival         ");
                sw.WriteLine("--------------------------------------");
                sw.WriteLine("Visitor name    :   " + FirstName + " " + LastName);
                sw.WriteLine("Date of birth   :   " + Dob.ToShortDateString());
                sw.WriteLine("Event account   :   " + eventAccount);
                sw.WriteLine("Ticket number   :   " + ticketNr);
                if (hasReserveCamp)
                {
                    sw.WriteLine("Camping spot    :   " + reservedSpot.SpotId);
                    if (spotCode != "")
                    {
                        sw.WriteLine("Spot code       :   " + spotCode);
                    }
                }
            }
            catch (IOException)
            {
                throw new LatitudeException("Something wrong with printing");
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                }
            }
        }
Esempio n. 2
0
 //  public int SerialNo { get; set; } = 123;
 public override string ToString()
 {
     return($"{"Dto:",-9}{"FirstName=",-10}{FirstName,-10}LastName = {LastName,-6}Dob={Dob.ToShortDateString()} {"RecordNumber = ",-15}{RecordNumber}");
 }
Esempio n. 3
0
 // public string SerialNo { get; set; } = "Abc";
 public override string ToString()
 {
     return($"{"Student:",-9}{"ForeName=",-10}{ForeName,-10}LastName = {LastName,-6}Dob={Dob.ToShortDateString()} {"Id = ",-15}{Id}");
 }
 public void DisplayAll()
 {
     Console.WriteLine($" EmployeeId: {EmployeeId}\n First Name: { FirstName}\n Last Name: { LastName}\n Dob: { Dob.ToShortDateString()}\n Start Date: { StartDate.ToShortDateString()}\n HomeTown: { HomeTown}\n Department: {Department}\n");
 }