public tblM_UserDetail CreateFromDTO(UserDetailDTO userDetailDTO, DateTime dateStamp)
        {
            if (userDetailDTO == null)
            {
                throw new ArgumentNullException("UserDetail model is null.");
            }
            userDetailDTO.Status_FK   = (int)RecordStatus.Active;
            userDetailDTO.CreatedBy   = User.Username;
            userDetailDTO.CreatedDate = dateStamp;
            userDetailDTO.UpdatedBy   = User.Username;
            userDetailDTO.UpdatedDate = dateStamp;
            tblM_UserDetail userDetail = userDetailDTO.ToObject <tblM_UserDetail>();

            return(userDetail);
        }
Exemple #2
0
        public tblM_UserDetail CreateFromDTO(UserDetailDTO userDetailDTO, DateTime dateStamp)
        {
            if (userDetailDTO == null)
            {
                throw new ArgumentNullException("UserDetail model is null.");
            }
            userDetailDTO.Status_FK   = (int)RecordStatus.Active;
            userDetailDTO.CreatedBy   = User.Username;
            userDetailDTO.CreatedDate = dateStamp;
            userDetailDTO.UpdatedBy   = User.Username;
            userDetailDTO.UpdatedDate = dateStamp;

            tblM_UserDetail userDetail = userDetailDTO.ToObject <tblM_UserDetail>();

            if (!string.IsNullOrEmpty(userDetailDTO.FilePhotoInBase64))
            {
                userDetail.FilePhoto = new WebImageConverter().GetBytesFromBase64(userDetailDTO.FilePhotoInBase64);
            }

            return(userDetail);
        }