public Play(string inPlayID, string inplayName, string inproductionCompany, PRICE_RANGE inpriceRange, DateTime inplayTime) //Build Play JAM { playID = inPlayID; playName = inplayName; productionCompany = inproductionCompany; priceRange = inpriceRange; playTime = inplayTime; }
public bool AddPlay(string inplayName, string inproductionCompany, PRICE_RANGE inpriceRange, DateTime inplayTime) //Add a new play and save it to the PlayDictionary JAM { int playID = PlayDictionary.Count; string playIDString = playID.ToString(); Play newPlay = new Play(playIDString, inplayName, inproductionCompany, inpriceRange, inplayTime); PlayDictionary.Add(playIDString, newPlay); return(true); }
public Tickets(string inPID, string inTID, string inCID, PRICE_RANGE inPrice, DateTime orderDateIn, string ticketNoIn) //Build Tickets JAM { PlayID = inPID; ticketID = inTID; ticketNo = ticketNoIn; customerID = inCID; priceRange = inPrice; orderDate = orderDateIn; confirmed = false; }
/// <summary> /// Cancels a Play by replacing all data about a play except its date, Id and Cost with the term "CANCELED". /// Price and date are preserved for the perpous of customer records. /// </summary> /// <param name="inplayID"></param> The ID of the Play to be canceled. /// <returns></returns> public void CancelPlay(string inplayID) { string playID = inplayID.ToString(); String playName = PlayDictionary[playID].GetName(); DateTime InDate = PlayDictionary[playID].GetTime(); PRICE_RANGE inpriceRange = PlayDictionary[playID].GetPrice(); Play overwritePlay = new Play(playID, "CANCELED", "CANCELED", inpriceRange, InDate); PlayDictionary[playID] = overwritePlay; //sorry lads, the whole printing message stuff only happens in the MainWindow.xaml.cs file JK }
public static Play Load(System.IO.TextReader textIn) //Load method for customer class using StreamReader GB { Play result = null; try { string playID = textIn.ReadLine(); string playName = textIn.ReadLine(); string productioncompany = textIn.ReadLine(); //variable 'GoldMember' is converted from a string to a Bool GB PRICE_RANGE priceRange = (PRICE_RANGE)Enum.Parse(typeof(PRICE_RANGE), textIn.ReadLine()); DateTime playtime = Convert.ToDateTime(textIn.ReadLine()); result = new Play(playID, playName, productioncompany, priceRange, playtime);; } catch { return(null); } return(result); }
public static Tickets Load(System.IO.TextReader textIn) //Load method for customer class using StreamReader GB { Tickets result = null; try { string PlayID = textIn.ReadLine(); string TicketID = textIn.ReadLine(); string CustomerID = textIn.ReadLine(); PRICE_RANGE priceRange = (PRICE_RANGE)Enum.Parse(typeof(PRICE_RANGE), textIn.ReadLine()); DateTime playtime = Convert.ToDateTime(textIn.ReadLine()); string TicketNO = textIn.ReadLine(); result = new Tickets(PlayID, TicketID, CustomerID, priceRange, playtime, TicketNO); } catch { return(null); } return(result); }
public bool EditPlay(string inplayID, string inplayName, string inproductionCompany, PRICE_RANGE inpriceRange, DateTime inplayTime) //Edit an existing play and overwrite it in the PlayDictionary JAM { string playID = inplayID.ToString(); Play overwritePlay = new Play(playID, inplayName, inproductionCompany, inpriceRange, inplayTime); PlayDictionary[playID] = overwritePlay; return(true); }