Ejemplo n.º 1
0
 public List <MyGuest> MyGest_List()
 {
     if (Dal_XML_imp.GetGuestFromXml() == null)
     {
         throw new NotImplementedException("רשימת אורחים ריקה");
     }
     return(Dal_XML_imp.GetGuestFromXml().Select(hu => (MyGuest)hu.Clone()).ToList());
 }
Ejemplo n.º 2
0
        MyGuest IDAL.getMyGuest(int Location_list)
        {
            if (Location_list >= 0)

            {
                return(Dal_XML_imp.GetGuestFromXml(Location_list));
            }
            else
            {
                throw new NotImplementedException("האורח לא נמצא במערכת");
            }
        }
Ejemplo n.º 3
0
        public int FindMyGuest(string id)
        {
            int  Location = 0;
            bool help     = false;

            foreach (var item in Dal_XML_imp.GetGuestFromXml())
            {
                if (item.Id == id)
                {
                    help = true;
                    return(Location);
                }
                Location++;
            }
            if (help == false)
            {
                throw new NotImplementedException("האורח לא נמצא במערכת");
            }
            return(0);
        }
Ejemplo n.º 4
0
        public void AddGuest(MyGuest My_Guest)
        {
            bool ezer = false;

            foreach (var item in Dal_XML_imp.GetGuestFromXml())
            {
                if (item.Id == My_Guest.Id)
                {
                    ezer = true;
                }
            }
            if (ezer == false) //אין את הלקוח ברשימה
            {
                Dal_XML_imp.AddGuestToXml(My_Guest.Clone());
            }
            else
            {
                throw new NotImplementedException("האורח כבר רשום במערכת");
            }
        }