Base solution for your next web application

Activities of "sipoyraj"

Question

I am trying to bind the inserted data from Data base Table to a Grid View but I didn't get any documentation for this any where . Even I have found a grid view in "Users " form in Administration Module, I didn't understand how it was implemented .Could you please give the proper documentation for Grid View Data Binding.? :?:

                                                                                      Thanks in Advance.

Hello Team,

We are using Metronic (Asp.Net boilerplate) application, we are facing some challenges during MIGRATION. Below I am mentioning the challenges

  1. We have SQL Server environment, which is shared with many dot net developers. when one developer changes any table info(alter table) rest all get Migration errors.
  2. Once we added any Table in SQL Server, our entity framework will be adding some fields automatically **ref Note - a. Will it makes any problem in further ?
  3. There is a table called "Employee", it has 4 records of information. I just added one extra field to the table (any modification to the table). After migration from

the entity framework, in next moment all records is vanishing(truncating the table). we are loosing the entire data. We are unable to find out what mistake we are

doing... Reference attached image "Migration_Error"

  1. Debug is not catching in Application Service & ViewModel JS file (js file which located next to *.cshtml file). Totally unable to debug on runtime. on button click

button, simply its throwin to home(dashboard) page.

Note - a. [IsDeleted],[DeleterUserId],[DeletionTime],[LastModificationTime],[LastModifierUserId],[CreationTime],[CreatorUserId]

Please guide us to resolve all above issues.We are beginners of using all these stuffs. we need guidance for - I. How to reflect the table changes in sql server to entity framework II. We have separate class for calculation. Let assume, Class "Maths" which is have some public methods for Addition, Substraction, Multiply.... We would like to know

where (under which project) we need to add this business logic in our application. III. How and when to use migration or required ? IV. Do we need to mention any reference to the newly added sqlserver table in entity framework. Ref attached image "Entity_Framework"

Please provide any online help number or email or skype...

Thanks in advance.

Hi In the phonebook application as a guide to develop in a documentation section. Where we have done everything as your guidance and unfortunately we are unable to edit the name and delete the phonebook person detail - TYPE. Since you have provided the way of coding approach for the creation we understood and we developed also. In the same way we need coding implementation for edit the name and deletion of person's details TYPE.

As we are very new to this technology and using this very first time and we need your guidance to digest properly. Attached image file for your reference.

Looking ahead for your response as we are need in no time.

Thanks in advance

I didnt find any Logs folder under web project

It is not showing any error But after running when clicking on the delete phone button, a popup is showing as an internal error occurred during your request.

My code for IPersonAppService is

using Abp.Application.Services; using Abp.Application.Services.Dto; using Abp.AutoMapper; using Abp.Domain.Repositories; using Abp.Linq.Extensions; using BCITS.BsmartWater.Storage; using System.Collections.Generic; using System.Linq; using Abp.Extensions; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; using BCITS.BsmartWater.Authorization; using Abp.Authorization; using System.Collections.ObjectModel; using System.Data.Entity;

namespace BCITS.BsmartWater.Tenants.PhoneBook { public interface IPersonAppService : IApplicationService { ListResultOutput<PersonListDto> GetPeople(GetPeopleInput input); Task CreatePerson(CreatePersonInput input);

    Task DeletePerson(IdInput input);

    Task DeletePhone(IdInput&lt;long&gt; input);

    Task&lt;PhoneInPersonListDto&gt; AddPhone(AddPhoneInput input);
}

[AutoMapTo(typeof(Phone))]
public class AddPhoneInput : IInputDto
{
    [Range(1, int.MaxValue)]
    public int PersonId { get; set; }

    [Required]
    public PhoneType Type { get; set; }

    [Required]
    [MaxLength(Phone.MaxNumberLength)]
    public string Number { get; set; }
}

[AutoMapTo(typeof(Person))]
public class CreatePersonInput : IInputDto
{
    [Required]
    [MaxLength(Person.MaxNameLength)]
    public string Name { get; set; }

    [Required]
    [MaxLength(Person.MaxSurnameLength)]
    public string Surname { get; set; }

    [EmailAddress]
    [MaxLength(Person.MaxEmailAddressLength)]
    public string EmailAddress { get; set; }
}



public class GetPeopleInput : IInputDto
{
    public string Filter { get; set; }
}

[AutoMapFrom(typeof(Person))]
public class PersonListDto : FullAuditedEntityDto
{
    public string Name { get; set; }

    public string Surname { get; set; }

    public string EmailAddress { get; set; }

    public Collection&lt;PhoneInPersonListDto&gt; Phones { get; set; }
}

[AutoMapFrom(typeof(Phone))]
public class PhoneInPersonListDto : CreationAuditedEntityDto
{
    public PhoneType Type { get; set; }

    public string Number { get; set; }
}

[AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook)]
public class PersonAppService : BsmartWaterAppServiceBase, IPersonAppService
{
    private readonly IRepository&lt;Person&gt; _personRepository;

    private readonly IRepository&lt;Phone, long&gt; _phoneRepository;


    public PersonAppService(IRepository&lt;Person&gt; personRepository)
    {
        _personRepository = personRepository;
    }


    public PersonAppService(IRepository&lt;Phone, long&gt; phoneRepository)
    {
        _phoneRepository = phoneRepository;
    }

    public ListResultOutput&lt;PersonListDto&gt; GetPeople(GetPeopleInput input)
    {
        var persons = _personRepository
            .GetAll()
            .Include(p => p.Phones)
            .WhereIf(
                    !input.Filter.IsNullOrEmpty(),
                p => p.Name.Contains(input.Filter) ||
                        p.Surname.Contains(input.Filter) ||
                        p.EmailAddress.Contains(input.Filter)
            )
            .OrderBy(p => p.Name)
            .ThenBy(p => p.Surname)
            .ToList();

        return new ListResultOutput&lt;PersonListDto&gt;(persons.MapTo&lt;List&lt;PersonListDto&gt;>());

   
    }

