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

Activities of "nipunjoshi"

Excellent! We'll give it a try today and let you know how it goes. Thanks a lot!

Thanks for the response!

My concern is that with this approach, using the trick you mentioned, the data would not be shared between multiple tenants. Or would it be possible to do that?

In our scenario, the data needs to be shared. Employee of one company should be able to add information into the system, and that information should be available to employees of other companies if they have the right permission in the other company account. I believe multi-tenancy would not let us achieve that.

Could you please advise on the best way to achieve this?

I was thinking to may be introduce a concept of sub-tenants, where we add a new table related to sub-tenants and map them to users. Then at the click of login, we can check if the user is associated with more than one sub-tenant, then show a list to select from and if not, then just continue the current way. But that may require mapping to lot of other entities like roles, permissions etc and we do not have much time to get this done. We need a smart solution, which I am hoping you can provide! :)

Thanks a lot!

Yes,Now it's working.Thanks a lot :)

Other issue is according to the above exception where it checks the data on the tables also no (i.e "IpProperties" and "IpCounties" are my physical tables) ? Am I right ? Here it is :

NMemory.Exceptions.ForeignKeyViolationException : Foreign key violation [IpProperties :: CountyId]. The key value [3] does not exists in the referenced table [IpCounties :: Id]..

It's there on the seed data also. Then why's that ? Please see that below. Thanks.

Note : the exception happens here in the below class : _context.SaveChanges();

InitialPropertiesCreator.cs

public class InitialPropertiesCreator
    {
        private readonly IpDbContext _context;

        public InitialPropertiesCreator(IpDbContext context)
        {
            _context = context;
        }

        public void Create()
        {
            var dist1 = _context.Properties.FirstOrDefault(p => p.Dist == "dist1");
            if (dist1 == null)
            {
                _context.Properties.Add(
                    new Property
                    {
                        IsVacant = true,
                        IsPropertyToConsider = false,
                        Dist = "dist1",
                        Sec = "sec1",
                        Blk = "blk1",
                        Lot = "lot1",
                        Lot2 = "lot2",
                        Mls = "mls1",
                        Priority = "priority1",
                        Tfmv = "Tfmv1",
                        Fmv = "Fmv1",
                        Construction = "Construction1",
                        Bid = "Bid1",
                        ListingPrice = 12.25m,
                        Contact = "Contact1",
                        DeedDate = DateTime.UtcNow,
                        TransferTax = 12.9m,
                        OriginalPurchasePrice = 45.6m,
                        Taxes = 85.3m,
                        TotalValuation = 41.2m,
                        Ev = 47.3m,
                        BuyBackAmount = 50.2m,
                        CountyId = 3,
                        PropertyClassId = 1,
                        SchoolDistrictId = 1,
                        StatusId = 1,
                        Address = new Address
                        {
                            StreetName = "1st Street",
                            StreetNumber = "1581",
                            CityId = 1,
                            StateId = 1,
                        },
                        PurchasedById = 1,
                        ShowId = 1,
                        CodeId = 1,

                    });
            }

            var dist2 = _context.Properties.FirstOrDefault(p => p.Dist == "dist2");
            if (dist2 == null)
            {
                _context.Properties.Add(
                    new Property
                    {
                        IsVacant = true,
                        IsPropertyToConsider = false,
                        Dist = "dist2",
                        Sec = "sec2",
                        Blk = "blk2",
                        Lot = "lot2",
                        Lot2 = "lot3",
                        Mls = "mls2",
                        Priority = "priority2",
                        Tfmv = "Tfmv2",
                        Fmv = "Fmv2",
                        Construction = "Construction2",
                        Bid = "Bid2",
                        ListingPrice = 12.25m,
                        Contact = "Contact2",
                        DeedDate = DateTime.UtcNow,
                        TransferTax = 12.9m,
                        OriginalPurchasePrice = 45.6m,
                        Taxes = 85.3m,
                        TotalValuation = 41.2m,
                        Ev = 47.3m,
                        BuyBackAmount = 50.2m,
                        CountyId = 4,
                        PropertyClassId = 2,
                        SchoolDistrictId = 2,
                        StatusId = 2,
                        Address = new Address
                        {
                            StreetName = "2nd Street",
                            StreetNumber = "1582",
                            CityId = 2,
                            StateId = 2,
                        },
                        PurchasedById = 2,
                        ShowId = 2,
                        CodeId = 2,
                    });
            }

            _context.SaveChanges(); // it gives the exception here
        }
    }

InitialCountiesCreator.cs

public class InitialCountiesCreator
    {
        private readonly IpDbContext _context;

        public InitialCountiesCreator(IpDbContext context)
        {
            _context = context;
        }

        public void Create()
        {
            var county1 = _context.Counties.FirstOrDefault(p => p.Name == "Orange");
            if (county1 == null)
            {
                _context.Counties.Add(
                    new County
                    {
                        Name = "Orange",
                        State = "NY",
                    });
            }

            var county2 = _context.Counties.FirstOrDefault(p => p.Name == "Ulster");
            if (county2 == null)
            {
                _context.Counties.Add(
                   new County
                   {
                       Name = "Ulster",
                       State = "NY",
                   });
            }
        }
    }

Hi, Actually it worked before the V 1.7 update.Now it's not working.I have changed all the other icons also after the version update. Please see the image below.Thanks.

.AddItem(new MenuItemDefinition(
                    PageNames.App.Tenant.Imports,
                    L("Imports"),
                    url: "tenant.imports",
                    icon: "glyphicon glyphicon-import"
                 )

Hi, Actually those values are there. Really strange.What could be the other reason for this ? Please see the images.

Hi, Yes,You're correct.First issue was a permission issue and the second issue was I have overwritten the script files.Now both are working fine. But now I have another issue. Please see that too.Thanks.

Note : This is happening only on the Home page.

Yep,Thanks a lot.Now it works :)

Hi, I have done that.But now it gives 49 errors as shown below (but now no reference errors as I mentioned on the above post).Could you tell me why ?

Showing 1 to 10 of 16 entries