Exemplo n.º 1
0
        static Boolean AddReserve(Flat flat_temp, Customer client)
        {
            Address ads = ListOfFlat[flat_temp];

            ListOfFreeFlat[ads] = client;

            return(true);
        }
Exemplo n.º 2
0
        static Boolean AddFlat(Flat obj, Address ads)
        {
            if (ListOfFlat.ContainsKey(obj))
            {
                Console.WriteLine("This flat contains data base!!!");
                return(false);
            }

            try
            {
                ListOfFlat.Add(obj, ads);
                ListOfFreeFlat.Add(ads, new Customer());
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }

            return(false);
        }
Exemplo n.º 3
0
        static Boolean deleteFlat(Flat obj)
        {
            if (ListOfFlat.ContainsKey(obj) == false)
            {
                Console.WriteLine("This flat doesn't contains data base!!!");
                return(false);
            }
            Address ads = ListOfFlat[obj];

            try
            {
                ListOfFreeFlat.Remove(ads);
                ListOfFlat.Remove(obj);
            }
            catch (ArgumentNullException e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }


            return(true);
        }
Exemplo n.º 4
0
 static Boolean EditFlat(Flat flat_temp, Address new_ads)
 {
     ListOfFlat[flat_temp] = new_ads;
     return(true);
 }