Пример #1
0
        public ActionResult Performance(PerformanceModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.ImageCDN             = model.ImageCDN == null ? "" : model.ImageCDN;
                mallConfigInfo.CSSCDN               = model.CSSCDN == null ? "" : model.CSSCDN;
                mallConfigInfo.ScriptCDN            = model.ScriptCDN == null ? "" : model.ScriptCDN;
                mallConfigInfo.OnlineUserExpire     = model.OnlineUserExpire;
                mallConfigInfo.UpdateOnlineTimeSpan = model.UpdateOnlineTimeSpan;
                mallConfigInfo.MaxOnlineCount       = model.MaxOnlineCount;
                mallConfigInfo.OnlineCountExpire    = model.OnlineCountExpire;
                mallConfigInfo.IsStatBrowser        = model.IsStatBrowser;
                mallConfigInfo.IsStatOS             = model.IsStatOS;
                mallConfigInfo.IsStatRegion         = model.IsStatRegion;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改性能设置");
                return(PromptView(Url.Action("performance"), "修改性能设置成功"));
            }
            return(View(model));
        }
Пример #2
0
        private static void ParsePerformanceProperties(PerformanceModel model)
        {
            // set FetchSize
            OracleConfiguration.FetchSize = model.FetchSize;

            // set LoadBalancing
            OracleConfiguration.LoadBalancing = model.LoadBalancing;

            // set MaxStatementCacheSize
            OracleConfiguration.MaxStatementCacheSize = model.MaxStatementCacheSize;

            // set ReceiveBufferSize
            OracleConfiguration.ReceiveBufferSize = model.ReceiveBufferSize;

            // set SelfTuning
            OracleConfiguration.SelfTuning = model.SelfTuning;

            // set SendBufferSize
            OracleConfiguration.SendBufferSize = model.SendBufferSize;

            // set StatementCacheSize
            OracleConfiguration.StatementCacheSize = model.StatementCacheSize;

            // set TcpNoDelay
            OracleConfiguration.TcpNoDelay = model.TcpNoDelay;
        }
Пример #3
0
        public List <PerformanceModel> getYearScoreByuser(string year, string userid)
        {
            var db    = new RepositoryFactory().BaseRepository();
            var query = from q1 in db.IQueryable <PerformancetitleSecondEntity>()
                        join q2 in db.IQueryable <PerformanceSecondEntity>() on q1.titleid equals q2.titleid
                        where q1.useyear == year && q2.userid == userid
                        orderby q1.usetime ascending
                        select new { q1.usetime, q1.name, q2.score, ScoreSort = q2.sort, q2.performanceid, q1.useyear };

            var dataList = query.ToList();
            List <PerformanceModel> modelList = new List <PerformanceModel>();

            if (dataList != null && dataList.Count > 0)
            {
                dataList.ForEach(p => {
                    PerformanceModel perf = new PerformanceModel()
                    {
                        PerformanceId = p.performanceid,
                        Month         = p.useyear,
                        Title         = p.name,
                        UseTime       = p.usetime.ToString("yyyy-MM-DD")
                    };
                    string scoreStr = string.Empty;
                    var scoreList   = p.score.Split(',').ToList();
                    p.ScoreSort.Split(',').ToList().ForEach(x => {
                        scoreStr += scoreList[int.Parse(x)] + ",";
                    });
                    perf.Score = scoreStr.TrimEnd(',');
                    modelList.Add(perf);
                });
            }
            return(modelList);
        }
Пример #4
0
        public ActionResult Performance(PerformanceModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

                shopConfigInfo.ImageCDN             = model.ImageCDN == null ? "" : model.ImageCDN;
                shopConfigInfo.CSSCDN               = model.CSSCDN == null ? "" : model.CSSCDN;
                shopConfigInfo.ScriptCDN            = model.ScriptCDN == null ? "" : model.ScriptCDN;
                shopConfigInfo.OnlineUserExpire     = model.OnlineUserExpire;
                shopConfigInfo.UpdateOnlineTimeSpan = model.UpdateOnlineTimeSpan;
                shopConfigInfo.MaxOnlineCount       = model.MaxOnlineCount;
                shopConfigInfo.OnlineCountExpire    = model.OnlineCountExpire;
                shopConfigInfo.UpdatePVStatTimespan = model.UpdatePVStatTimespan;
                shopConfigInfo.IsStatBrowser        = model.IsStatBrowser;
                shopConfigInfo.IsStatOS             = model.IsStatOS;
                shopConfigInfo.IsStatRegion         = model.IsStatRegion;

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改性能设置");
                return(PromptView(Url.Action("performance"), "修改性能设置成功"));
            }
            return(View(model));
        }
Пример #5
0
        public async Task <PerformanceModel> GetPerformances(Int32 page, Int32 count, DateTime?date, String nameSearch)
        {
            PerformanceModel model = new PerformanceModel();

            model.Performances = await helper.GetPerformances(page, count, date, nameSearch);

            model.Total = await helper.GetTotal(date, nameSearch);

            return(model);
        }
Пример #6
0
        public async Task <PerformanceModel> GetPerformances(Int32 page, Int32 count, DateTime?date, String nameSearch)
        {
            PerformanceModel model = new PerformanceModel
            {
                Performances = await helper.GetPerformances(page, count, date, nameSearch).ConfigureAwait(false),
                Total        = await helper.GetTotal(date, nameSearch).ConfigureAwait(false)
            };

            return(model);
        }
Пример #7
0
        private void OnUpdateTimerCallback(object state)
        {
            List <Tuple <string, double> > input = PerformanceModel.GetAllProcessCpuUsage();

            if ((input != null) && (input.Count > 0))
            {
                int numberToDraw = (Settings.Default.ProcessNumberOfProcesses > input.Count ? input.Count : Settings.Default.ProcessNumberOfProcesses);
                Processes = input.GetRange(0, numberToDraw).Select(item => new SingleProcess()
                {
                    Name = item.Item1, Percent = item.Item2
                }).ToList();
            }
        }
