示例#1
0
        public override User TranslateToModel(USER entity)
        {
            try
            {
                User model = null;
                if (entity != null)
                {
                    model              = new User();
                    model.Id           = entity.User_Id;
                    model.FirstName    = entity.First_Name;
                    model.Surname      = entity.Surname;
                    model.PasswordSalt = entity.Password_Salt;
                    model.Email        = entity.Email;
                    model.MobileNumber = entity.Mobile;
                    model.Password     = entity.Password;
                    model.Role         = _roleTranslator.Translate(entity.ROLE);
                    model.IsLocked     = entity.Is_Locked;
                    model.DateCreated  = entity.Date_Created;
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public override RoleRight TranslateToModel(ROLE_RIGHT entity)
        {
            try
            {
                RoleRight model = null;
                if (entity != null)
                {
                    model             = new RoleRight();
                    model.Role        = roleTranslator.Translate(entity.ROLE);
                    model.Right       = rightTranslator.Translate(entity.RIGHT);
                    model.Description = entity.Description;
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }