Base solution for your next web application

Activities of "rev319303"

Well, I have spent the last year developing my application with AspNetZero and am finally to the point of building in subscriptions to my application. I noticed that you now have a subscription feature within your latest release. I looked around your website but haven't found any documentation on how to use the subscription feature or how to set it up with Paypal.

**This may be very easy to do but I just haven't looked into it, yet, and I wanted to at least read your documentation on it first before I started. I just can't seem to find.

Do you have any docs on how to setup and start using subscriptions?

Question

Where is the latest metronic files for download?

I downloaded BoilerPlates's ASP.Net Core 1.x project without module zero.

I am creating a web application for intranet use only. The company already has a custom membership provider that, in the past, they have implemented in the web.config as such:

<membership defaultProvider="NCMProvider">
    <providers>
        <clear />
        <add name="NCMProvider" type="Netcenter.NetcenterMembershipProvider" description="..." connectionStringName"..." enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" applicationName="..." />
    </providers>
</membership>

<roleManager enabled="true" defaultProvdier="NCRProvider">
    <providers>
        <clear />
        <add name="NCRProvider" type="NetCenter.NetCenterRoleProvider" connectionStringName="..." applicationName="..." />
    </providers>
</roleManager>

They also have a Netcenter.dll reference in their projects. They do security by calling this:

Using System.Web.Security
Roles.IsUserInRole("...")

It is required that all security go through their Netcenter. Netcenter simply has a list of applications with roles and user assigned to roles by Windows NT (Domain + "/" + ThreeCharacterString). Their Netcenter dll has everything to check access. I simply need to write something like this:

string userNt = HttpContext.User.Identity.Name;
if(Roles.IsUserInRole(userNt) { }

Can anyone provide help on how to implement this within a BoilerPlate project without Module Zero?

Question

Two Questions:

Do you have a link that shows all the updates you made in your latest release? I feel I have looked at this before but I can't seem to find it now.

Does your latest version of Core / MVC /jQuery still include the .Net framework or is it only running off the core framework now?

Edit 1: I found the release notes but I don't see any notes for 4.0.0. <a class="postlink" href="https://www.aspnetzero.com/Documents/Change-Logs">https://www.aspnetzero.com/Documents/Change-Logs</a>

Can someone help please? I have entity Program that has two foreign keys to my subject table (MainContactSubjectId, SecondaryContactSubjectId). Both main and secondary are nullable longs. For some reason, when I try to insert entity Program it errors (Internal Server Error) and will not let me insert unless Main and Secondary are present. Below is my entity Program and some of my dbContext. Can anyone see what I am doing wrong?

namespace DiversionCore.AppTables.Programs
{
    [Table("Program")]
    public class Program : Entity<long>
    {

        [Required]
        public int TenantId { get; set; }

        [Required]
        public long ProgramTypeId { get; set; }

        [Required]
        [MaxLength(4000)]
        public string ProgramName { get; set; }

        public long? MainContactSubjectId { get; set; }

	public long? SecondaryContactSubjectId { get; set; }

        public virtual AppTables.ProgramTypes.ProgramType ProgramType { get; set; }
        public virtual AppTables.Subjects.Subject MainSubject { get; set; }
        public virtual AppTables.Subjects.Subject SecondarySubject { get; set; }
    }
}
//MY dBCONTEXT
//I'm guessing the problem is here but I'm not sure what it is. Without this code, the foreign keys are not getting created correctly and circular reference issues. 
			modelBuilder.Entity<AppTables.Programs.Program>()
					.HasRequired(m => m.MainSubject)
					.WithMany(t => t.ProgramsMain)
					.HasForeignKey(m => m.MainContactSubjectId)
					.WillCascadeOnDelete(false);

			modelBuilder.Entity<AppTables.Programs.Program>()
					.HasRequired(m => m.SecondarySubject)
					.WithMany(t => t.ProgramsSecondary)
					.HasForeignKey(m => m.SecondaryContactSubjectId)
					.WillCascadeOnDelete(false);

Does anyone have any good examples of how to export data to an Excel document or how to Export a PDF?

In the past, I have always used the NPOI library to Export to Excel and iText to export a PDF but I don't think either of these work with ASP.NET Core.

I was hoping someone has already tackled this problem and had a good example they could share or some good links.

Thanks

Theoretically, I have 10 tenants. I code some new features and want to push these new features to all tenants. Now, I believe, if I just update the site with the new features then all tenants will not be able to see the new features until they go into their permissions and check the box for the new feature permission.

It is looking like I will need to go into the database and create a script that will assign the new permission to all tenants. Is this correct or is there a better way of doing this. If a script is the answer then do you already have that script that you could share?

Your thoughts?

Question

How do you handle custom c# validations? Do you have a standard way you do this or do I just need to handle this myself?

if(inputDto.blah  ==  "OhNo")
{
    //Throw some custom error back to the user
   throw new Exception("blah cannot equal OhNo");
}

What am I missing?

I am trying to setup the create controllers for app services and it is not working.

Here is what I placed in my PreInitialize method in my web.mvc project. (Core/jquery project)

Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(typeof(DiversionCore.DiversionCoreApplicationModule).Assembly, moduleName: "app", useConventionalHttpVerbs: true);

Here is the setup of my customerAppService:

namespace DiversionCore.Customer
{
    public class CustomerAppService : DiversionCoreAppServiceBase, ICustomerAppService
    {
        private readonly IRepository<Customer> _customerRepository;
        private readonly IRepository<CustomerSubscription> _customerSubscriptionRepository;
        private readonly IStripeAppService _stripeAppService;
        private readonly IUnitOfWorkManager _unitOfWorkManager;

        public CustomerAppService(IRepository<Customer> customerRepository, 
            IRepository<CustomerSubscription> customerSubscriptionRepository, 
            IStripeAppService stripeAppService,
            IUnitOfWorkManager unitOfWorkManager)
        {
            _customerRepository = customerRepository;
            _customerSubscriptionRepository = customerSubscriptionRepository;
            _stripeAppService = stripeAppService;
            //_unitOfWorkManager = unitOfWorkManager;
        }

        public async Task<CustomerDto> GetCustomer()
        {
            CustomerDto model = new CustomerDto();
            if (AbpSession.UserId.HasValue)
            {
                var qry = await _customerRepository.FirstOrDefaultAsync(x => x.UserId == AbpSession.UserId.Value);
                
                if(qry != null)
                {
                    model = Mapper.Map<Customer, CustomerDto>(qry);
                    model.CurrentSubscriptionId = qry.CustomerSubscriptionList.Where(x => x.IsActive == true).Select(x => x.SubscriptionId).FirstOrDefault();
                    return model;
                }
            }
            return null;
        }
    }
}

Here is what I am typing in the browser which returns undefined:

var _customerService = abp.services.app.Customer;

How do I setup SSL with your core/Jquery project?

Showing 1 to 10 of 13 entries