Пример #1
0
 public static void WriteToXML()
 {
     using (TextWriter writer = new StreamWriter("Bank.xml"))
     {
         XmlSerializer serializer = new XmlSerializer(typeof(List <Branch>));
         serializer.Serialize(writer, Bank.GetBranches());
     }
 }
Пример #2
0
        public static void GetBranchCustomers(Branch branch)
        {
            List <Branch> branches = Bank.GetBranches();

            for (int i = 0; i < branches.Count; i++)
            {
                if (branches[i].Address == branch.Address)
                {
                    customers = branch.Customers;
                }
            }
        }
Пример #3
0
        public void ShowBranch()
        {
            lstBranches.Items.Clear();
            branchesList     = Bank.GetBranches();
            branchDictionary = new Dictionary <string, Branch> {
            };

            for (int i = 0; i < branchesList.Count(); i++)
            {
                branchDictionary.Add(branchesList[i].Address.ToString(), branchesList[i]);
                lstBranches.Items.Add(branchesList[i].Address);
            }
            //Bank.WriteToXML();
            Bank.WriteToXML();
        }