public HistoryItemAssembler(ILogger logger, IHistoryEmployeeAssembler employeeAssembler, IHistoryContactAssembler contactAssembler, IListCache listCache)
 {
     _logger = logger;
     _employeeAssembler = employeeAssembler;
     _contactAssembler = contactAssembler;
     _listCache = listCache;
 }
 public HistoryItemAssembler(ILogger logger, IHistoryEmployeeAssembler employeeAssembler, IHistoryContactAssembler contactAssembler, IListCache listCache)
 {
     _logger            = logger;
     _employeeAssembler = employeeAssembler;
     _contactAssembler  = contactAssembler;
     _listCache         = listCache;
 }
        public HistoryItemEmployee Assemble(ClarifyDataRow actEntryRecord, IHistoryContactAssembler contactAssembler)
        {
            var userRows = actEntryRecord.RelatedRows(_userGeneric);
            if (userRows.Length == 0)
                return new HistoryItemEmployee();

            var userRecord = userRows[0];
            var login = userRecord.AsString("login_name");
            var employeeRows = userRecord.RelatedRows(_employeeGeneric);
            if (employeeRows.Length == 0)
                return new HistoryItemEmployee { Login = login };

            var employeeRecord = employeeRows[0];
            var name = "{0} {1}".ToFormat(employeeRecord.AsString("first_name"), employeeRecord.AsString("last_name"));
            var email = employeeRecord.AsString("e_mail");
            var id = employeeRecord.DatabaseIdentifier();

            return new HistoryItemEmployee
            {
                Name = name,
                Firstname = employeeRecord.AsString("first_name"),
                Lastname = employeeRecord.AsString("last_name"),
                Id = id,
                Login = login,
                Email = email,
                PerformedByContact = contactAssembler.Assemble(actEntryRecord)
            };
        }
예제 #4
0
        public HistoryItemEmployee Assemble(ClarifyDataRow actEntryRecord, IHistoryContactAssembler contactAssembler)
        {
            var userRows = actEntryRecord.RelatedRows(_userGeneric);

            if (userRows.Length == 0)
            {
                return(new HistoryItemEmployee());
            }

            var userRecord   = userRows[0];
            var login        = userRecord.AsString("login_name");
            var employeeRows = userRecord.RelatedRows(_employeeGeneric);

            if (employeeRows.Length == 0)
            {
                return new HistoryItemEmployee {
                           Login = login
                }
            }
            ;

            var employeeRecord = employeeRows[0];
            var name           = "{0} {1}".ToFormat(employeeRecord.AsString("first_name"), employeeRecord.AsString("last_name"));
            var email          = employeeRecord.AsString("e_mail");
            var id             = employeeRecord.DatabaseIdentifier();

            return(new HistoryItemEmployee
            {
                Name = name,
                Firstname = employeeRecord.AsString("first_name"),
                Lastname = employeeRecord.AsString("last_name"),
                Id = id,
                Login = login,
                Email = email,
                PerformedByContact = contactAssembler.Assemble(actEntryRecord)
            });
        }