コード例 #1
0
 public void AddRecordToRepo(LandingSite ls)
 {
     if (ls == null)
     {
         throw new ArgumentNullException("Error: The argument is Null");
     }
     LandingSiteCollection.Add(ls);
 }
コード例 #2
0
        public bool AddRecordToRepo(LandingSite ls)
        {
            if (ls == null)
            {
                throw new ArgumentNullException("Error: The argument is Null");
            }

            LandingSiteCollection.Add(ls);

            return(_editSuccess);
        }
コード例 #3
0
        public void DeleteRecordFromRepo(LandingSite ls)
        {
            if (ls == null)
            {
                throw new Exception("Landing site cannot be null");
            }

            int index = 0;

            while (index < LandingSiteCollection.Count)
            {
                if (LandingSiteCollection[index].ID == ls.ID)
                {
                    LandingSiteCollection.RemoveAt(index);
                    break;
                }
                index++;
            }
        }
コード例 #4
0
        public void DeleteRecordFromRepo(string id)
        {
            if (id == null)
            {
                throw new Exception("Record ID cannot be null");
            }

            int index = 0;

            while (index < LandingSiteCollection.Count)
            {
                if (LandingSiteCollection[index].LandingSiteID == id)
                {
                    LandingSiteCollection.RemoveAt(index);
                    break;
                }
                index++;
            }
        }
コード例 #5
0
 public LandingSite GetLandingSite(int id)
 {
     return(LandingSiteCollection.FirstOrDefault(t => t.ID == id));
 }
コード例 #6
0
 public List <LandingSite> GetAll()
 {
     return(LandingSiteCollection.OrderBy(t => t.Name).ToList());
 }
コード例 #7
0
 public List <LandingSite> GetAllLandingSites()
 {
     return(LandingSiteCollection.ToList());
 }
コード例 #8
0
 public LandingSite GetLandingSite(string landingSiteID)
 {
     return(LandingSiteCollection.FirstOrDefault(n => n.LandingSiteID == landingSiteID));
 }