Base solution for your next web application

Activities of "george"

Question

Hi, I've purchased ASPNetZero just before a couple of days. Now I would like to add some PlugIn Modules to my project. Can you please give me a sample project which implements the PlugIn Modules??

Hi,

Please look at the structure of my project in the attached screenshot: [attachment=0:ar1kmk5f]AbpZero.JPG[/attachment:ar1kmk5f]

I need to develop my application in modular structure. Because it will be easy to manage the changes/additions in each module without affecting the whole project.

So, I'm developing each of my modules in the folder named 'Modules'. Here, I've started developing a 'Topscore.Smart_campus.BaseModule'. It contains the Core, Application and EntityFramework projects. My problem is, the AppServices in the 'Topscore.Smart_campus.BaseModule.Application' project is not getting initiated.

I've defined the module 'Smart_campusBaseModuleApplicationModule' for the 'Topscore.Smart_campus.BaseModule.Application' project. And dependency registration is also done in the Initialize() methode:

namespace Topscore.Smart_campus.BaseModule.Application
{
    [DependsOn(typeof(Smart_campusBaseModuleCoreModule))]
    public class Smart_campusBaseModuleApplicationModule : AbpModule
    {
        public override void PreInitialize()
        {

        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }
}

And this module class is invoked through 'Smart_campusWebModule' (Marked in the picture)

Then I tried to call the 'StudentAppService' in the angular controller using 'abp.services.app.student' But there is no services available with the name 'student' or anything like that. Although this service is not found, i could see all the other AppServices (including user, tenant etc..) when debugging through browser.

Where am i keeping a mistake?

Hi,

Thank you very much for the information. I used the code given below:

In Smart_campusWebApiModule

Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(Smart_campusBaseModuleApplicationModule).Assembly, "app")
                .Build();

Now the AppServices of Smart_campusBaseModuleApplicationModule are generated and I can call the AppService methods in the API.

But another problem is, whenever I call the methods from Smart_campusBaseModuleApplicationModule, there is a System.NullReferenceException: Object reference not set to an instance of an object error. It's because the parametered constructor of the AppService is not being initiated. That is, I'm using the 'InserAsync' function of 'IRepository' interface in the AppService. I've coded to set an instance of the IRepository to _subjectRepository in the AppService Constructor. But that constructor is not getting initiated. So that, an error is occurred at the point of inserting the data. Code: Topscore.Smart_campus.BaseModule.Application

public class SubjectAppService : Smart_campusAppServiceBase, ISubjectAppService
    {
        public readonly IRepository<Subject> _subjectRepository;

        public SubjectAppService()
        {

        }
        public SubjectAppService(IRepository<Subject> subjectAppService)
        {
            _subjectRepository = subjectAppService;
        }

        public ListResultDto<SubjectListDto> GetSubjects()
        {
            return new ListResultDto<SubjectListDto>(
                _subjectRepository.GetAll()
                    .OrderBy(t => t.Name)
                    .MapTo<List<SubjectListDto>>()
                );
        }

index.js

vm.getSubjects = function () {
                vm.loading = true;
                subjectService.getSubjects()
                    .then(function (result) {
                        vm.userGridOptions.totalItems = result.data.totalCount;
                        vm.userGridOptions.data = result.data.items;
                    }).finally(function () {
                        vm.loading = false;
                    });
            };

When the GetSubjects methode is invoked from the API, it comes to the parameterless constructor of the AppService. Then it comes to the method, not to the parametered constructor. Hence the error is occurred.

I've tried after removing the parameterless constructor. At that time, the code doesn't even coming to the SubjectAppService :roll: It just showing 'An error has occurred! Error detail not sent by server.' in the browser. (NB: Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients is set to true :|) I couldn't find any details of the error in AbpAuditLogs or Logs.txt.

How can we make it possible?? Please help me on this too..

<cite>ismcagdas: </cite> Hi,

Probably IRepository<Subject> is not created by Dependency Injection. The reason might be Subject entity is not added to any DbContext.

If it is added to any dbContext, do you have below line in that module's Initialize method (one of your EntityFramework modules).

IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

Oh my god! Thank You very much. Exactly this was the problem..! I didn't added the Subject entity to the DbContext. Now it's working well.. Thanks a lot and sorry for the foolish mistake I've done!

Hi, Does AspNetZero supports Bootstrap3 ?? If yes, how can we use it in the UI? If not, what do we need to do for make it possible??

I tried to implement a calendar which is build using bootstrap3 ([https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=kitchen-sink])). But it is not working.

