public override User TranslateToModel(USER entity)
        {
            try
            {
                User model = null;
                if (entity != null)
                {
                    model                  = new User();
                    model.Id               = entity.User_Id;
                    model.Email            = entity.Email;
                    model.Password         = entity.Password;
                    model.Role             = roleTranslator.Translate(entity.ROLE);
                    model.SecurityAnswer   = entity.Security_Answer;
                    model.SecurityQuestion = securityQuestionTranslator.Translate(entity.SECURITY_QUESTION);
                    model.Username         = entity.User_Name;
                    model.ImageUrl         = entity.Image_Url;
                    model.Person           = personTranslator.Translate(entity.PERSON);
                    model.LastLoginDate    = entity.Last_Login_Date;
                }

                return(model);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public override SearchedItem TranslateToModel(SEARCHED_ITEM entity)
        {
            try
            {
                SearchedItem model = null;
                if (entity != null)
                {
                    model                = new SearchedItem();
                    model.Id             = entity.Searched_Item_Id;
                    model.DateSearched   = entity.Date_Searched;
                    model.ItemDetail     = itemDetailTranslator.Translate(entity.ITEM_DETAIL);
                    model.Person         = personTranslator.Translate(entity.PERSON);
                    model.SearchedResult = searchedResultTranslator.Translate(entity.SEARCH_RESULT);
                }

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