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

Activities of "kacey"

I decided to try out my abilities with Angular 2 by trying to design the SimpleTaskSystem in angular 2. As a novice in angular 2, I am having issues calling the C# GetTasks method in the angular project. There are no samples in angular 2 to guide me on how to do it.

The following AngularJS code is what I am trying to do with angular 2:

$scope.$watch('selectedTaskState', function(value) {
                vm.refreshTasks();
            });

            vm.refreshTasks = function() {
                abp.ui.setBusy( //Set whole page busy until getTasks complete
                    null,
                    taskService.getTasks({ //Call application service method directly from javascript
                        state: $scope.selectedTaskState > 0 ? $scope.selectedTaskState : null
                    }).success(function(data) {
                        vm.tasks = data.tasks;
                    })
                );
            };

What I was trying to do in Angular 2:

@Component({
  //selector: 'app-list',
  templateUrl: './list.component.html',
  animations: [appModuleAnimation()],
  styleUrls: ['./list.component.css']
})
export class ListComponent extends AppComponentBase {

  constructor(injector: Injector, private _taskService: TaskServiceProxy) {
      super(injector);
  }

  tasks: TaskDto[] = [];
  taskInput: GetTaskInput = null;

  ngOnInit() {
      this.getTasks();
  }

  getTasks(): ListOfTaskDto {
      this._taskService.getTasks().subscribe
  }

}

[b]The Method in C#[/b]

public List<TaskDto> GetTasks(GetTaskInput input)
        {
            var tasks = _taskRepository.GetAllWithUsers(input.AssignedUserId, input.State);

            return new List<TaskDto>(tasks.MapTo<List<TaskDto>>());
        }

Having some of the samples already on the website in Angular 2 will go a long way in helping newbies like me intending a quick jump on the technology to take on impending projects. Thanks.

I have a particular method I am calling through angularJS to display some data from the database, but doing so, I get an error that states "An Error has occurred. Error detailed not Sent by the server." I confirmed it by debugging the method and discovered it works just fine and retrieves the data, but when it's time to display on the client, this happens. I have opened the browser console to check what is happening, but the error is not logged there either. If Only I can know what the problem is exactly, it would be so much better. See my code below;

C#

public PagedResultDto<GoodsRequestDto> GetGoodsRequestPaged(GoodsRequestListInput input)
        {
            var goodsRequests = _goodsRequestRepo.GetAllIncluding(g => g.GoodsQuotes)
                .WhereIf(input.UserId.HasValue, g => g.CreatedBy == input.UserId)
                .OrderBy(d => d.Id)
                .PageBy(input)
                .ToList();

            return new PagedResultDto<GoodsRequestDto>
            {
                TotalCount = goodsRequests.Count,
                Items = goodsRequests.MapTo<List<GoodsRequestDto>>()
            };
        }
    }

AngularJS

vm.loadGoodsRequests = function () {
                var skipCount = 0;

                abp.ui.setBusy(null,
                    projectService.getGoodsRequestPaged({
                        skipCount: skipCount,
                        userId: appSession.user.id
                    }).success(function (data) {
                        vm.goodsRequests = data.items;
                    })
                );
            }

HTML

<div ng-if="vm.goodsRequests.length" ng-repeat="gr in vm.goodsRequests" class="classInfo-list-item col-md-6">
            <div class="classInfo-body">
                <h3 class="classInfo-title">
                    {{gr.categoryItem.name + "_" + gr.brand.name + "_" + gr.product.name | cut:true:50:' ...'}}
                </h3>
                <p class="classInfo-description">Quantity: {{gr.quantity}} {{gr.unit}}</p>
                <p class="classInfo-description">Payment Term: {{gr.paymentTerm}}</p>
                <div class="classInfo-registration-info">
                    {{gr.goodsQuotes.length}} Quote(s).
                </div>
                <div class="classInfo-actions">
                    <a class="btn btn-sm btn-info" ng-href="#/my-goods-requests/{{gr.id}}">@L("Details") <i class="fa fa-arrow-circle-right"></i></a>
                </div>
                <span ng-class="vm.statusClass(gr.statusString)" class="classInfo-date"> {{gr.statusString }}</span>
            </div>
        </div>

I used similar approach for other pages of the application and I didn't get any such problem. I don't know what I'm doing wrong and worst of all, I don't know the exact cause of the error.

Please Help! I've been on this for hours. I checked the Logs.txt file, Browser Console no error to describe what the problem is.

I just downloaded a fresh project from aspnet boilerplate website. Without making any changes to code, I ran update-database command on the solution and it gives me the following error: 'There is already an object named 'AbpAuditLogs' in the database.'

How do I resolve this please?

Hi,

I have enjoyed and learned a lot using this framework for my work and I really appreciate the effort made into this project to make DDD approach easy.

I have an application to demo by next week for which I want to use this Angular.ui.grid to display data as it is being used in aspnetzero.com. But when I installed the extension via nuget.org into my application and used sample to use it, it crashes the entire application. I don't know if it's something I am not doing right or something else. But when I uninstalled it, my application returned to normal.

Please I will be so happy if someone can give me a guide or sample that works as it does in aspnetzero.com (pagination, ngTouch, sorting etc) so I can transform my datatable that are just mere html tables.

Please I need a solution as soon as possible. Many thanks.

It may be a simple problem but I can't get it to work. I have an Entity "Term" that as a property "SessionPeriodID" as foreign key from the entity "SessionPeriod". In the "Term" DTO, I included a property to of type SessionPeriodDTO that has the properties I need. But running the terms list displays an internal server error message. When I debugged the code, I noticed it was because of the included SessionPeriodDTO property. I don't know what to do from here. Please help.

Term.cs

