示例#1
0
        /// <summary>
        /// Creating reports for each type of action(Validation,Merge,Building xml-tree and etc)
        /// </summary>
        /// <param name="startedOn"></param>
        /// <param name="productId"></param>
        /// <param name="type"></param>
        /// <param name="additionalInfo"></param>
        public void CreateSuccessSchedulerHistory(DateTime startedOn, int?productId, SchedulerTypes type, string additionalInfo)
        {
            _shedulerHistoryRepository.Insert(new SchedulerHistory
            {
                ArrivalMessageId = null,
                CreatedBy        = "Admin",
                FinishedOn       = DateTime.UtcNow,
                CreatedOn        = DateTime.UtcNow,
                IsActive         = true,
                Type             = (int)type,
                ProductId        = productId,
                StartedOn        = startedOn,

                AdditionalInfo = additionalInfo,

                IsByError    = false,
                ErrorMessage = ""
            });
        }
示例#2
0
        public static async Task <ResponseBase <List <AllWidgetDropDowns> > > DashboardAddDropDowns(TeamHttpContext teamHttpContext)
        {
            List <ChartTypes>          objChartTypes            = new List <ChartTypes>();
            List <string>              objUserList              = new List <string>();
            List <SchedulerTypes>      objSchedulerTypes        = new List <SchedulerTypes>();
            List <DBConnectionStrings> objDBConnectionStrings   = new List <DBConnectionStrings>();
            List <AllWidgetDropDowns>  objDashboardAddDropDowns = new List <AllWidgetDropDowns>();

            using (TeamDbContext dbContext = new TeamDbContext())
            {
                var charttypes = from ct in dbContext.ChartTypes
                                 select new
                {
                    ChartId   = ct.ChartId,
                    ChartName = ct.ChartName
                };
                foreach (var item in charttypes)
                {
                    ChartTypes chartList = new ChartTypes
                    {
                        ChartId   = item.ChartId,
                        ChartName = item.ChartName
                    };

                    objChartTypes.Add(chartList);
                }

                var userlists = from ul in dbContext.Users
                                select new
                {
                    UserId = ul.UserId
                };
                foreach (var item in userlists)
                {
                    objUserList.Add(item.UserId);
                }

                var schedulertypes = from sd in dbContext.Schedulers
                                     select new
                {
                    Id            = sd.Id,
                    SchedulerName = sd.SchedulerName
                };
                foreach (var item in schedulertypes)
                {
                    SchedulerTypes schedulerType = new SchedulerTypes
                    {
                        SchedulerId   = item.Id,
                        SchedulerName = item.SchedulerName
                    };

                    objSchedulerTypes.Add(schedulerType);
                }

                var dbconnectionstrings = from dbcs in dbContext.DBConnections
                                          select new
                {
                    DBConnectionId   = dbcs.DBConnectionId,
                    DBConnectionName = dbcs.DBConnectionName
                };

                foreach (var item in dbconnectionstrings)
                {
                    DBConnectionStrings connectionList = new DBConnectionStrings
                    {
                        DBConnectionId   = item.DBConnectionId,
                        DBConnectionName = item.DBConnectionName
                    };

                    objDBConnectionStrings.Add(connectionList);
                }
            }

            AllWidgetDropDowns finallist = new AllWidgetDropDowns
            {
                Charts            = objChartTypes,
                Users             = objUserList,
                Schedulers        = objSchedulerTypes,
                ConnectionStrings = objDBConnectionStrings
            };

            objDashboardAddDropDowns.Add(finallist);

            return(GetTypedResponse(teamHttpContext, objDashboardAddDropDowns));
        }