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));
        }
        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);
        }
示例#3
0
 public AttachmentController(IDeliveryBlProvider deliveryBlProvider, ISettingsBlProvider settingsBlProvider, IAttachmentBlProvider attachmentBlProvider, IConfiguration cfg, IUserBlProvider userBlProvider) : base(cfg, userBlProvider)
 {
     _settingsBlProvider   = settingsBlProvider;
     _attachmentBlProvider = attachmentBlProvider;
     IndexModel            = new AttachmentIndexModel();
 }