[Table("Terms")]
    public class Term : FullAuditedEntity<Int32>, IMustHaveTenant
    {
        [Required(AllowEmptyStrings = false, ErrorMessage = "Term Name is required"),
         StringLength(50, ErrorMessage = "Cannot be more than 50 characters")]
        public string Name { get; set; }

        [Required, DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true),
            Display(Name = "Start Date")]
        public DateTime StartDate { get; set; }

        [DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true),
            Display(Name = "Stop Date")]
        public DateTime? StopDate { get; set; }

        [NotMapped]
        public PeriodStatus Status { get; set; }

        [Column("Status")]
        public string StatusString
        {
            get
            {
                return Status.ToString();
            }
            private set
            {
                Status = value.ParseEnum<PeriodStatus>();
            }
        }

        public int SessionPeriodID { get; set; }

        public int TenantId { get; set; }

        [ForeignKey("SessionPeriodID")]
        public virtual SessionPeriod SessionPeriod { get; set; }
    }

TermDTO

public class TermsListDTO : FullAuditedEntityDto
    {
        public string Name { get; set; }

        public int SessionPeriodID { get; set; }
        public string SessionPeriodName { get; set; }

        public DateTime StartDate { get; set; }

        [DisplayFormat(NullDisplayText = "Not Specified")]
        public DateTime? StopDate { get; set; }

        public PeriodStatus Status { get; set; }

        public string StatusString { get; private set; }

        public virtual SessionPeriodDTO SessionPeriod { get; set; }

    }

SessionPeriodDTO

[AutoMapFrom(typeof(SessionPeriod))]
    public class SessionPeriodDTO : CreationAuditedEntityDto
    {
        public virtual string Name { get; protected set; }

        public virtual DateTime? StartDate { get; protected set; }

        public virtual DateTime? StopDate { get; protected set; }

    }

.cshtml

<span ng-show="!term.showEdit">{{term.sessionPeriod.name}}</span>

Please note that the <span> was taken out of table of data and other columns work except the above.

I am still trying to get a hang on the ABP Application framework and it's been good so far, even though it is a bit slow. However, my application is on the based on the SPA Angular with Module-Zero template for which I have trouble in using the Navigation Provider properly.

I created a page (cshtml and angular controller) which I tested and it's working fine. But after setting the permission to only be viewed by an application tenant and not a host, it appears in both sessions. Below is what I did to have it viewed only by a tenant;

public class iTrackPupilNavigationProvider : NavigationProvider
    {
        public override void SetNavigation(INavigationProviderContext context)
        {
            context.Manager.MainMenu
                .AddItem(
                    new MenuItemDefinition(
                        "Home",
                        new LocalizableString("HomePage", iTrackPupilConsts.LocalizationSourceName),
                        url: "#/",
                        icon: "fa fa-home"
                        )
                ).AddItem(
                    new MenuItemDefinition(
                        "Tenants",
                        L("Tenants"),
                        url: "#tenants",
                        icon: "fa fa-globe",
                        requiredPermissionName: PermissionNames.Pages_Tenants
                        )
                ).AddItem(
                    new MenuItemDefinition(
                        "Users",
                        L("Users"),
                        url: "#users",
                        icon: "fa fa-users",
                        requiredPermissionName: PermissionNames.Pages_Users
                        )
                ).AddItem(
                    new MenuItemDefinition(
                        "Subjects",
                        L("Subjects"),
                        url: "#subjects",
                        icon: "fa fa-info",
                        requiredPermissionName: PermissionNames.Pages_Users
                        )
                ).AddItem(
                    new MenuItemDefinition(
                        "About",
                        new LocalizableString("About", iTrackPupilConsts.LocalizationSourceName),
                        url: "#/about",
                        icon: "fa fa-info"
                        )
                );
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, iTrackPupilConsts.LocalizationSourceName);
        }

With the above code, I expected that a host user shouldn't see the "Subjects" MenuItem but the host can also see it. Please Can you point me in the right direction? I have been struggling with it for days. Thanks.

I downloaded a template a couple of weeks ago and selected the MVC & Jquery Option. But now I want to use AngularJS with it. I don't wanna have to download a fresh project and rewrite all the code I added to the previous one. How can I easily add AngularJS to my project? I searched for abp.AngularJS but didn't find anything like that.

Please help.

I discovered ABP a few days ago After searching for tools to help my Enterprise Application Development. I went through the samples and documentation and realized I just found what I needed. The N-layered structure and the DDD model is amazing. Even though I don't have so much experience in that area, ABP has brought me up to speed a bit.

My question based on the topic is how to write a method to get an entity by an enum property through (IRepository) as used in the samples. I thought of using DB contexts but I think it goes against the best practices as I didn't see you do that in your samples.

With a model A, Having an Enum property, and another model B in which the enum property of A is a a foreign key, I would want to set that field in B's constructor so when creating a new entity, it is automatically added. My problem is where and how to write the method (GetByEnum) that will help me achieve what I want.

I hope you understand my question. Thanks.

I discovered ABP a few days ago After searching for tools to help my Enterprise Application Development. I went through the samples and documentation and realized I just found what I needed. The N-layered structure and the DDD model is amazing. Even though I don't have so much experience in that area, ABP has brought me up to speed a bit.

My question based on the topic is how to write a method to get an entity by an enum property through (IRepository) as used in the samples. I thought of using DB contexts but I think it goes against the best practices as I didn't see you do that in your samples.

With a model A, Having an Enum property, and another model B in which the enum property of A is a a foreign key, I would want to set that field in B's constructor so when creating a new entity, it is automatically added. My problem is where and how to write the method (GetByEnum) that will help me achieve what I want.

I hope you understand my question. Thanks.

Showing 1 to 9 of 9 entries