/// <summary> /// Save Previous History /// </summary> /// <param name="workId">workId</param> /// <param name="workType">workType</param> /// <param name="companyId">companyId</param> /// <param name="newSectionWorkId">newSectionWorkId</param> private void SavePreviousHistory(int workId, string workType, int companyId, int newSectionWorkId) { WorkHistoryGateway workHistoryGateway = new WorkHistoryGateway(); workHistoryGateway.LoadAllByWorkIdWorkType(workId, companyId, workType); foreach (WorkTDS.LFS_WORK_HISTORYRow historyRow in (WorkTDS.LFS_WORK_HISTORYDataTable)workHistoryGateway.Table) { int refId = historyRow.RefID; string type = ""; if (!historyRow.IsTypeNull()) type = historyRow.Type; string subject = historyRow.Subject; int userId = historyRow.UserID; DateTime? dateTime_ = null; if (!historyRow.IsDateTime_Null()) dateTime_ = historyRow.DateTime_; string history = ""; if (!historyRow.IsHistoryNull()) history = historyRow.History; int? libraryFilesId = null; if (!historyRow.IsLIBRARY_FILES_IDNull()) libraryFilesId = historyRow.LIBRARY_FILES_ID; WorkHistory workHistory = new WorkHistory(); workHistory.InsertDirect(newSectionWorkId, refId, type, subject, userId, dateTime_, history, libraryFilesId, false, companyId, workType); } }
/// <summary> /// Save Previous History /// </summary> /// <param name="workId">workId</param> /// <param name="workType">workType</param> /// <param name="companyId">companyId</param> /// <param name="newSectionWorkId">newSectionWorkId</param> private void SavePreviousHistory(int parentWorkId, string workType, int companyId, int childWorkId) { WorkHistoryGateway parentWorkHistoryGateway = new WorkHistoryGateway(); parentWorkHistoryGateway.LoadAllByWorkIdWorkType(parentWorkId, companyId, workType); WorkHistoryGateway childWorkHistoryGateway = new WorkHistoryGateway(); childWorkHistoryGateway.LoadAllByWorkIdWorkType(childWorkId, companyId, workType); WorkHistory childWorkHistory = new WorkHistory(childWorkHistoryGateway.Data); int lastRefId = childWorkHistory.GetNewRefId(); foreach (WorkTDS.LFS_WORK_HISTORYRow commentRow in (WorkTDS.LFS_WORK_HISTORYDataTable)parentWorkHistoryGateway.Table) { WorkHistory workHistory = new WorkHistory(); int refId = lastRefId; string type = ""; if (!commentRow.IsTypeNull()) type = commentRow.Type; string subject = commentRow.Subject; int userId = commentRow.UserID; DateTime? dateTime_ = null; if (!commentRow.IsDateTime_Null()) dateTime_ = commentRow.DateTime_; string comment = ""; if (!commentRow.IsHistoryNull()) comment = commentRow.History; int? libraryFilesId = null; if (!commentRow.IsLIBRARY_FILES_IDNull()) libraryFilesId = commentRow.LIBRARY_FILES_ID; workHistory.InsertDirect(childWorkId, refId, type, subject, userId, dateTime_, comment, libraryFilesId, false, companyId, workType); lastRefId++; } }