Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Get the current userGet the current user
Previous
 
Next
New Post
5/23/2007 10:17 AM
 

Hi i need a bit help here. I am altering the dbo.GetContacts

I want contact to show only the contacts created by the current user what shall i put there??

something like this

select

ItemId,ModuleId,CreatedDate,CreatedByUser,Name,Role,Email,Contact1,Contact2

from

Contacts

where

ModuleId = @ModuleId and CreatedByUser = here i need the variable for the current user

order by Name

 
New Post
5/23/2007 2:07 PM
 

User information is avaialble in the UserInfo object.  For the user id it is UserInfo.UserID


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
5/23/2007 3:44 PM
 

Makes sense thanks!!

BUt how can i use an object this way? I guess i wont work like a database table ivde tried to do like this but t throws errors

 MY changes are  yellow

ALTER procedure

dbo.GetContactsintItemId,Name,

from

Contacts, UserInfo

where

ModuleId = @ModuleId and CreatedbyUser = UserID order by Name

@ModuleId

as

select

ModuleId,

CreatedDate,

CreatedByUser,

UserID,

 

Role,

Contacts.Email,

Contact1,

Contact2

 
New Post
5/24/2007 10:06 AM
 

You will have to modify the stored procedure to accept a new parameter, most likely called @UserId, you would then use this as a filter for the query.

You will also need to modify the code for the module that calls the method to get the items, in that code you would pass the get method the UserInfo.UserID value as the second parameter just after the current passing of ModuleId


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
5/24/2007 6:10 PM
 

okey.

something like this? Am i close here?

 

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadTryDim objContacts As New ContactController'Localize Grid

Localization.LocalizeDataGrid(grdContacts,

grdContacts.DataSource = objContacts.GetContacts(ModuleId)

grdContacts.DataSource = objContacts.GetContacts(UserInfo.UserID)

grdContacts.DataBind()

Me.LocalResourceFile)Catch exc As Exception 'Module failed to load

ProcessModuleLoadException(

Me, exc)End TryEnd Sub

 

 I noticed a strange thing there was no .vb file in contacts i had to import one from another project. Could it be that they are placed somewhere else?

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Get the current userGet the current user


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out