/// <summary> /// SaveRAWork /// </summary> /// <param name="projectId">projectId</param> /// <param name="section_assetId">section_assetId</param> /// <param name="companyId">companyId</param> /// <param name="subArea">subArea</param> /// <param name="comments">comments</param> /// <param name="loginId">loginId</param> private void SaveRAWork(DataMigrationTDS.DataMigrationRow row, int projectId, int section_assetId, int companyId, string comments, int loginId) { DateTime dateTime_ = DateTime.Now; string commentsToWork = ""; DateTime? preFlushDate = null; if (!row.IsPreFlushDateNull()) preFlushDate = row.PreFlushDate; DateTime? preVideoDate = null; if (!row.IsPreVideoDateNull()) preVideoDate = row.PreVideoDate; if (comments != "") { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadByLoginId(loginId, companyId); string user = loginGateway.GetLastName(loginId, companyId) + " " + loginGateway.GetFirstName(loginId, companyId); // ... Form the comment string commentsToWork = commentsToWork + dateTime_ + "\n" + "(" + user.Trim() + ") \n Subject: Bulk Upload Comments \n Comment: " + comments; } WorkRehabAssessment workRehabAssessment = new WorkRehabAssessment(null); int workId = workRehabAssessment.InsertDirect(projectId, section_assetId, null, preFlushDate, preVideoDate, false, companyId, commentsToWork, ""); if (comments != "") { WorkCommentsGateway workCommentsGateway = new WorkCommentsGateway(); workCommentsGateway.LoadByWorkIdWorkType(workId, companyId, "Rehab Assessment"); WorkComments workComments = new WorkComments(workCommentsGateway.Data); workComments.Insert(workId, 0, "Rehab Assessment", "Bulk Upload Comments", loginId, DateTime.Now, comments, null, false, companyId, false, "Rehab Assessment"); // UpdateComments workCommentsGateway.Update(); } }