Base solution for your next web application

Activities of "cicciottino"

Good!

i'm trying to install module zero from scratch

i've followed the documentation: <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Zero/installation#DocInstallManual">http://aspnetboilerplate.com/Pages/Docu ... tallManual</a>

till this point... i can't see this method

internal sealed class Configuration : DbMigrationsConfiguration<AbpZeroSample.EntityFramework.AbpZeroSampleDbContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = false;
        ContextKey = "AbpZeroSample";
    }

    protected override void Seed(AbpZeroSample.EntityFramework.AbpZeroSampleDbContext context)
    {
        context.DisableAllFilters();   //<--- it seems not existing ????
        new DefaultTenantRoleAndUserBuilder(context).Build();
    }
}

xxx.DisableAllFilters(); where is implemented?

"AbpZeroSampleDbContext" implements "AbpZeroDbContext" where i supposed to found the method (or in its own derivated classes)

i did so, but i don't like

in the application layer

public DeleteDocumentOutput DeleteDocument(DeleteDocumentInput input)
        { 
            var document = _documentRepository.FirstOrDefault(input.Id); 
            if (document == null) 
             { 
                throw new Exception("Can not found the document!"); 
             } 

 
            _documentRepository.Delete(document);

            return new DeleteDocumentOutput 
            {
                Id = document.Id   //<----
            }; 
        }

in the angular controller

documentService.deleteDocument({
                    id: document.id
                }).success(function(value) {
                    

                    vm.documents.forEach(function (element, index, array) {
                        if (element.id === value.id) {
                            vm.documents.splice(index,1);
                        }
                    });

                    vm.refreshDocuments();
		});

could i do it better?

what is the best practice about the response to confirm the deletion?

i saw in the taskever live esample:

taskever/src/Taskever.Application/Tasks/TaskAppService.cs

public DeleteTaskOutput DeleteTask(DeleteTaskInput input) 
         { 
             var task = _taskRepository.FirstOrDefault(input.Id); 
             if (task == null) 
             { 
                 throw new Exception("Can not found the task!"); 
             } 
 
 
             var currentUser = _userRepository.Load(AbpUser.CurrentUserId.Value); 
             if (!_taskPolicy.CanDeleteTask(currentUser, task)) 
             { 
                 throw new UserFriendlyException("You can not delete this task!"); 
             } 
 
 
             _taskRepository.Delete(task); 
 
 
             return new DeleteTaskOutput();  //<------------is mapping missing????? or is automatic?
         }

id the "DeleteTaskOutput" not mapped?, the json output is always "zero"

{"success":true,"result":{"id":0},"error":null,"unAuthorizedRequest":false}

and anyway this contains only the entity's id, is it better to serve the entire entity to output or the only id is enough?(is there a best practice for the Delete operation?)

Then how can i remove the deleted entity from the angular collection?(in the case i return the only id, or the entire entity in the json)

taskService.deleteTask({
                    id: document.id
                }).success(function(value) {
                    
                    var index = vm.task.indexOf(value.id);  //<-- it doesn't work, does it expect the entire entity instead of the "id"?
                    vm.tasks.splice(index, 1);
                    
                });

thanks a lot

yep, it was cache browser fault :-/ thanks

the same error even if i genereate the database with Update-Database...

i downloaded the project after you moved abp.sweet-alert.js to bundle (on github)

PS: On the Durandal Projet everything works, on the Angular one got this

Are you working on SimpleTaskSystem? -----> YES

Did you create database using Update-Database command? -----> NO, it was beenautomatically generated on the application startup

Probably tou're getting another exception. See Logs folder in web project.

it doesn't seem to show "ERROR" level labels, only "DEBUG" and "INFO" into the log file. anyway the messages as well seems to be only idication of successfully task.

was it important that the database should be generated manually by me with Database-Update command? is it mandatory?

  1. downloaded the latest version of the project (SimpleTask)
  2. changed the connectionstring to a new empty database
  3. "Play" on visualstudio

got this javascript error :

Unhandled exception at line 105, column 5 in
http://localhost:6247/Abp/Framework/scripts/libs/abp.sweet-alert.js

0x800a138f - Errore di run-time di JavaScript: Impossibile recuperare la proprietà 'on' di un riferimento nullo o non definito

sorry for the italian message bu i think is comprehensible

arent't sweetalert needed files included in the taskSystem sample project? i can download them (css and js) from the sweetalert's site but where is the abp.sweet-alert.js file?

than, should i add the abp.sweet-alert.js file to the layout.cshtml? and in what folder i have to put the css and js file in the TaskSystem project?

thanks

i'm trying to ad a new entity to the SimpleTaskSystem example project

in order to add a "car" entity and everything it needs to be displayed i did exactly this till now:

  1. create the "car" entity
  2. create the a new repositoty for the new entity
  3. create the ApplicationLayer a dn relative DTOs + input/output objects
  4. create views and relative angulars'controller file

at this poin i got this error into the browser consolle:

Error: [$injector:unpr] http://errors.angularjs.org/1.3.8/$injector/unpr?p0=abp.services.tasksystem.carProvider%20%3C-%20abp.services.tasksystem.car%20%3C-%20sts.views.car.list
   at Anonymous function (http://localhost:6247/Scripts/angular.min.js:38:301)

i suppose the problem is the name of the angular services that i used in my angular controller (in my case 'abp.services.tasksystem.car') the question is:

  • is this angular service autogenerated?
  • is the naming convention (that i used) correct supposing that i have an ApplicationLayer that is named "CarAppServices" and has a method named "GetFreeCarsOutput"
  • did i miss something after the point "4"? did i have to add something else other than view and controller?

THE APPLICATION LAYER

public class CarAppServices : ApplicationService, ICarAppServices
    {
        private readonly ICarRepository _carRepository;
        private readonly IRepository<Person> _personRepository;

        public CarAppServices(ICarRepository carRepository, IRepository<Person> personRepository)
        { 
            _carRepository = carRepository;
            _personRepository = personRepository;
        }

        public GetFreeCarsOutput GetFreeCars(GetFreeCarsInput input)
        {
            var cars = _carRepository.GetAllFreeCars(input.MaxSpeed);
            return new GetFreeCarsOutput
            {
                Cars = Mapper.Map<List<CarDto>>(cars)
            };
        }
    }

THE ANGULAR CONTROLLER

(function() {
    var app = angular.module('app');

    var controllerId = 'sts.views.car.list';
    app.controller(controllerId, [
        '$scope', 'abp.services.tasksystem.car',
        function($scope, carService) {
            var vm = this;
	    .....
            ....
            ...
            ..
            .
		
	    var myCars = carService.getAllFreeCars({
	    .....
            ....
            ...
            ..
            .
Showing 31 to 40 of 42 entries