public DataTable FetchAll(int formId, string orderfield, bool orderdesc) { ViewableFileCollection orderedFiles = new ViewableFileCollection(formId); orderedFiles.LoadAll(); // if (!orderdesc) // orderedFiles.AddRange(FileCollection.LoadAll(formId).OrderBy(file => file.GetStoredValue(orderfield))); // else // orderedFiles.AddRange(FileCollection.LoadAll(formId).OrderByDescending(file => file.GetStoredValue(orderfield))); return orderedFiles.ToDataTable(); }
protected void Page_Load(object sender, EventArgs e) { int fileid = 0; bool fileidspecified = (int.TryParse(this.Request.Params["file"], out fileid)); if (fileidspecified) { this.file = ViewableFileCollection.GetFile(fileid); } else { throw new Exception("FCIF ID not specified"); } }
protected void Page_Load(object sender, EventArgs e) { int fileid = 0; bool fileidspecified = (int.TryParse(this.Request.Params["file"], out fileid)); if (fileidspecified) { this.file = ViewableFileCollection.GetFile(fileid); this.EditLink.NavigateUrl = string.Format("Editor.aspx?file={0}&form={1}", fileid, this.file.FormId); this.PreviousLink.Visible = false; this.NextLink.Visible = false; } else { throw new Exception("FCIF ID not specified"); } }
private bool LoadFile() { this.File = ViewableFileCollection.GetFile(this.FileId); return(this.File != null); }
public DataTable FetchAllOrderedByCreatedOn(int formId) { var dt = new ViewableFileCollection(formId).LoadAll().ToDataTable(); dt.DefaultView.Sort = "createdon desc"; return dt.DefaultView.ToTable(); }