Base solution for your next web application

Activities of "20summers"

Hi,

Instead of using PagedResultDto with JTable (which is awesome), I want to display the users in the system to the other users, in a different layout (see the link). [http://webapplayers.com/homer_admin-v2.0/contacts.html]) How would I use PagedResultDto to do this?

Super excited to see this release when will it be launched this week?

Brilliant - thanks so much!

WIll I have to do something like below or is their an easier way?

private IQueryable<AuditLogAndUser> CreateAuditLogAndUsersQuery(GetAuditLogsInput input)
        {
            var query = from auditLog in _auditLogRepository.GetAll()
                join user in _userRepository.GetAll() on auditLog.UserId equals user.Id into userJoin
                from joinedUser in userJoin.DefaultIfEmpty()
                where auditLog.ExecutionTime >= input.StartDate && auditLog.ExecutionTime <= input.EndDate
                select new AuditLogAndUser {AuditLog = auditLog, User = joinedUser};

            query = query
                .WhereIf(!input.UserName.IsNullOrWhiteSpace(), item => item.User.UserName.Contains(input.UserName))
                .WhereIf(!input.ServiceName.IsNullOrWhiteSpace(), item => item.AuditLog.ServiceName.Contains(input.ServiceName))
                .WhereIf(!input.MethodName.IsNullOrWhiteSpace(), item => item.AuditLog.MethodName.Contains(input.MethodName))
                .WhereIf(!input.BrowserInfo.IsNullOrWhiteSpace(), item => item.AuditLog.BrowserInfo.Contains(input.BrowserInfo))
                .WhereIf(input.MinExecutionDuration.HasValue && input.MinExecutionDuration > 0, item => item.AuditLog.ExecutionDuration >= input.MinExecutionDuration.Value)
                .WhereIf(input.MaxExecutionDuration.HasValue && input.MaxExecutionDuration < int.MaxValue, item => item.AuditLog.ExecutionDuration <= input.MaxExecutionDuration.Value)
                .WhereIf(input.HasException == true, item => item.AuditLog.Exception != null && item.AuditLog.Exception != "")
                .WhereIf(input.HasException == false, item => item.AuditLog.Exception == null || item.AuditLog.Exception == "");
            return query;
        }

Hi,

I have the following foreign key in my model:

public virtual PlanStatus Status { get; set; }
        public int? StatusId { get; set; }

in jTable I can display the StatusId

statusId: {
                title: app.localize("Status"),
                width: "30px",
                display: function (data) {
                    if (data.record.statusId) {
                        console.log(data.record);
                         return data.record.statusId;
                    }

                }
            },

in the PlanStatus model I have a field Status that I want displayed in the jTable.

How do I display it?

Awesome - Thanks - that was the trick :D

I have created document upload functionality.

I can create the record correctly, but wanted to add dropzone.js as the means by which I upload the document see image: [https://goo.gl/photos/ZSVgZCJrHDTBFnBC6])

The ideas is that you populate the Name and Category fields, then drag and drop a file. The file gets submited automatically and gets replaced with a DocumentId (once saved in the database), and then the user clicks save.

My Issue: my _createOrEditModal.js has the following code:

$(".dropzone").dropzone({
    url: "/App/Documents/UploadDocument/",
    uploadMultiple: false,
    paramName: "file",
    parallelUploads: 1,
    maxFiles: 1
});

I keep on getting a code 400 error when it tries to upload the file (it does not even go into the controller). I have spent a number of hours on this and cannot figure out whats going on.

Here is my controller code:

public ActionResult UploadDocument()
        {
            try
            {
                var documentFile = Request.Form.Files.First();

                //Check input
                if (documentFile == null)
                    throw new UserFriendlyException(L("File_Empty_Error"));

                byte[] fileBytes;
                using (var stream = documentFile.OpenReadStream())
                {
                    fileBytes = stream.GetAllBytes();
                }

                var documentFileObject = new BinaryObject(AbpSession.GetTenantId(), fileBytes);
                _binaryObjectManager.SaveAsync(documentFileObject);


                return Json(new AjaxResponse(new {id = documentFileObject.Id}));
            }
            catch (UserFriendlyException ex)
            {
                return Json(new AjaxResponse(new ErrorInfo(ex.Message)));
            }
        }

Hi Any idea of when the subscribe for SaaS services (editions) and pay it with payPal will be released?

Answer

Brilliant - that worked Thanks!

Answer

I have since changed the following line, but still not working

var project = input.Project.MapTo<Project>();

Showing 21 to 30 of 34 entries