/// <summary> /// GetFLAndRAHistory. /// </summary> /// <param name="companyId">companyId</param> /// <param name="numberOfHistory">numberOfHistory</param> /// <param name="enterString">enterString</param> /// <returns>a string with all historys separeted with the enterString</returns> public string GetJLOrFLOrRAHistory(int companyId, int numberOfHistory, string enterString) { string history = ""; foreach (FlatSectionJlTDS.AllHistoryRow row in (FlatSectionJlTDS.AllHistoryDataTable)Table) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.UserID, row.COMPANY_ID); string user = loginGateway.GetLastName(row.UserID, row.COMPANY_ID) + " " + loginGateway.GetFirstName(row.UserID, row.COMPANY_ID); // ... Form the history string string rowHistory = ""; if (!row.IsHistoryNull()) rowHistory = row.History; else rowHistory = "( None )"; history = history + row.DateTime_ + " (" + user.Trim() + ")"; if (!row.IsWorkTypeNull()) history = history + ", Created At: " + row.WorkType; history = history + ", Type: " + row.Type; history = history + ", Subject: " + row.Subject + enterString; history = history + "Comment: " + rowHistory; // Insert enter when correspond if (numberOfHistory > 1) { history = history + enterString + enterString; numberOfHistory--; } } return (history); }
/// <summary> /// GetAllProjectNotes. /// </summary> /// <param name="projectId">projectId</param> /// <param name="companyId">companyId</param> /// <param name="numberOfNotes">numberOfNotes</param> /// <param name="enterString">enterString</param> /// <returns>a string with all Notes separeted with the enterString</returns> public string GetAllProjectNotes(int projectId, int companyId, int numberOfNotes, string enterString) { string note = ""; foreach (ProjectTDS.LFS_PROJECT_NOTERow row in (ProjectTDS.LFS_PROJECT_NOTEDataTable)Table) { if ((row.ProjectID == projectId) && (row.COMPANY_ID == companyId) && (!row.Deleted)) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.LoginID, companyId); string user = loginGateway.GetLastName(row.LoginID, companyId) + " " + loginGateway.GetFirstName(row.LoginID, companyId); // ... Form the note string string rowNote = ""; if (!row.IsNoteNull()) rowNote = row.Note; else rowNote = "( None )"; note = note + row.DateTime + " (" + user.Trim() + ")"; note = note + ", Subject: " + row.Subject + enterString; note = note + "note: " + rowNote; // Insert enter when correspond if (numberOfNotes > 1) { note = note + enterString + enterString; numberOfNotes--; } } } return (note); }
/// <summary> /// GetFLAndRAComments. /// </summary> /// <param name="companyId">companyId</param> /// <param name="numberOfComments">numberOfComments</param> /// <param name="enterString">enterString</param> /// <returns>a string with all comments separeted with the enterString</returns> public string GetFLOrRAComments(int companyId, int numberOfComments, string enterString) { string comment = ""; foreach (FullLengthLiningTDS.AllCommentsRow row in (FullLengthLiningTDS.AllCommentsDataTable)Table) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.UserID, row.COMPANY_ID); string user = loginGateway.GetLastName(row.UserID, row.COMPANY_ID) + " " + loginGateway.GetFirstName(row.UserID, row.COMPANY_ID); // ... Form the comment string string rowComment = ""; if (!row.IsCommentNull()) rowComment = row.Comment; else rowComment = "( None )"; comment = comment + row.DateTime_ + " (" + user.Trim() + ")"; if (!row.IsWorkTypeNull()) comment = comment + ", Created At: " + row.WorkType; comment = comment + ", Type: " + row.Type; comment = comment + ", Subject: " + row.Subject + enterString; comment = comment + "Comment: " + rowComment; // Insert enter when correspond if (numberOfComments > 1) { comment = comment + enterString + enterString; numberOfComments--; } } return (comment); }
// //////////////////////////////////////////////////////////////////////// // PUBLIC METHODS // /// <summary> /// UpdateForReport /// </summary> /// <param name="projectId">projectId</param> /// <param name="companyId">companyId</param> public void UpdateForReport(int projectId, int companyId) { // For LFS_PROJECT_NOTE // ... for Writer Name foreach (ProjectSynopsisReportTDS.LFS_PROJECT_NOTERow row in this.Table.Rows) { if (row.ProjectID == projectId) { LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(Convert.ToInt32(row.LoginID), companyId); try { row.WrittenBy = loginGateway.GetLastName(Convert.ToInt32(row.LoginID), companyId) + " " + loginGateway.GetFirstName(Convert.ToInt32(row.LoginID), companyId); } catch { row.WrittenBy = ""; } } } }
/// <summary> /// GetAllComments. /// </summary> /// <param name="workId">workId</param> /// <param name="companyId">companyId</param> /// <param name="numberOfComments">numberOfComments</param> /// <param name="enterString">enterString</param> /// <returns>a string with all comments separeted with the enterString</returns> public string GetAllHistory(int workId, int companyId, int numberOfHistory, string enterString) { string history = ""; foreach (WorkTDS.LFS_WORK_HISTORYRow row in (WorkTDS.LFS_WORK_HISTORYDataTable)Table) { if ((row.WorkID == workId) && (row.COMPANY_ID == companyId)) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.UserID, companyId); string user = loginGateway.GetLastName(row.UserID, companyId) + " " + loginGateway.GetFirstName(row.UserID, companyId); // ... Form the comment string string rowHistory = ""; if (!row.IsHistoryNull()) rowHistory = row.History; else rowHistory = "( None )"; history = history + row.DateTime_ + " (" + user.Trim() + ")"; if (!row.IsWorkTypeNull()) history = history + ", Created At: " + row.WorkType; history = history + ", Type: " + row.Type; history = history + ", Subject: " + row.Subject + enterString; history = history + "Comment: " + rowHistory; } // Insert enter when correspond if (numberOfHistory > 1) { history = history + enterString + enterString; numberOfHistory--; } } return (history); }
/// <summary> /// GetAllRehabAssessmentComments. /// </summary> /// <param name="workId">workId</param> /// <param name="companyId">companyId</param> /// <param name="numberOfComments">numberOfComments</param> /// <param name="enterString">enterString</param> /// <returns>a string with all comments separeted with the enterString</returns> public string GetAllRehabAssessmentComments(int workId, int companyId, int numberOfComments, string enterString) { string comment = ""; foreach (RehabAssessmentTDS.CommentDetailsRow row in (RehabAssessmentTDS.CommentDetailsDataTable)Table) { if ((row.WorkID == workId) && (row.COMPANY_ID == companyId) && (!row.Deleted)) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.UserID, companyId); string user = loginGateway.GetLastName(row.UserID, companyId) + " " + loginGateway.GetFirstName(row.UserID, companyId); // ... Form the comment string string rowComment = ""; if (!row.IsCommentNull()) rowComment = row.Comment; else rowComment = "( None )"; comment = comment + row.DateTime_ + " (" + user.Trim() + ")"; if (!row.IsWorkTypeNull()) comment = comment + ", Created At: " + row.WorkType; comment = comment + ", Type: " + row.Type ; comment = comment + ", Subject: " + row.Subject + enterString; comment = comment + "Comment: " + rowComment; } // Insert enter when correspond if (numberOfComments > 1) { comment = comment + enterString + enterString; numberOfComments--; } } return (comment); }
/// <summary> /// GetAllComments. /// </summary> /// <param name="workId">workId</param> /// <param name="companyId">companyId</param> /// <param name="numberOfComments">numberOfComments</param> /// <param name="enterString">enterString</param> /// <returns>a string with all comments separeted with the enterString</returns> public string GetAllComments(int workId, int companyId, int numberOfComments, string enterString) { string comment = ""; foreach (WorkTDS.LFS_WORK_FULLLENGTHLINING_WETOUT_COMMENTSRow row in (WorkTDS.LFS_WORK_FULLLENGTHLINING_WETOUT_COMMENTSDataTable)Table) { if ((row.WorkID == workId) && (row.COMPANY_ID == companyId) && (!row.Deleted)) { // ... Get user name LoginGateway loginGateway = new LoginGateway(); loginGateway.LoadAllByLoginId(row.UserID, row.COMPANY_ID); string user = loginGateway.GetLastName(row.UserID, row.COMPANY_ID) + " " + loginGateway.GetFirstName(row.UserID, row.COMPANY_ID); // ... Form the comment string string rowComment = row.Comment; comment = comment + row.DateTime_ + " (" + user.Trim() + ")" ; if (!row.IsWorkTypeNull()) comment = comment + ", Created At: " + row.WorkType; comment = comment + ", Type: " + row.Type; comment = comment + ", Subject: " + row.Subject + enterString; comment = comment + "Comment: "+ rowComment; } // Insert enter when correspond if (numberOfComments > 1) { comment = comment + enterString + enterString; numberOfComments--; } } return (comment); }