Hope you will reply soon!

<cite>ismcagdas: </cite>

By the way, Metronic theme already has a calendar in it called fullCalendar. You can also use it if you like. FullCalendar github page: <a class="postlink" href="https://github.com/fullcalendar/fullcalendar">https://github.com/fullcalendar/fullcalendar</a> FullCalendar Metronic sample: <a class="postlink" href="http://keenthemes.com/preview/metronic/theme/admin_4_material_design/app_calendar.html">http://keenthemes.com/preview/metronic/ ... endar.html</a>

Hi, that was a useful information. I like the fullCalendar and I'm going to use that. Thank you :D

Hi, I tried to implement the fullCalendar by following this documentation [https://fullcalendar.io/docs/usage/]) I've added the fullcalendar.js file to the project and called it in the layout.cshtml along with the script they've given. But its not working. How can we use the fullCalender of Metronic? Do i need to add any of these additional files??

Hi, It just nothing happening in my page. But while checking through the browser debug console, I got 2 errors:

1)
Uncaught ReferenceError: jQuery is not defined at http://localhost:6240/libs/fullcalendar/fullcalendar.js:15:11
at http://localhost:6240/libs/fullcalendar/fullcalendar.js:17:3

2)
Uncaught ReferenceError: $ is not defined at http://localhost:6240/Application:72:9

I've downloaded the fullCalendar script files and added those files and the javascript to the project.

<link rel='stylesheet' href='~/libs/fullcalendar/fullcalendar.css'/>       
<script src='~/libs/fullcalendar/fullcalendar.js'></script>
    <script>
        $(document).ready(function () {
            // page is now ready, initialize the calendar...
            $('#calendar22').fullCalendar({
                // put your options and callbacks here
                weekends: false // will hide Saturdays and Sundays
            })

        });
    </script>

I got the above javascript from fullCalendar documentation.

Also, I couldn't find even the "apps" folder inside the metronic files. :| [attachment=0:p2m9qam1]TS.JPG[/attachment:p2m9qam1]

Hi, Still there is nothing is happening in my page. I'll explain you what I've done in step-by-step:

  1. Added the calendar.js file to my project.
  2. Given the stylesheet reference in <head> of the layout.cshtml
<link href="~/libs/fullcalendar/fullcalendar.min.css" rel="stylesheet" type="text/css" />
  1. Added a div with id="calendar" in the page which the calendar to be displayed.
  2. Given the script references for the JavaScript files in the footer of the layout.cshtml file
<script src="~/libs/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
<script src="~/metronic/assets/apps/scripts/calendar.min.js" type="text/javascript"></script>

But nothing is happening in my page. But I got an error in the browser debug console:

Uncaught TypeError: e.draggable is not a function
 
at l (http://localhost:6240/metronic/assets/apps/scripts/calendar.min.js:1:845)
    
at o (http://localhost:6240/metronic/assets/apps/scripts/calendar.min.js:1:1047)
    
at Object.initCalendar (http://localhost:6240/metronic/assets/apps/scripts/calendar.min.js:1:1234)
    
at Object.init (http://localhost:6240/metronic/assets/apps/scripts/calendar.min.js:1:56)
    
at HTMLDocument.<anonymous> (http://localhost:6240/metronic/assets/apps/scripts/calendar.min.js:1:2626)
    
at i (http://localhost:6240/libs/jquery/jquery.min.js:2:27451)
    
at Object.fireWith [as resolveWith] (http://localhost:6240/libs/jquery/jquery.min.js:2:28215)
    
at Function.ready (http://localhost:6240/libs/jquery/jquery.min.js:2:30008)
    
at HTMLDocument.K (http://localhost:6240/libs/jquery/jquery.min.js:2:30370)

Since I'm a fresher to ABP and Angular, please help me to move on.. Thank You.

Hi, I hope you guys will provide a very good support to your customers.. :|

Showing 1 to 10 of 47 entries