Esempio n. 1
0
        public bool Add(Employee item)
        {
            var IsAdded = false;

            try
            {
                _dbContext.Employees.Add(item);
                IsAdded = _dbContext.SaveChanges() > 0;
            }
            catch (Exception ex)
            {
                throw new ProjectManagerException("error adding data" + ex);
            }
            return(IsAdded);
        }
Esempio n. 2
0
 public bool Add(Project obj)
 {
     try
     {
         if (obj != null)
         {
             objContext.Projects.Add(obj);
             return(objContext.SaveChanges() > 0);
         }
         else
         {
             throw new ProjectManagerException("No Project to add");
         }
     }
     catch (ProjectManagerException e)
     {
         throw e;
     }
 }