Example #1
0
 public static BackgroundJob FindBackgroundJob(int Id, string Symbol)
 {
     using (PepperContext context = new PepperContext())
     {
         return(context.BackgroundJobs.FirstOrDefault(type => type.EntityID == Id && type.Symbol == Symbol));
     }
 }
Example #2
0
        public static List <EquityRes> GetSymbol()
        {
            List <EquityRes> Symbol;

            using (PepperContext context = new PepperContext())
            {
                Symbol = (from q in context.Equities
                          join t in context.AppStoreEntityApps
                          on q.EntityID equals t.EntityID
                          where
                          t.IsEnabled == true &&
                          t.AppStoreAppID == (int)AppStoreApplicationType.YahooFinance &&    // yahoo finance app id
                          q.Symbol != null
                          group q by new
                {
                    q.Symbol,
                    q.EntityID
                } into g
                          select new EquityRes
                {
                    Symbol = g.Key.Symbol,
                    EntityId = g.Key.EntityID
                }).Distinct().ToList();
            }
            return(Symbol);
        }
Example #3
0
        public static List <AuditLog> GetAuditLog(int lastProcessedToRecordIdentifier)
        {
            List <AuditLog> auditLog = new List <AuditLog>();

            using (PepperContext context = new PepperContext())
            {
                auditLog = (from q in context.AuditLogs
                            where q.AuditLogID > lastProcessedToRecordIdentifier
                            select q).ToList();
            }
            return(auditLog);
        }
Example #4
0
        public static USER GetUserName(int userID)
        {
            USER user = new USER();

            using (PepperContext context = new PepperContext())
            {
                user = (from row in context.USERs
                        where row.UserID == userID
                        select row).FirstOrDefault();
            }

            return(user);
        }
Example #5
0
        public static List <AppStoreEntityAppConfiguration> GetConfig(int entityID)
        {
            List <AppStoreEntityAppConfiguration> config = new List <AppStoreEntityAppConfiguration>();

            using (PepperContext context = new PepperContext())
            {
                config = (from aec in context.AppStoreEntityAppConfigurations
                          join asea in context.AppStoreEntityApps
                          on aec.AppStoreEntityAppID equals asea.AppStoreEntityAppID
                          where asea.EntityID == entityID &&
                          asea.IsEnabled == true && asea.AppStoreAppID == (int)AppStoreApplicationType.Slack
                          select aec).ToList();
            }
            return(config);
        }
Example #6
0
        public static List <IntegrationJob> GetSlackJob()
        {
            List <IntegrationJob> slackJob = new List <IntegrationJob>();

            using (PepperContext context = new PepperContext())
            {
                try
                {
                    slackJob = (from q in context.IntegrationJobs
                                where q.JobId == (int)JobIds.Slack
                                select q).ToList();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
            return(slackJob);
        }