How to insert Organization Unit id?
Please provide CRUD example for Organization Unit . I am not able achieve this.
11 Answer(s)
-
0
Hi,
Are you getting an exception ? Because AspNet Zero already has a creating organization unit functionality. You can check OrganizationUnitAppService class for that.
-
0
<cite>ismcagdas: </cite> Hi,
Are you getting an exception ? Because AspNet Zero already has a creating organization unit functionality. You can check OrganizationUnitAppService class for that.
Organization Unit menu is working properly.
When i am creating Product master that time Organization Unit Id not able to store in database. That CRUD example required.
-
0
Hi,
I think you are trying to integrate organization unit with your product entity, am I right ? Can you explain a bit more detailed what you are trying to do ?
Thanks.
-
0
<cite>ismcagdas: </cite> Hi,
I think you are trying to integrate organization unit with your product entity, am I right ? Can you explain a bit more detailed what you are trying to do ?
Thanks.
Yes, I am trying to integrate organization unit with product entity. For this CRUD example required.
-
0
Hi,
Did you checked adding/removing users from organizaiton unit ? If you did and it was not helpful, please share the code you have written and we can ty to help.
Thanks.
-
0
<cite>ismcagdas: </cite> Hi,
Did you checked adding/removing users from organizaiton unit ? If you did and it was not helpful, please share the code you have written and we can ty to help.
Thanks.
Yes, We have checked adding/removing users from organizaiton unit.
I am trying to integrate organization unit with product entity. For this CRUD example required.
Please help us its urgent.
-
0
Hi,
Have you read this document <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units">http://aspnetboilerplate.com/Pages/Docu ... tion-Units</a> ? Especially this part explains exactly what you want <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#creating-entity-belongs-to-an-organization-unit">http://aspnetboilerplate.com/Pages/Docu ... ation-unit</a>
-
0
<cite>ismcagdas: </cite> Hi,
Have you read this document <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units">http://aspnetboilerplate.com/Pages/Docu ... tion-Units</a> ? Especially this part explains exactly what you want <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Zero/Organization-Units#creating-entity-belongs-to-an-organization-unit">http://aspnetboilerplate.com/Pages/Docu ... ation-unit</a>
In this URL example for fetching the data. I required insert and update Organization Unit Id in Product entity.
-
0
Hi,
So, when creating/editing a product you will select an existing organiztion unit, right ?
-
0
<cite>ismcagdas: </cite> Hi,
So, when creating/editing a product you will select an existing organiztion unit, right ?
Yes, Current Login Users organiztion unit..
-
0
Hi,
Thanks for the explanation, now I understand your case :). So, when inserting/updating a product you can get current user's organization unit id like this.
long? orgUnitId = null; var userOrgUnit = _userOrganizationUnitRepository.GetAll().FirstOrDefault(e => e.TenantId == AbpSession.TenantId && e.UserId == AbpSession.UserId); if (userOrgUnit != null) { orgUnitId = userOrgUnit.OrganizationUnitId; }
Then you can set your product's organizationUnitId to orgUnitId variable. But don't forget, in AspNet Zero a user can be in more than one organization unit, so in this case above code gets just one organization unit for current user.
I don't know your domain but maybe you need to restrict adding a user more than one organization unit.