// XML files public static void fncWriteDirectorsinlineXML() { listDirectors = frmBank.fncGetvListDirecteurs(); XmlWriterSettings set = new XmlWriterSettings(); set.Indent = true; XmlWriter writer = XmlWriter.Create(Application.StartupPath + @"/1.infoDirectorinLine.xml", set); writer.WriteStartDocument(); writer.WriteStartElement("Directors"); foreach (clsDirecteur element in listDirectors.Elements) { writer.WriteStartElement("Director"); writer.WriteAttributeString("number", element.vNumber); writer.WriteAttributeString("lastName", element.vLastName); writer.WriteAttributeString("salary", element.vSalary.ToString()); writer.WriteAttributeString("photoString", element.vPhoto); writer.WriteElementString("name", element.vName); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndDocument(); writer.Close(); MessageBox.Show(listDirectors.Quantity.ToString() + " Directors were added to a xml document !"); }
public void fncOpenaBank(string BankName, string BankAddress, double BankCapital, clsListDirecteurs ListDirecteurs, clsListAgencies ListAgencies, clsListAdmins ListAdmins) { BankName = vBankName; BankAddress = vBankAddress; BankCapital = vBankCapital; ListDirecteurs = vListDirecteurs; ListAgencies = vListAgencies; ListAdmins = vListAdmins; }
/// <summary> /// Constructor that takes three arguments and the director list, agencies list and the admin list. /// </summary> public clsNationalBank(string vBankName, string vBankAddress, double vBankCapital, clsListDirecteurs vListDirecteurs, clsListAgencies vListAgencies, clsListAdmins vListAdmins) { clsNationalBank.staticNbBank++; IdBank = staticNbBank; BankName = vBankName; BankAddress = vBankAddress; BankCapital = vBankCapital; ListDirecteurs = vListDirecteurs; ListAgencies = vListAgencies; ListAdmins = vListAdmins; }
/// <summary> /// Constructor that takes no arguments. /// </summary> public clsNationalBank() { clsNationalBank.staticNbBank++; IdBank = 400 + IdBank; BankName = clsDataSource.fncEmptyConstructor(); BankAddress = clsDataSource.fncEmptyConstructor(); BankCapital = 0; ListDirecteurs = null; ListAgencies = null; ListAdmins = null; }
/// <summary> /// Constructor that takes three arguments, the director as an object and the director list and agencies list. /// </summary> public clsNationalBank(string vNumber, string vName, string vLastName, double vSalary, string vPhoto, string vBankName, string vBankAddress, double vBankCapital, clsListDirecteurs vListDirecteurs, clsListAgencies vListAgencies) { // constructor director -> Constructor that takes 4 arguments we add the photo to the base, and add salary in the class. Director = new clsDirecteur(vNumber, vName, vLastName, vSalary, vPhoto); clsNationalBank.staticNbBank++; IdBank = staticNbBank; BankName = vBankName; BankAddress = vBankAddress; BankCapital = vBankCapital; ListDirecteurs = vListDirecteurs; ListAgencies = vListAgencies; }