コード例 #1
0
        public override LoginDetail TranslateToModel(PERSON_LOGIN entity)
        {
            try
            {
                LoginDetail model = null;
                if (entity != null)
                {
                    model        = new LoginDetail();
                    model.Person = _personTranslator.Translate(entity.PERSON);
                    //model.Username = entity.Username;
                    model.Password         = entity.Password;
                    model.SecurityQuestion = _securityQuestionTranslator.Translate(entity.SECURITY_QUESTION);
                    model.SecurityAnswer   = entity.Security_Answer;
                    model.Role             = _roleTranslator.Translate(entity.ROLE);
                    model.IsActivated      = entity.Is_Activated;
                    model.IsLocked         = entity.Is_Locked;
                    model.IsFirstLogon     = entity.Is_First_Login;
                    model.FirstLogonDate   = entity.First_Login_Date;
                    model.LastLogonDate    = entity.Last_Login_Date;
                }

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

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