private void SaveCloningCallLog(int cloningId, int newJobId) { CallLogModel model = new CallLogModel(_unitOfWork); CS_CallType callType = model.GetCallTypeByDescription("Job Cloning"); CS_Job oldJob = _jobRepository.Get(e => e.ID == cloningId); CS_CallLog oldJobLog = new CS_CallLog() { JobID = cloningId, CallTypeID = callType.ID, PrimaryCallTypeId = callType.CS_PrimaryCallType_CallType.First(e => e.CallTypeID == callType.ID).PrimaryCallTypeID, CallDate = NewJob.CreationDate, Note = string.Format("Job # {0} has been cloned to Job # {1}", oldJob.NumberOrInternalTracking, NewJob.NumberOrInternalTracking), CreatedBy = NewJob.CreatedBy, CreationDate = NewJob.CreationDate, ModifiedBy = NewJob.ModifiedBy, ModificationDate = NewJob.ModificationDate, Active = true, ShiftTransferLog = false }; _callLogRepository.Add(oldJobLog); CS_CallLog newJobLog = new CS_CallLog() { JobID = newJobId, CallTypeID = oldJobLog.CallTypeID, PrimaryCallTypeId = oldJobLog.PrimaryCallTypeId, CallDate = oldJobLog.CreationDate, Note = oldJobLog.Note, CreatedBy = oldJobLog.CreatedBy, CreationDate = oldJobLog.CreationDate, ModifiedBy = oldJobLog.ModifiedBy, ModificationDate = oldJobLog.ModificationDate, Active = true, ShiftTransferLog = false }; _callLogRepository.Add(newJobLog); }