Ejemplo n.º 1
0
        // GET: Report
        public ActionResult Index()
        {
            using (Muse db = new Muse())
            {
                IEnumerable <ReportDataSourceModel> sources = db.GetAll <ReportDataSourceModel>(new string[] { "ReportDataSetModels" }, false);

                if (Ls.Ok(sources))
                {
                    var    source = sources.First();
                    string cs     = source.ConnectionString;
                    string sql    = source.ReportDataSets.First().Sql;

                    MySqlHelper msHelper = new MySqlHelper(cs);
                    DataTable   a        = msHelper.Select(sql, out int recordsAffected);
                    ReportModel ri       = new ReportModel()
                    {
                        DataTable    = a,
                        ReportOption = new ReportOptionModel()
                        {
                            Title      = "标题XXXXXX",
                            Type       = "ECharts.BasicLineChart",
                            Dimensions = "continent,cts,rgs",
                            SeriesType = "bar,bar",
                            Height     = 400,
                        }
                    };
                    ViewBag.Report = ri;
                }
            }
            return(View());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 读取数据库权限验证配置信息
 /// </summary>
 private void ReadAuthsInfo()
 {
     //if (!Ls.Ok(auths))
     {
         using (Muse db = new Muse())
         {
             auths = db.GetAll <AuthorizeModel>(null, false).ToList();
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 读取备份文件夹列表
 /// </summary>
 private void ReadBackupPaths()
 {
     //读取要备份的文件路径列表
     using (var db = new Muse())
     {
         Paths = db.GetAll <BackupPaths>(null, false).ToList();
         if (ListTool.HasElements(Paths))
         {
             foreach (var p in Paths)
             {
                 AddToWatcherPath(p.Path);
             }
         }
     }
 }