public static void fncWriteAgencieslineinXML()
        {
            try
            {
                listAgencies = frmBank.fncGetvListAgencies();
                XmlWriterSettings set = new XmlWriterSettings();
                set.Indent = true;

                XmlWriter writer = XmlWriter.Create(Application.StartupPath + @"/3.infoAgencyinLine.xml", set);
                writer.WriteStartDocument();
                writer.WriteStartElement("Agencies");
                foreach (clsAgency element in listAgencies.Elements)
                {
                    writer.WriteStartElement("Agency");
                    writer.WriteAttributeString("idCounter", element.vagencyIdCounter.ToString());
                    writer.WriteAttributeString("number", element.vAgencyNumber);
                    writer.WriteAttributeString("adress", element.vAgencyAddress);
                    writer.WriteElementString("name", element.vAgencyName);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                writer.WriteEndDocument();
                writer.Close();
                MessageBox.Show(listAgencies.Quantity.ToString() + " Agencies were added to a xml document !");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 /// <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;
 }
Beispiel #4
0
 /// <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;
 }
Beispiel #5
0
        /// <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;
        }