Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "PhilWynn"

Hi,

I am implementing a ContactManager, where a Contact is linked to a Company. Once the Contact has been created, the company should no longer be allowed to change.

I have implemented the following method in ContactManager to achieve this validation:

protected async Task<IdentityResult> CheckCompanyUnchanged(int id, int companyId)
        {
            var contact = await _contactRepository.FirstOrDefaultAsync(c => c.Id == id);
            if (contact != null && contact.CompanyId != companyId)
            {
                return AbpIdentityResult.Failed(string.Format(L("ContactCompanyChanged")));
            }

            return IdentityResult.Success;
        }

The problem I am having is that when fetching the Contact to make the comparrison, it contains the updated company value rather than the original one due to entity tracking. Is there a way to access the original values from the Core project? I know this can be done via the dbContext, but have no access to this.

Hi,

I am using Controller Validation to validate against certain errors. The code has worked fine until I use abp.message.confirm in the save method:

function _attachCloseEvent() {
            _modalManager.getModal().find('.issue-close').click(function (e) {
                e.preventDefault();
                if (!_closeIssueForm.valid()) {
                    return;
                }
                //abp.message.confirm(
                //    app.localize('IssueCloseWarningMessage'),
                //    function (isConfirmed) {
                //        if (isConfirmed) {                            
                            _modalManager.setBusy(true);
                            var issue = _closeIssueForm.serializeFormToObject();
                            abp.ajax({
                                url: abp.appPath + 'Mpa/Issues/CloseIssue',
                                data: JSON.stringify({
                                    issueOutput: issue
                                }),
                                success: function () {                                    
                                    abp.notify.success(app.localize('IssueSuccessfullyClosed'));
                                    _modalManager.close();
                                    abp.event.trigger('app.itemSaved');
                                },
                                always: (function() {
                                    _modalManager.setBusy(false);
                                })
                            });
                    //    }
                    //}
                //);
            });
        }

When confirm is not enabled (as above) things work fine. When I enable confirm, the validation dialog box is not displayed.

Cheers, Phil

Question

Hi,

I would like to use the Display Attribute to apply localized names to my enum value. Could you please tell me how I can do this using the AZ localization framework.

Thank you

Question

Hi, I have successfully integrated the Kendo grid into aspnet zero. Now I would like to be able to handle ajax errors consistently with the rest of the application. Please could you tell me how I could invoke the standard abp ajax error dialog from within my javascript. I am successfully catching server side errors here, and am simply looking for the best way to report them.

Thank you

Hi

I have just downloaded v4 Core and successfully built. However, when I attempt to create the database via entity framework, I am getting the following error:

Could not load file or assembly 'Microsoft.EntityFrameworkCore.Design' or one of its dependencies. The system cannot find the file specified.

Please advise.

Question

I have just managed to get my AspNet Zero built and running for the first time. I am finding that all my jTable grids are displaying separate action buttons in the left column rather than a singe dropdown button. Is there a setting for this. I am running MVC5 jquery.

Regards

Showing 31 to 36 of 36 entries