public static List <Course> GetUserContentModule(CurriculumGeneral Curriculum)
 {
     try
     {
         Course            objContentModule;
         List <Course>     lstContentModule = new List <Course>();
         DbProviderFactory fact             = DbProviderFactories.GetFactory("System.Data.SqlClient");
         //string LearnerID = "";
         using (DbConnection conn = Config.GetConnection())
         {
             DbCommand cmd = fact.CreateCommand();
             cmd.CommandTimeout = 0;
             cmd.Connection     = conn;
             cmd.CommandText    = "GetUserContentModule";
             cmd.Parameters.Add(Config.GetParameter(fact, "@LearnerId", Curriculum.LearnerId));
             cmd.Parameters.Add(Config.GetParameter(fact, "@CurriculumId", Curriculum.CurriculumId));
             cmd.CommandType = CommandType.StoredProcedure;
             using (DbDataReader reader = cmd.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     objContentModule                          = new Course();
                     objContentModule.ActivityId               = reader["ActivityId"].ToString();
                     objContentModule.CurriculumId             = Curriculum.CurriculumId;
                     objContentModule.ContentModuleName        = reader["ContentModuleName"].ToString();
                     objContentModule.ContentModuleDescription = reader["ContentModuleDescription"].ToString();
                     objContentModule.ContentTrackId           = reader["ContentTrackId"].ToString();
                     objContentModule.CompletionStatus         = reader["CompletionStatus"].ToString();
                     objContentModule.DateOfCompletion         = reader["DateOfCompletion"].ToString();
                     objContentModule.DateOfStart              = reader["DateOfStart"].ToString();
                     objContentModule.NoOfPagesCompleted       = reader["NoOfPagesCompleted"].ToString();
                     objContentModule.percentCompleted         = reader["percentCompleted"].ToString();
                     objContentModule.TotalNoOfPages           = reader["TotalNoOfPages"].ToString();
                     objContentModule.Score                    = reader["Score"].ToString();
                     objContentModule.PassFailStatus           = reader["PassFailStatus"].ToString();
                     objContentModule.IsHTML5                  = reader["IsHTML5"].ToString();
                     objContentModule.DisplayOrder             = reader["DisplayOrder"].ToString();
                     lstContentModule.Add(objContentModule);
                 }
             }
         }
         return(lstContentModule);
     }
     catch (Exception ex)
     {
         clsErrorhandling objerror = new clsErrorhandling();
         objerror.LogException(ex, "ContentModule", "GetUserContentModule");
         return(null);
     }
 }
 public static List <CurriculumGeneral> GetUserCurriculum(Learner objLeaner)
 {
     try
     {
         CurriculumGeneral        objCurriculumGeneral;
         List <CurriculumGeneral> lstCurriculumGeneral = new List <CurriculumGeneral>();
         DbProviderFactory        fact = DbProviderFactories.GetFactory(Config.DbType);
         //string LearnerID = "";
         using (DbConnection conn = Config.GetConnection())
         {
             DbCommand cmd = fact.CreateCommand();
             cmd.CommandTimeout = 0;
             cmd.Connection     = conn;
             cmd.CommandText    = "GetUserCurriculum";
             cmd.Parameters.Add(Config.GetParameter(fact, "@LearnerId", objLeaner.LearnerId));
             cmd.CommandType = CommandType.StoredProcedure;
             using (DbDataReader reader = cmd.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     objCurriculumGeneral = new CurriculumGeneral();
                     objCurriculumGeneral.CurriculumId          = reader["CurriculumId"].ToString();
                     objCurriculumGeneral.CurriculumName        = reader["CurriculumName"].ToString();
                     objCurriculumGeneral.CurriculumDescription = reader["CurriculumDescription"].ToString();
                     //objCurriculumGeneral.CreateDate = reader["CreateDate"].ToString();
                     //objCurriculumGeneral.LastmodifiedDate = reader["LastmodifiedDate"].ToString();
                     objCurriculumGeneral.CurriculumTrackId = reader["CurriculumTrackId"].ToString();
                     objCurriculumGeneral.CompletionStatus  = reader["CompletionStatus"].ToString();
                     objCurriculumGeneral.DateOfStart       = reader["DateOfStart"].ToString();
                     objCurriculumGeneral.DateOfCompletion  = reader["DateOfCompletion"].ToString();
                     objCurriculumGeneral.EnableSequencing  = Convert.ToString(reader["enableSequencing"]);
                     objCurriculumGeneral.LearnerId         = objLeaner.LearnerId;
                     lstCurriculumGeneral.Add(objCurriculumGeneral);
                 }
             }
         }
         return(lstCurriculumGeneral);
     }
     catch (Exception ex)
     {
         clsErrorhandling objerror = new clsErrorhandling();
         objerror.LogException(ex, "CurriculumGeneral", "GetUserCurriculum");
         return(null);
     }
 }
Exemple #3
0
 public static List <Course> GetUserContentModule(CurriculumGeneral Curriculum)
 {
     return(CourseDAL.GetUserContentModule(Curriculum));
 }