// GET: ReportDataSet public ActionResult Index() { IEnumerable <ReportDataSetModel> result = new List <ReportDataSetModel>(); using (Muse db = new Muse()) { List <ReportDataSourceModel> DataSourceList = db.Gets <ReportDataSourceModel>(x => x.CreateUser == User.Identity.Name, null).OrderBy(x => x.Name).ToList(); ViewBag.DataSourceList = DataSourceList; result = db.Gets <ReportDataSetModel>(x => x.CreateUser == User.Identity.Name, new[] { "ReportDataSourceModel" }); } return(View(result)); }
private void FileRestoreForm_Load(object sender, EventArgs e) { //读取该文件的备份记录 using (var db = new Muse()) { Files = db.Gets <BackupFiles>(x => x.FullPath == FilePath, null).OrderBy(x => x.Id).ToList(); } if (ListTool.HasElements(Files)) { //获取文件名及路径信息 var first = Files.FirstOrDefault(); LbFileName.Text = Path.GetFileName(first.FullPath); LbPath.Text = first.FullPath; LbVersion.Text = "共 " + Files.Count + " 版"; TtLabel.SetToolTip(LbFileName, Path.GetFileName(first.FullPath)); TtLabel.SetToolTip(LbPath, first.FullPath); //显示所有备份记录 int index = 1; foreach (var file in Files) { DgvFiles.Rows.Add(string.Format("第 {0} 版", index++), file.LastWriteTime, ByteConvertTool.Fmt(file.Size)); } } }
// GET: ReportDataSet/Create public ActionResult Create() { using (Muse db = new Muse()) { List <ReportDataSourceModel> DataSourceList = db.Gets <ReportDataSourceModel>(x => x.CreateUser == User.Identity.Name, null).OrderBy(x => x.Name).ToList(); ViewBag.DataSourceList = DataSourceList; return(View()); } }
// GET: ReportDataSet/Edit/5 public ActionResult Edit(Guid id) { using (Muse db = new Muse()) { List <ReportDataSourceModel> DataSourceList = db.Gets <ReportDataSourceModel>(x => x.CreateUser == User.Identity.Name, null).OrderBy(x => x.Name).ToList(); ViewBag.DataSourceList = DataSourceList; var record = db.Get <ReportDataSetModel>(x => x.Id == id, null); return(View(record)); } }
// GET: ReportPage public ActionResult Index() { IEnumerable <ReportPageModel> result = new List <ReportPageModel>(); using (Muse db = new Muse()) { result = db.Gets <ReportPageModel>(x => x.CreateUser == User.Identity.Name, null).OrderBy(x => x.Name); } return(View(result)); }
/// <summary> /// 获取带GPS信息的照片 /// </summary> /// <returns></returns> public static List <Pictures> GetPictures() { List <Pictures> list = new List <Pictures>(); using (Muse db = new Muse("pictures")) { var _temp = db.Gets <Pictures>(x => x.GpsLongitude != 0 && x.GpsLatitude != 0, null).ToList(); if (ListTool.HasElements(_temp)) { list = _temp; } } return(list); }
// GET: ReportPage/Details/5 public ActionResult Details(Guid id) { using (Muse db = new Muse()) { ReportPageModel record = db.Get <ReportPageModel>(x => x.Id == id, new[] { "ReportOptionModels", "ReportOptionModels.ReportDataSetModel", "ReportOptionModels.ReportDataSetModel.ReportDataSourceModel" }); record.ReportOptions = record.ReportOptions.OrderBy(x => x.Row).ThenBy(x => x.Column).ToList(); List <ReportDataSourceModel> DataSourceList = db.Gets <ReportDataSourceModel>(x => x.CreateUser == User.Identity.Name, new[] { "ReportDataSetModels" }).ToList(); ViewBag.DataSourceList = DataSourceList; ViewBag.ReportOptionTypeList = ReportOptionTypeList; return(View(record)); } }
/// <summary> /// 删除超过备份最大次数的项 /// </summary> private void DeleteExcess(string path) { using (var db = new Muse()) { int count = db.Do <BackupFiles>().Count(x => x.FullPath == path); if (count >= R.Settings.FileBackup.BACK_UP_COUNT) { var fs = db.Gets <BackupFiles>(x => x.FullPath == path, null).OrderBy(x => x.Id).ToList(); if (ListTool.HasElements(fs)) { for (int i = 0; i <= count - R.Settings.FileBackup.BACK_UP_COUNT; i++) { try { File.Delete(fs[i].BackupFullPath); db.Del(fs[i], true); } catch (Exception e) { } } } } } }