Exemple #1
0
        /*!loads the cooperation types
         */
        private static void LoadCooperations()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(AppSettings.getDataPath() + "\\airlinecooperations.xml");
            XmlElement root = doc.DocumentElement;

            XmlNodeList cooperationsList = root.SelectNodes("//cooperation");

            foreach (XmlElement element in cooperationsList)
            {
                string section = root.Name;
                string uid = element.Attributes["uid"].Value;
                double price = Convert.ToDouble(element.Attributes["price"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);
                int fromyear = Convert.ToInt16(element.Attributes["fromyear"].Value);
                double monthlyprice = Convert.ToDouble(element.Attributes["monthlyprice"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);
                int servicelevel = Convert.ToInt16(element.Attributes["servicelevel"].Value);
                double incomeperpax = Convert.ToDouble(element.Attributes["incomeperpax"].Value, CultureInfo.GetCultureInfo("en-US").NumberFormat);
                GeneralHelpers.Size minsize = (GeneralHelpers.Size)Enum.Parse(typeof(GeneralHelpers.Size), element.Attributes["minsize"].Value);

                CooperationType type = new CooperationType(section, uid, minsize, fromyear, price, monthlyprice, servicelevel, incomeperpax);
                CooperationTypes.AddCooperationType(type);
                /*uid="101" price="250000" fromyear="1980" monthlyprice="10000" servicelevel="50" incomepercent="3"*/

                if (element.SelectSingleNode("translations") != null)
                    Translator.GetInstance().addTranslation(root.Name, element.Attributes["uid"].Value, element.SelectSingleNode("translations"));
            }
        }
 //adds a type to the list
 public static void AddCooperationType(CooperationType type)
 {
     types.Add(type);
 }
Exemple #3
0
 public Cooperation(CooperationType type, Airline airline, DateTime built)
 {
     this.BuiltDate = built;
     this.Airline   = airline;
     this.Type      = type;
 }
Exemple #4
0
 public Cooperation(CooperationType type, Airline airline, DateTime built)
 {
     this.BuiltDate = built;
     this.Airline = airline;
     this.Type = type;
 }
 //adds a type to the list
 public static void AddCooperationType(CooperationType type)
 {
     types.Add(type);
 }