private IEnumerable <Record> GetRecordsWithoutServiceline(RefreshDataParameters parameters) { var recordManager = new RecordManager(); var records = recordManager.GetData(parameters); return(records.Where(i => i.RecordId < records.Max(j => j.RecordId))); }
public PartialViewResult RefreshData(RefreshDataParameters parameters) { // Checks for null and if yes - replaces with the defaults parameters.SortingColumn = parameters.SortingColumn ?? Settings.DefaultSortingColumn; parameters.SortingDirection = parameters.SortingDirection ?? Settings.DefaultSortingDirection; // Pull the records from database var recordManager = new RecordManager(); var rec = recordManager.GetData(parameters); // Get list of available attachments and mofy a corresponding Record with it Dictionary <int, string> attchments = AttachmentManager.GetAttachments(); foreach (var record in rec) { record.Attachment = attchments.ContainsKey(record.RecordId) ? attchments[record.RecordId] : String.Empty; } // Set total amount message and erturn a aprtial view ViewBag.Amount = string.Format("Total {0} records.", rec.Count() - 1); // Add sorting column and direction to viewbag in orger to indicate the column by displaying appropriate arrow right hand side from its name ViewBag.SortingColumn = parameters.SortingColumn.ToLower().Trim(); ViewBag.SortingDirection = parameters.SortingDirection; return(PartialView("_Data", rec)); }
public CSV(RefreshDataParameters parameters) { this.parameters = parameters; }
public IEnumerable <Record> GetData(RefreshDataParameters parameters) { return(DataBase <Record> .GetModel <Record>(Settings.StoredProcedures.RecordsGet, parameters.SqlParameters).Values); }
public FileContentResult Csv(RefreshDataParameters parameters) { var csv = new CSV(parameters); return(File(csv.GetBytes(), Settings.CSV.MimeType, Settings.CSV.FileDownloadName)); }