public ActionResult Index(int?sourceType, int?sourceId, string sortBy, string sortOrder)
        {
            var model = new AttachmentIndexModel();

            model.Tab = "Task";

            model.SortBy    = sortBy ?? "Name";
            model.SortOrder = sortOrder ?? "ASC";
            model.SortableColumns.Add("Name", "Name");

            var criteria = new AttachmentCriteria()
            {
                SourceType = DataHelper.ToSourceType(sourceType)
            };

            var attachments = AttachmentService.AttachmentFetchInfoList(criteria)
                              .AsQueryable();

            attachments = attachments.OrderBy(string.Format("{0} {1}", model.SortBy, model.SortOrder));

            model.Attachments = attachments;

            return(this.View(model));
        }
示例#2
0
 public static AttachmentInfoList AttachmentFetchInfoList(AttachmentCriteria criteria)
 {
     return(AttachmentInfoList.FetchAttachmentInfoList(criteria));
 }