public static void fncWriteAdminsinXML()
        {
            listAdmins = frmBank.fncGetvListAdmins();
            XmlWriterSettings set = new XmlWriterSettings();

            set.Indent = true;

            XmlWriter writer = XmlWriter.Create(Application.StartupPath + @"/2.infoAdminin.xml", set);

            writer.WriteStartDocument();
            writer.WriteStartElement("Admins");
            foreach (clsAdmin element in listAdmins.Elements)
            {
                writer.WriteStartElement("Admin");
                writer.WriteElementString("number", element.vNumber);
                writer.WriteElementString("name", element.vName);
                writer.WriteElementString("lastName", element.vLastName);
                writer.WriteElementString("e-mail", element.vEmail);
                writer.WriteElementString("password", element.vPassword);
                writer.WriteElementString("photoString", element.vPhoto);
                writer.WriteEndElement();
            }
            writer.WriteEndElement();
            writer.WriteEndDocument();
            writer.Close();
            MessageBox.Show(listAdmins.Quantity.ToString() + " Admins were added to a xml document !");
        }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #5
0
        /// <summary>
        /// Constructor that takes the director as an object and three arguments
        /// </summary>
        public clsNationalBank(string vNumber, string vName, string vLastName, double vSalary, string vPhoto, string vBankName, string vBankAddress, double vBankCapital)
        {
            // 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;
            ListAdmins     = vListAdmins;
        }