/// <summary> /// To update FileName /// </summary> /// <param name="pEntContentModuleTracking"></param> /// <returns>ContentModuleTracking object</returns> public ContentModuleTracking UpdateScannedFileName(ContentModuleTracking pEntContentModuleTracking) { _sqlObject = new SQLObject(); sqlcmd = new SqlCommand(); sqlcmd.CommandText = Schema.Common.PROC_UPDATE_SCANNED_FILE_NAME; try { _strConnString = _sqlObject.GetClientDBConnString(pEntContentModuleTracking.ClientId); if (!string.IsNullOrEmpty(pEntContentModuleTracking.ContentModuleId)) { sqlpara = new SqlParameter(Schema.Common.PARA_ACTIVITY_ID, pEntContentModuleTracking.ContentModuleId); sqlcmd.Parameters.Add(sqlpara); } if (!string.IsNullOrEmpty(pEntContentModuleTracking.UserID)) { sqlpara = new SqlParameter(Schema.Common.PARA_SYSTEM_USER_GUID, pEntContentModuleTracking.UserID); sqlcmd.Parameters.Add(sqlpara); } if (!string.IsNullOrEmpty(pEntContentModuleTracking.ScannedCertificationFileName)) { sqlpara = new SqlParameter(Schema.Common.PARA_SCANNED_FILE_NAME, pEntContentModuleTracking.ScannedCertificationFileName); sqlcmd.Parameters.Add(sqlpara); } sqlpara = new SqlParameter(Schema.Common.PARA_ACTIVITY_TYPE, ActivityContentType.Course.ToString()); sqlcmd.Parameters.Add(sqlpara); _sqlObject.ExecuteNonQuery(sqlcmd, _strConnString); } catch (Exception expCommon) { //_expCustom = new CustomException(_strMessageId, CustomException.WhoCallsMe(), ExceptionSeverityLevel.Critical, expCommon, true); //throw _expCustom; } return(pEntContentModuleTracking); }
/// <summary> /// Update /// </summary> /// <param name="pEntCourseConfiguration"></param> /// <param name="pUpdateMode"></param> /// <returns></returns> private CourseConfiguration Update(CourseConfiguration pEntCourseConfiguration, string pUpdateMode) { int iRows = 0; _sqlObject = new SQLObject(); _sqlcmd = new SqlCommand(); _sqlcmd.CommandText = Schema.CourseConfiguration.PROC_UPDATE_COURSE_CONFIGURATION; try { _strConnString = _sqlObject.GetClientDBConnString(pEntCourseConfiguration.ClientId); if (pUpdateMode == Schema.Common.VAL_INSERT_MODE) { _sqlpara = new SqlParameter(Schema.Common.PARA_UPDATE_MODE, Schema.Common.VAL_INSERT_MODE); pEntCourseConfiguration.ID = IDGenerator.GetStringGUID(); } else { _sqlpara = new SqlParameter(Schema.Common.PARA_UPDATE_MODE, Schema.Common.VAL_UPDATE_MODE); } _sqlcmd.Parameters.Add(_sqlpara); // Allowresize Parameter _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_ALLOW_RESIZE, pEntCourseConfiguration.AllowResize); _sqlcmd.Parameters.Add(_sqlpara); // AllowResize paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_ALLOW_SCROLL, pEntCourseConfiguration.AllowScroll); _sqlcmd.Parameters.Add(_sqlpara); // Avpath paramater if (!string.IsNullOrEmpty(pEntCourseConfiguration.AVPath)) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_AV_PATH, pEntCourseConfiguration.AVPath); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_AV_PATH, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // ClientID paramater if (!string.IsNullOrEmpty(pEntCourseConfiguration.ClientId)) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_CLIENT_ID, pEntCourseConfiguration.ClientId); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_CLIENT_ID, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Course launch New Window paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_LAUNCH_NEW_WINDOW, pEntCourseConfiguration.CourseLaunchNewWindow); _sqlcmd.Parameters.Add(_sqlpara); // Course Launch Same Window paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_LAUNCH_SAME_WINDOW, pEntCourseConfiguration.CourseLaunchSameWindow); _sqlcmd.Parameters.Add(_sqlpara); // Course Window Height paramater if (pEntCourseConfiguration.CourseWindowHeight != 0) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_WINDOW_HEIGHT, pEntCourseConfiguration.CourseWindowHeight); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_WINDOW_HEIGHT, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Course Window Width paramater if (pEntCourseConfiguration.CourseWindowWidth != 0) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_WINDOW_WIDTH, pEntCourseConfiguration.CourseWindowWidth); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_WINDOW_WIDTH, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Is Course Session No Expiry paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_IS_COURSE_SESSION_NO_EXPIRY, pEntCourseConfiguration.IsCourseSessionNoExpiry); _sqlcmd.Parameters.Add(_sqlpara); // Mastery Score paramater if (pEntCourseConfiguration.MasteryScore != 0) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_MASTERY_SCORE, pEntCourseConfiguration.MasteryScore); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_MASTERY_SCORE, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Max File upload Size paramater if (pEntCourseConfiguration.MaxFileUploadSizeMB != 0) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_MAX_FILE_UPLOAD_SIZE_MB, pEntCourseConfiguration.MaxFileUploadSizeMB); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_MAX_FILE_UPLOAD_SIZE_MB, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Course Question Response Tracking paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_QUESTION_RESPONSE_TRACKING, pEntCourseConfiguration.QuestionResponseTracking); _sqlcmd.Parameters.Add(_sqlpara); // Course Launch Same Window paramater _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_SCORE_TRACKING, pEntCourseConfiguration.ScoreTracking); _sqlcmd.Parameters.Add(_sqlpara); // Last Modified by ID paramater if (!string.IsNullOrEmpty(pEntCourseConfiguration.LastModifiedById)) { _sqlpara = new SqlParameter(Schema.Common.PARA_MODIFIED_BY, pEntCourseConfiguration.LastModifiedById); } else { _sqlpara = new SqlParameter(Schema.Common.PARA_MODIFIED_BY, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); // Course Configuration ID paramater if (!string.IsNullOrEmpty(pEntCourseConfiguration.ID)) { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_CONFIGURATION_ID, pEntCourseConfiguration.ID); } else { _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_COURSE_CONFIGURATION_ID, System.DBNull.Value); } _sqlcmd.Parameters.Add(_sqlpara); //-aw 6/15/2011 Added course protocol _sqlpara = new SqlParameter(Schema.CourseConfiguration.PARA_PROTOCOL, pEntCourseConfiguration.Protocol); _sqlcmd.Parameters.Add(_sqlpara); iRows = _sqlObject.ExecuteNonQuery(_sqlcmd, _strConnString); } catch (Exception expCommon) { //expCommon = new CustomException(_strMessageId, CustomException.WhoCallsMe(), ExceptionSeverityLevel.Critical, expCommon, true); throw expCommon; } return(pEntCourseConfiguration); }