Exemplo n.º 1
0
 public EntityFramework.Impact GetImpactByID(Guid id)
 {
     try
     {
         EntityFramework.Impact impactsMatchingId = _ImpactRecords.GetAll().Where(c => c.ImpactId == id).FirstOrDefault();
         return(impactsMatchingId);
     }
     catch (Exception ex)
     {
         throw new Exception("Failure getting Impact", ex);
     }
 }
Exemplo n.º 2
0
        public bool UpdateImpactRecord(EntityFramework.Impact impact)
        {
            try
            {
                _ImpactRecords.Update(impact);
                _uow.Save();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw new Exception("Failure getting Customer", ex);
            }
        }
Exemplo n.º 3
0
        public EntityFramework.Impact CreateImpact(EntityFramework.Impact impactToCreate)
        {
            try
            {
                _ImpactRecords.Add(impactToCreate);
                _uow.Save();
                EntityFramework.Impact retrievedImpact = GetImpactByID(impactToCreate.ImpactId);

                return(retrievedImpact);
            }
            catch (Exception ex)
            {
                return(null);

                throw new Exception("Failure creating Impact", ex);
            }
        }