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

Activities of "exlnt"

I am developing a "profile" page for an entity in my application. I took a "profile" page from the Metronic documentation as my design for this page. This page is not a modal, but a normal CSHTML page like the index views.

Here is the HTML I am using: [attachment=0:39vhtmus]Screenshot (94).png[/attachment:39vhtmus]

When the page opens, it renders fine but throws the error shown below.

Uncaught ReferenceError: $ is not defined

The error references line 1255 of my code, shown below.

$(document).ready(function () {

Is there something different that needs to be done, in order to build a non-modal based page?

I am using the below code for my AJAX JS calls

abp.ajax({
        url: '/Address/GetStates',
        data: JSON.stringify({ CID: countryId })
    }).done(function (data) {
        $.each(data, function (i, state) {
            $("#EditState").append('<option value="' + state.value + '">' + state.text + '</option>');
            if (selectedVal != null && $.trim(selectedVal) == $.trim(state.value)) {
                $("#EditState").val($.trim(state.value));
            }
        });
    }).fail(function () {
        abp.notify.error('Get States failed!')
    });

In the above code the .fail is NOT getting hit. It keeps displaying the default alert message as per the ABP AJAX docs (<a class="postlink" href="https://www.aspnetboilerplate.com/Pages/Documents/Javascript-API/AJAX">https://www.aspnetboilerplate.com/Pages ... t-API/AJAX</a>). I want the notify message to be displayed rather than the default ABP alert message.

I am using the standard code provided in the template for rendering dropdowns. I would like to apply a filter to the GetAll() method shown below, so that only "Active" entities from the selected entity are returned.

In all of my entities I use the column "Active".

I would like every combobox method to only return the "Active" records.

public List<ComboboxItemDto> GetCompaniesComboboxItems(int selectedCompany = 0)
  {

       var comps = _companyRepository.GetAll();
        var companyItems = new ListResultDto<ComboboxItemDto>(comps.Select(e => new ComboboxItemDto(e.Id.ToString(), e.CompanyName)).ToList()).Items.ToList();

        var defaultItem = new ComboboxItemDto("", L("NotAssigned"));
         companyItems.Insert(0, defaultItem);

         if (selectedCompany != 0)
         {
             var selectedlistvalues = companyItems.FirstOrDefault(e => e.Value == selectedCompany.ToString());
           if (selectedlistvalues != null)
              {
                 selectedlistvalues.IsSelected = true;
                }           
            }
            else
            {
                defaultItem.IsSelected = true;
            }

            return companyItems;
        }

I just updated all the NuGet packages for ABP in my solution to version 2.0.1. My solution was running on 1.5.0.0. After the update, when I build the solution I get one error on the TenantManager.cs file in the .Core project. [attachment=0:z9cezoi6]Screenshot (65).png[/attachment:z9cezoi6]

Error:

Error	CS1503	Argument 1: cannot convert from 'void' to 'Microsoft.AspNet.Identity.IdentityResult'	EXLNT.NursingOps17.Core	\EXLNT.NursingOps17_VS2017\EXLNT.NursingOps17.Core\MultiTenancy\TenantManager.cs	80

I have a requirement in my application to store images for a "person" entity. I noticed in the ABP tables, you have below table defined.

{
    [Table("AppBinaryObjects")]
    public class BinaryObject : Entity<Guid>, IMayHaveTenant
    {
        public virtual int? TenantId { get; set; }

        [Required]
        public virtual byte[] Bytes { get; set; }

        public BinaryObject()
        {
            Id = Guid.NewGuid();
        }

        public BinaryObject(int? tenantId, byte[] bytes)
            : this()
        {
            TenantId = tenantId;
            Bytes = bytes;
        }
    }

This table is used to store user profile images.

Questions:

  1. Can I use this table to store my images OR should I inherit from this table into my own custom entity and use it there?
  2. Would there be any harm in using this table as-is, any potential impacts to upgrades in the future?

I have this method, below, for getting one single entity:

public async Task<EditNurseHomeDto> GetHomeForEdit(NullableIdDto input)
        {
            var nurseHomeEdit = (await _homeRepository.GetAsync((int)input.Id));
            var nh = nurseHomeEdit.MapTo<EditNurseHomeDto>();
            return nh;
        }

I have used this exact same method for another entity. In that other entity when the above method executes, it brings the data for the related entity (notes). However in the above method it is not bringing the related entity (Notes) back. The DTOs are structured virtually the same for both entities, yet it does not work in the above method?

How can I enforce validation checking on my dropdowns?

<div class="form-group form-md-line-input">
     @Html.DropDownList("CompanyId", Model.Companies.Select(i => i.ToSelectListItem()), new { @class = "form-control edited", required = String.Empty })
    <label>@L("CompanyName2")</label>
</div>

The above dropdown is one example. This is how I implement them on most of my pages. Yet the model validation on these dropdowns does not fire or send a message to the user. It allows you to submit the form and the data is posted to the app service method, where it crashes due to this missing field.

I have an entity update method that is setting one of my key columns in one of my related tables for the entity with a NULL.

The issue happens from the Edit modal to the update company method in my app service. It updates the company entity table just fine. But then it seems to also NULL out the company Id column in my CompanyAddress table.

I have emailed you my solution for your review. Can you help to identify why this is happening? Thanks!

I would like to have each page/module in my application be able to set the modal size used by the modal manager. Currently as a temporary solution I have modified the Modal manager code to use modal-full. I need this for some of my modules where there is quite a large form with lots of data being collected. There are other modules where the form is smaller and does not require the larger modal. So I would like to be able to change this dynamically.

How can I pass the modal class as a parameter to the modal manager? The line shown in red box below is what I am looking to modify/pass in as parameter. [attachment=0:o5dbo9ht]Screenshot (54).png[/attachment:o5dbo9ht]

Hi @ISMCAGDAS

I emailed you my solution and sent you an email about this issue about 2 weeks ago. I also sent you another email a few days ago. I am still having this issue with entity update method in my app service.

Here is debug showing complete "cmp" object. [https://drive.google.com/open?id=0B5HAoiVVXzY7WVdBM2g0X3pTMkE])

Here are the note entity DTOs. [https://drive.google.com/open?id=0B5HAoiVVXzY7dmFwbUZocDJYd0U])

The log file shows the below error.

ERROR 2017-02-19 12:40:41,634 [10   ] 17.EntityFramework.NursingOps17DbContext -  - Note: The Note field is required.
ERROR 2017-02-19 12:40:41,634 [10   ] 17.EntityFramework.NursingOps17DbContext -  - Note: The Note field is required.
ERROR 2017-02-19 12:40:41,705 [10   ] nHandling.AbpApiExceptionFilterAttribute - Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.

I have checked all my DTO's and I do not see "required" annotation on any property named "Note".

Can you please help? Thanks!

Showing 31 to 40 of 53 entries