    [AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook_CreatePerson)]
    public async Task CreatePerson(CreatePersonInput input)
    {
        var person = input.MapTo&lt;Person&gt;();
        await _personRepository.InsertAsync(person);
    }

    [AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook_DeletePerson)]
    public async Task DeletePerson(IdInput input)
    {
        await _personRepository.DeleteAsync(input.Id);
    }

    public async Task DeletePhone(IdInput&lt;long&gt; input)
    {
        await _phoneRepository.DeleteAsync(input.Id);
    }
    public async Task&lt;PhoneInPersonListDto&gt; AddPhone(AddPhoneInput input)
    {
        var person = _personRepository.Get(input.PersonId);

        var phone = input.MapTo&lt;Phone&gt;();
        person.Phones.Add(phone);

        await CurrentUnitOfWork.SaveChangesAsync();

        return phone.MapTo&lt;PhoneInPersonListDto&gt;();
    }

}

}

Please solve my problem

Hi

My code is

using Abp.Application.Services; using Abp.Application.Services.Dto; using Abp.AutoMapper; using Abp.Domain.Repositories; using Abp.Linq.Extensions; using BCITS.BsmartWater.Storage; using System.Collections.Generic; using System.Linq; using Abp.Extensions; using System.Threading.Tasks; using System.ComponentModel.DataAnnotations; using BCITS.BsmartWater.Authorization; using Abp.Authorization; using System.Collections.ObjectModel; using System.Data.Entity;

namespace BCITS.BsmartWater.Tenants.PhoneBook { public interface IPersonAppService : IApplicationService { ListResultOutput<PersonListDto> GetPeople(GetPeopleInput input); Task CreatePerson(CreatePersonInput input);

    Task DeletePerson(IdInput input);

    Task DeletePhone(IdInput&lt;long&gt; input);

    Task&lt;PhoneInPersonListDto&gt; AddPhone(AddPhoneInput input);
}

[AutoMapTo(typeof(Phone))]
public class AddPhoneInput : IInputDto
{
    [Range(1, int.MaxValue)]
    public int PersonId { get; set; }

    [Required]
    public PhoneType Type { get; set; }

    [Required]
    [MaxLength(Phone.MaxNumberLength)]
    public string Number { get; set; }
}

[AutoMapTo(typeof(Person))]
public class CreatePersonInput : IInputDto
{
    [Required]
    [MaxLength(Person.MaxNameLength)]
    public string Name { get; set; }

    [Required]
    [MaxLength(Person.MaxSurnameLength)]
    public string Surname { get; set; }

    [EmailAddress]
    [MaxLength(Person.MaxEmailAddressLength)]
    public string EmailAddress { get; set; }
}



public class GetPeopleInput : IInputDto
{
    public string Filter { get; set; }
}

[AutoMapFrom(typeof(Person))]
public class PersonListDto : FullAuditedEntityDto
{
    public string Name { get; set; }

    public string Surname { get; set; }

    public string EmailAddress { get; set; }

    public Collection&lt;PhoneInPersonListDto&gt; Phones { get; set; }
}

[AutoMapFrom(typeof(Phone))]
public class PhoneInPersonListDto : CreationAuditedEntityDto
{
    public PhoneType Type { get; set; }

    public string Number { get; set; }
}

[AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook)]
public class PersonAppService : BsmartWaterAppServiceBase, IPersonAppService
{
    private readonly IRepository&lt;Person&gt; _personRepository;

    
    public PersonAppService(IRepository&lt;Person&gt; personRepository)
    {
        _personRepository = personRepository;
    }

    public ListResultOutput&lt;PersonListDto&gt; GetPeople(GetPeopleInput input)
    {
        var persons = _personRepository
            .GetAll()
            .Include(p => p.Phones)
            .WhereIf(
                    !input.Filter.IsNullOrEmpty(),
                p => p.Name.Contains(input.Filter) ||
                        p.Surname.Contains(input.Filter) ||
                        p.EmailAddress.Contains(input.Filter)
            )
            .OrderBy(p => p.Name)
            .ThenBy(p => p.Surname)
            .ToList();

        return new ListResultOutput&lt;PersonListDto&gt;(persons.MapTo&lt;List&lt;PersonListDto&gt;>());

   
    }

    [AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook_CreatePerson)]
    public async Task CreatePerson(CreatePersonInput input)
    {
        var person = input.MapTo&lt;Person&gt;();
        await _personRepository.InsertAsync(person);
    }

    [AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook_DeletePerson)]
    public async Task DeletePerson(IdInput input)
    {
        await _personRepository.DeleteAsync(input.Id);
    }

    public async Task DeletePhone(IdInput&lt;long&gt; input)
    {
        await _**phoneRepository**.DeleteAsync(input.Id);
    }
    public async Task&lt;PhoneInPersonListDto&gt; AddPhone(AddPhoneInput input)
    {
        var person = _personRepository.Get(input.PersonId);

        var phone = input.MapTo&lt;Phone&gt;();
        person.Phones.Add(phone);

        await CurrentUnitOfWork.SaveChangesAsync();

        return phone.MapTo&lt;PhoneInPersonListDto&gt;();
    }
}

}

The error i am getting is The name _phoneRepository does not exit in the current context

Yeah.. I did it T

Thank you

Hi I am getting the exception after giving permissions for creating person

An exception of type 'Abp.AbpInitializationException' occurred in Abp.dll but was not handled in user code

Additional information: Duplicate permission name detected for Pages.Tenant.PhoneBook

Please help me out

Showing 1 to 8 of 8 entries