Exemplo n.º 1
0
 public static List<MasterExemption_DTO> GetMasterExemption_For(AdministrativeProperties_DTO administrativProperties)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Where(qe=>qe.OnlineExemptionID == administrativProperties.OnlineExemptionID).ToList();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public static List<MasterExemption_DTO> GetMasterExemptionsList_For(List<AdministrativeProperties_DTO> administraiveProperties_collcetion)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             var mes = new List<MasterExemption_DTO>();
             foreach (var ap in administraiveProperties_collcetion)
             {
                 var me = context.MasterExemptions.FirstOrDefault(m => m.OnlineExemptionID == ap.OnlineExemptionID);
                 if(me != null && me.QuickrefID == ap.QuickrefID)
                     mes.Add(me);
                 else
                 {
                     var ex = new Exception("An Orphaned Item exists in the database.")
                         .Log("ID = " + ap.ID + "\n OnlineExemptionId = " + ap.OnlineExemptionID);
                 }
             }
             return mes;
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Exemplo n.º 3
0
 public static MasterExemption_DTO GetMasterExemption_For(int onlinePropertyId)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.FirstOrDefault(qe=>qe.OnlineExemptionID == onlinePropertyId);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public static List<MasterExemption_DTO> GetMasterExemptionsList_For(string quickRefId)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Where(qe => qe.QuickrefID == quickRefId).ToList();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
 public static List<MasterExemption_DTO> GetMasterExemptionsList_For(DateTime createdDate)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Where(qe => qe.Created.Date == createdDate.Date).ToList();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
        public static List<MasterExemption_DTO> GetAll(Func<MasterExemption_DTO, bool> func = null)
        {
            try
            {
                using (var context = new MasterHSContext())
                {
                    if(func != null)
                        return context.MasterExemptions.Where(func).ToList();
                    return context.MasterExemptions.ToList();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Exemplo n.º 7
0
 public static List<MasterExemption_DTO> GetMasterExemptionsList_Exclude(List<AdministrativeProperties_DTO> administraiveProperties_collcetion)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             var mes =  context.MasterExemptions.ToList();
             foreach (var ap in administraiveProperties_collcetion)
                 mes.RemoveAll(me => me.OnlineExemptionID == ap.OnlineExemptionID);
             return mes;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 8
0
 public static bool Exists(Func<MasterExemption_DTO, bool> func)
 {
     using (var context = new MasterHSContext())
     {
         return context.MasterExemptions.Any(func);
     }
 }
Exemplo n.º 9
0
 public static bool Exists(int onlineExemptionId)
 {
     using (var context = new MasterHSContext())
     {
         return context.MasterExemptions.Any(me => me.OnlineExemptionID == onlineExemptionId);
     }
 }
Exemplo n.º 10
0
 public static int Count(DateTime createdDate)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Count(me=> DbFunctions.TruncateTime(me.Created) == createdDate.Date);
         }
     }
     catch (Exception ex)
     {
         return 0;
     }
 }
Exemplo n.º 11
0
 public static int Count(Func<MasterExemption_DTO, bool> func)
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Count(func);
         }
     }
     catch (Exception ex)
     {
         return 0;
     }
 }
Exemplo n.º 12
0
 public static int Count()
 {
     try
     {
         using (var context = new MasterHSContext())
         {
             return context.MasterExemptions.Count();
         }
     }
     catch (Exception ex)
     {
         return 0;
     }
 }