in
Forums
Blogs
Files
Devexpress.Com
ClientCenter
Support Center
DevExpress Channel

hi,How Can I get the User object in a Bo Class

Last post 9/1/2008 9:03 AM by nie zuan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts:
Previous Next
  • 8/29/2008 11:54 AM

    hi,How Can I get the User object in a Bo Class

    my bo class as :

     

                 public class XRequirement : BaseObject
        {

             ......

            public override void AfterConstruction()
            {

               if (this.Session.IsNewObject(this) )
                {
                    XPCollection<XEmployee> xEmployees = new XPCollection<XEmployee>(this.Session);
                    CriteriaOperator criterion = CriteriaOperator.Parse("LoginUser.UserName='" +User.name+"'");
                    xEmployees.Criteria = criterion;
                    foreach (XEmployee xEmployee in xEmployees)
                    {
                        this.XEmployee = xEmployee;
                        break;
                    }
                }

           }

     

    .........

     

    I can completed this funtion via a viewcontroler.

    in a viewcontroler i can get current  User's Name  via Application.Security.UserName,but i don't know how to do in a bo class.

     

    thx

     

     

     

  • 9/1/2008 3:29 AM In reply to

    Re: hi,How Can I get the User object in a Bo Class

    Hello,
     
    There is a similar question in our Support Center: "Creator using Current Logged User" at http://www.devexpress.com/Support/Center/p/Q107734.aspx
     
    Please take a look at our Knowledge Base at: http://www.devexpress.com/kb.
    It contains useful information on our products that may save your time.

    --
    Thanks,
    Dan.
     
    R&D, .NET Team, Developer Express Inc.
     
    PS. Please don't reply to me directly by e-mail unless it is specifically
    requested. If you wish to receive direct assistance from our Support Team,
    use Support Center at http://www.devexpress.com/Support/Center
  • 9/1/2008 9:03 AM In reply to

    Re: hi,How Can I get the User object in a Bo Class

     Dan,Thx  for you Suggestions

    I never send my post to your mail-box directly  ,maybe the Forums done this.

    Big Smile

Page 1 of 1 (3 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED