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?
My apologies for responding now. I didn't get a notification for he last response until I decided to check here. I installed it according to the steps you gave. But it appears like I am missing the implementation and it's frustrating. Please could you provide a sample you used for aspnetzero so I can follow? It will really help me a lot and ease my pain.
Many thanks.
Thanks for your response.
Actually I didn't get any error on the screen. But what I noticed was after I added the extension and applied it on a view that has data to be displayed, all views on the application where not displaying any form element, just the layout view only including the page I tried to implement the ui-grid.
I added the extension from nuget directly on visual studio. So I assume, it added all the required files supported.
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.
Awesome. Everything is fine now. Thank you so much. I'll continue to explore tbe framework while building my application.
Okay I finally figured it out. I discovered I needed to set the permission appropriately in the database and configure the angular route properly for it to work. However, I don't seem to get why the application redirects to another page instead of the homepage when I login successfully.
If I login as a host, it redirects to Users page, if login as a tenant, it goes to another page. I want it to redirect to homepage. How do I do that?
Thanks for your response. I included this: "multiTenancySides: MultiTenancySides.Tenant" and the navigation view worked as I expected it to work. But I noticed it also affected other pages I needed the Host to see so I decided to create another permission name and tie it to the subject page. Below was what I did;
<ins>in PermissionNames Class;</ins>
public const string Pages_Schools_Users = "Pages.Schools.Users";
<ins>AuthorizationProvider Class;</ins>
var schoolUsers = pages.CreateChildPermission(PermissionNames.Pages_Schools_Users, L("SchoolUsers"), multiTenancySides: MultiTenancySides.Tenant);
<ins>NavigationProvider Class;</ins>
new MenuItemDefinition(
"Subjects",
L("Subjects"),
url: "#subjects",
icon: "fa fa-info",
requiredPermissionName: PermissionNames.Pages_Schools_Users
After doing the above, the menuItem for subjects didn't appear both for host and tenant user. Please what did I miss?
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.
Thank you. I'll do just that.