Пример #8
0
 public IHttpActionResult GetAllPerformances()
 {
     try
     {
         IEnumerable <PerformanceDTO> performancesDTO = _performanceService.GetAllPerformances();
         List <PerformanceModel>      performances    = new List <PerformanceModel>();
         foreach (PerformanceDTO p in performancesDTO)
         {
             PerformanceModel perf = _mapper.Map <PerformanceModel>(p);
             performances.Add(perf);
         }
         return(Ok(performances));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
Пример #9
0
        public IHttpActionResult CreatePerformance(PerformanceModel performanceModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            PerformanceDTO performance = _mapper.Map <PerformanceDTO>(performanceModel);

            try
            {
                _performanceService.CratePerformance(performance);
                return(Ok("Performance was created"));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Пример #10
0
        public ActionResult Performance()
        {
            MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

            PerformanceModel model = new PerformanceModel();

            model.ImageCDN             = mallConfigInfo.ImageCDN;
            model.CSSCDN               = mallConfigInfo.CSSCDN;
            model.ScriptCDN            = mallConfigInfo.ScriptCDN;
            model.OnlineUserExpire     = mallConfigInfo.OnlineUserExpire;
            model.UpdateOnlineTimeSpan = mallConfigInfo.UpdateOnlineTimeSpan;
            model.MaxOnlineCount       = mallConfigInfo.MaxOnlineCount;
            model.OnlineCountExpire    = mallConfigInfo.OnlineCountExpire;
            model.IsStatBrowser        = mallConfigInfo.IsStatBrowser;
            model.IsStatOS             = mallConfigInfo.IsStatOS;
            model.IsStatRegion         = mallConfigInfo.IsStatRegion;

            return(View(model));
        }
Пример #11
0
        public ActionResult Performance()
        {
            ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

            PerformanceModel model = new PerformanceModel();

            model.ImageCDN             = shopConfigInfo.ImageCDN;
            model.CSSCDN               = shopConfigInfo.CSSCDN;
            model.ScriptCDN            = shopConfigInfo.ScriptCDN;
            model.OnlineUserExpire     = shopConfigInfo.OnlineUserExpire;
            model.UpdateOnlineTimeSpan = shopConfigInfo.UpdateOnlineTimeSpan;
            model.MaxOnlineCount       = shopConfigInfo.MaxOnlineCount;
            model.OnlineCountExpire    = shopConfigInfo.OnlineCountExpire;
            model.UpdatePVStatTimespan = shopConfigInfo.UpdatePVStatTimespan;
            model.IsStatBrowser        = shopConfigInfo.IsStatBrowser;
            model.IsStatOS             = shopConfigInfo.IsStatOS;
            model.IsStatRegion         = shopConfigInfo.IsStatRegion;

            return(View(model));
        }
Пример #12
0
        /// <summary>
        /// Get ranged performance models.
        /// </summary>
        /// <param name="models"></param>
        /// <returns></returns>
        private List <PerformanceModel> GetRanged(IEnumerable <PerformanceModel> models)
        {
            IEnumerable <PerformanceModel> orderedModels = models.OrderBy(s => s.CostTime = s.EndTime - s.StartTime);

            for (int i = 0; i < orderedModels.Count(); i++)
            {
                PerformanceModel model = orderedModels.ElementAt(i);
                model.Index = i + 1;

                switch (i)
                {
                case 0:
                {
                    model.Background = Colors.Gold;
                    model.ImageUri   = new Uri(@"/ModernSudoku;component/Images/gold.png", UriKind.RelativeOrAbsolute);
                } break;

                case 1:
                {
                    model.Background = Colors.Silver;
                    model.ImageUri   = new Uri(@"/ModernSudoku;component/Images/silver.png", UriKind.RelativeOrAbsolute);
                } break;

                case 2:
                {
                    model.Background = Colors.Orange;
                    model.ImageUri   = new Uri(@"/ModernSudoku;component/Images/cu.png", UriKind.RelativeOrAbsolute);
                } break;

                default:
                {
                    model.Background = Colors.LightSalmon;
                    model.ImageUri   = new Uri(@"/ModernSudoku;component/Images/Star.png", UriKind.RelativeOrAbsolute);
                } break;
                }
            }

            return(orderedModels.ToList());
        }
Пример #13
0
        public CollaboratorModel initCollaborator(t_collaborator c)
        {
            CollaboratorModel collab;


            collab = new DevelopperModel();

            ////////////////////superviser////////////////
            ManagerModel superviser = new ManagerModel();

            superviser.C_Forname  = c.superViser.t_collaborator.C_Forname;
            superviser.C_Lastname = c.superViser.t_collaborator.C_Lastname;
            collab.superviser     = superviser;
            /////////////////////////////////////////////////////


            collab.C_Age      = c.C_Age;
            collab.C_email    = c.C_email;
            collab.C_Forname  = c.C_Forname;
            collab.C_Lastname = c.C_Lastname;

            //performance notes //////////////////////
            PerformanceModel perf = new PerformanceModel();

            perf.gloabalAutoNote   = c.t_performancenote.ElementAt(0).gloabalAutoNote;
            perf.global360Note     = c.t_performancenote.ElementAt(0).global360Note;
            perf.globalPerformance = c.t_performancenote.ElementAt(0).globalPerformance;
            //rankkkkkkkkkkkkkkkk/////////////////
            perf.RankingAuto   = c.t_performancenote.ElementAt(0).rank.RankingAuto;
            perf.Ranking360    = c.t_performancenote.ElementAt(0).rank.Ranking360;
            perf.globalRanking = c.t_performancenote.ElementAt(0).rank.globalRanking;

            collab.performance = perf;
            //////////////////////////////////////////////////////


            return(collab);
        }
Пример #14
0
 public SavedModel(ParametersModel parameters, PerformanceModel tested, PerformanceModel trained)
 {
     Parameters         = parameters;
     TestedPerformance  = tested;
     TrainedPerformance = trained;
 }
Пример #15
0
        public ActionResult Performance()
        {
            ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

            PerformanceModel model = new PerformanceModel();
            model.ImageCDN = shopConfigInfo.ImageCDN;
            model.CSSCDN = shopConfigInfo.CSSCDN;
            model.ScriptCDN = shopConfigInfo.ScriptCDN;
            model.OnlineUserExpire = shopConfigInfo.OnlineUserExpire;
            model.UpdateOnlineTimeSpan = shopConfigInfo.UpdateOnlineTimeSpan;
            model.MaxOnlineCount = shopConfigInfo.MaxOnlineCount;
            model.OnlineCountExpire = shopConfigInfo.OnlineCountExpire;
            model.UpdatePVStatTimespan = shopConfigInfo.UpdatePVStatTimespan;
            model.IsStatBrowser = shopConfigInfo.IsStatBrowser;
            model.IsStatOS = shopConfigInfo.IsStatOS;
            model.IsStatRegion = shopConfigInfo.IsStatRegion;

            return View(model);
        }
Пример #16
0
 public void LogLoadTimes(PerformanceModel perf)
 {
 }
Пример #17
0
        public ActionResult Performance(PerformanceModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

                shopConfigInfo.ImageCDN = model.ImageCDN == null ? "" : model.ImageCDN;
                shopConfigInfo.CSSCDN = model.CSSCDN == null ? "" : model.CSSCDN;
                shopConfigInfo.ScriptCDN = model.ScriptCDN == null ? "" : model.ScriptCDN;
                shopConfigInfo.OnlineUserExpire = model.OnlineUserExpire;
                shopConfigInfo.UpdateOnlineTimeSpan = model.UpdateOnlineTimeSpan;
                shopConfigInfo.MaxOnlineCount = model.MaxOnlineCount;
                shopConfigInfo.OnlineCountExpire = model.OnlineCountExpire;
                shopConfigInfo.UpdatePVStatTimespan = model.UpdatePVStatTimespan;
                shopConfigInfo.IsStatBrowser = model.IsStatBrowser;
                shopConfigInfo.IsStatOS = model.IsStatOS;
                shopConfigInfo.IsStatRegion = model.IsStatRegion;

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改性能设置");
                return PromptView(Url.Action("performance"), "修改性能设置成功");
            }
            return View(model);
        }
Пример #18
0
 public PerformanceViewModel()
 {
     this.Performances = this.GetRanged(PerformanceOperation.GetGeneral());
     this.SelectedItem = this.Performances.FirstOrDefault();
 }