Пример #1
0
 private void DataPortal_Fetch(UsernameCriteria criteria)
 {
     ProjectTracker.Dal.UserDto data = null;
     using (var ctx = ProjectTracker.Dal.DalFactory.GetManager())
     {
         var dal = ctx.GetProvider <ProjectTracker.Dal.IUserDal>();
         try
         {
             data = dal.Fetch(criteria.Username, criteria.Password);
         }
         catch (ProjectTracker.Dal.DataNotFoundException)
         {
             data = null;
         }
         LoadUser(data);
     }
 }
Пример #2
0
 private void LoadUser(ProjectTracker.Dal.UserDto data)
 {
     if (data != null)
     {
         base.Name               = data.Username;
         base.IsAuthenticated    = true;
         base.AuthenticationType = "Membership";
         base.Roles              = new Csla.Core.MobileList <string>(data.Roles);
     }
     else
     {
         base.Name               = string.Empty;
         base.IsAuthenticated    = false;
         base.AuthenticationType = string.Empty;
         base.Roles              = new Csla.Core.MobileList <string>();
     }
 }
Пример #3
0
 private void Fetch(string username)
 {
     ProjectTracker.Dal.UserDto data = null;
     using (var ctx = ProjectTracker.Dal.DalFactory.GetManager())
     {
         var dal = ctx.GetProvider <ProjectTracker.Dal.IUserDal>();
         try
         {
             data = dal.Fetch(username);
         }
         catch (ProjectTracker.Dal.DataNotFoundException)
         {
             data = null;
         }
         LoadUser(data);
     }
 }