Beispiel #1
0
 private void Fetch(string username, [Inject] IUserDal dal)
 {
     ProjectTracker.Dal.UserDto data = null;
     try
     {
         data = dal.Fetch(username);
     }
     catch (ProjectTracker.Dal.DataNotFoundException)
     {
         data = null;
     }
     LoadUser(data);
 }
Beispiel #2
0
 private void Fetch(UsernameCriteria criteria, [Inject] IUserDal dal)
 {
     ProjectTracker.Dal.UserDto data = null;
     try
     {
         data = dal.Fetch(criteria.Username, criteria.Password);
     }
     catch (ProjectTracker.Dal.DataNotFoundException)
     {
         data = null;
     }
     LoadUser(data);
 }
Beispiel #3
0
 public UserDto Fetch(string username)
 {
   try
   {
     var user = Membership.GetUser(username);
     var result = new UserDto { Username = user.UserName };
     result.Roles = Roles.Provider.GetRolesForUser(result.Username);
     return result;
   }
   catch (Exception ex)
   {
     throw new DataNotFoundException("User", ex);
   }
 }
Beispiel #4
0
 private void LoadUser(ProjectTracker.Dal.UserDto data)
 {
     if (data != null)
     {
         Name               = data.Username;
         IsAuthenticated    = true;
         AuthenticationType = "Membership";
         Roles              = new Csla.Core.MobileList <string>(data.Roles);
     }
     else
     {
         Name               = string.Empty;
         IsAuthenticated    = false;
         AuthenticationType = string.Empty;
         Roles              = new Csla.Core.MobileList <string>();
     }
 }