Ejemplo n.º 1
0
 public User(UserEntity e)
 {
     _Entity = e;
     _UserName = e.UserName;
     _FirstName = e.FirstName;
     _LastName = e.LastName;
     _MiddleName = e.MiddleName;
     _Title = e.Title;
     _IsSystemAccount = !e.IsHomoSapien;
     _Credentials = e.Credentials;
     _Address = e.Address ?? "";
     _CellPhone = e.CellPhone ?? "";
     _OfficePhone = e.OfficePhone ?? "";
     _HomePhone = e.HomePhone ?? "";
     _City = e.City ?? "";
     _State = e.State ?? "";
     _Country = e.Country ?? "";
     _Zip = e.Zip ?? "";
     _CellPhoneProvider = e.CellPhoneProvider ?? "";
     _Pager = e.Pager ?? "";
     _PagerId = e.PagerId ?? "";
     _PagerType = e.PagerType ?? "";
     _NPI = e.NPI ?? "";
     _Enabled = e.Enabled;
 }
        private void AddReminderEntry(UserEntity user)
        {
            UserTransportEntity transport = _Manager.GetUserTransport(user.UserName, ReminderNotificationTransportName);

            if (!_ReminderEntries.ContainsKey(transport.Address))
            {
                if (string.IsNullOrEmpty(transport.Address))
                {
                    _Tracer.TraceEvent(TraceEventType.Warning, (int)AgentEvents.SendReminderError, "Address for reminder was missing.");
                }
                else
                {
                    _ReminderEntries.Add(transport.Address, 1);
                }
            }
            else
            {
                _ReminderEntries[transport.Address]++;
            }
        }
Ejemplo n.º 3
0
 public UserEntity ToEntity()
 {
     UserEntity entity = new UserEntity();
     entity.Credentials = Credentials;
     entity.Address = Address;
     entity.CellPhone = CellPhone;
     entity.OfficePhone = OfficePhone;
     entity.HomePhone = HomePhone;
     entity.CellPhoneProvider = CellPhoneProvider;
     entity.City = City;
     entity.Country = Country;
     entity.State = State;
     entity.Zip = Zip;
     entity.Pager = Pager;
     entity.PagerId = PagerId;
     entity.PagerType = PagerType;
     entity.NPI = NPI;
     entity.FirstName = FirstName;
     entity.IsHomoSapien = !IsSystemAccount;
     entity.LastName = LastName;
     entity.MiddleName = MiddleName;
     entity.Title = Title;
     entity.UserName = UserName;
     entity.Enabled = Enabled;
     return entity;
 }
        public UserTransportEntity CreateUserTransport(UserEntity user, TransportEntity transport, string address)
        {
            UserTransportEntity userTransport = new UserTransportEntity();
            userTransport.User = user;
            userTransport.Transport = transport;
            userTransport.Address = address;

            _ObjectContext.SaveChanges();

            return userTransport;
        }
 /// <summary>
 /// Modified: 2009-07-31, John Morgan
 ///		- Added blank password object to UserEntryEntities on CreateUserEntity
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public UserEntity CreateUserEntity(UserEntity user)
 {
     var checkUser = GetUser(user.UserName);
     if (checkUser != null)
     {
         checkUser.FirstName = user.FirstName;
         checkUser.MiddleName = user.MiddleName;
         checkUser.LastName = user.LastName;
         if (!String.IsNullOrEmpty(user.Title))
         {
             checkUser.Title = user.Title;
         }
         if (!String.IsNullOrEmpty(user.Credentials))
         {
             checkUser.Credentials = user.Credentials;
         }
         _ObjectContext.SaveChanges();
     }
     else
     {
         _ObjectContext.AddToUserEntitySet(user);
         _ObjectContext.SaveChanges();
     }
     return GetUser(user.UserName);
 }
 /// <summary>
 /// modified: 2009-11-23, Jeremy R
 ///  -Added creation of new Guid
 /// </summary>
 /// <param name="user"></param>
 /// <param name="ipv4"></param>
 /// <returns></returns>
 public TokenEntity CreateToken(UserEntity user, string ipv4)
 {
     TokenEntity e = new TokenEntity();
     e.Token = Guid.NewGuid();
     e.User = user;
     e.Ipv4 = ipv4;
     e.CreatedTime = DateTime.Now;
     e.UpdatedTime = DateTime.Now;
     _ObjectContext.AddToTokenEntitySet(e);
     _ObjectContext.SaveChanges();
     return e;
 }
        /// <summary>
        /// Modified: 2009-10-26, John Morgan
        /// Was not setting IsHomoSapien
        /// </summary>
        /// <param name="changedUser"></param>
        /// <returns></returns>
        public UserEntity UpdateUserEntity(UserEntity changedUser)
        {
            UserEntity persistentUser = GetUser(changedUser.UserName);

            persistentUser.FirstName = changedUser.FirstName;
            persistentUser.LastName = changedUser.LastName;
            persistentUser.MiddleName = changedUser.MiddleName;
            persistentUser.Title = changedUser.Title;
            persistentUser.IsHomoSapien = changedUser.IsHomoSapien;
            persistentUser.Credentials = changedUser.Credentials;
            persistentUser.Address = changedUser.Address;
            persistentUser.CellPhone = changedUser.CellPhone;
            persistentUser.OfficePhone = changedUser.OfficePhone;
            persistentUser.HomePhone = changedUser.HomePhone;
            persistentUser.State = changedUser.State;
            persistentUser.Zip = changedUser.Zip;
            persistentUser.Country = changedUser.Country;
            persistentUser.City = changedUser.City;
            persistentUser.CellPhoneProvider = changedUser.CellPhoneProvider;
            persistentUser.Pager = changedUser.Pager;
            persistentUser.PagerId = changedUser.PagerId;
            persistentUser.PagerType = changedUser.PagerType;
            persistentUser.NPI = changedUser.NPI;

            persistentUser.Enabled = changedUser.Enabled;

            _ObjectContext.SaveChanges();

            return persistentUser;
        }
        public void UpdateUserCredentials(UserEntity changedUser, string passwordHash, string pinHash)
        {
            throw new System.NotImplementedException();

            //UserEntity persistentUser = GetUser(changedUser.UserName);

            //persistentUser.PasswordHash = changedUser.PasswordHash;
            //persistentUser.PinHash = changedUser.PinHash;

            //_ObjectContext.SaveChanges();
        }