Ejemplo n.º 1
0
        public List <SubTopicViewModel> GetSubTopic()
        {
            List <SqlParameter>     sqlParameterList     = new List <SqlParameter>();
            List <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table7", "SubTopic"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetAllMasterData", sqlParameterList, dataTableMappingList);
            List <SubTopicViewModel> testTypeList = new List <SubTopicViewModel>();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        string tableName = Convert.ToString(dt.Rows[0]["TableName"]);
                        switch (tableName)
                        {
                        case "SubTopic":
                            testTypeList = DGeneric.BindDataList <SubTopicViewModel>(dt);
                            break;
                        }
                    }
                }
            }
            return(testTypeList);
            //return ds.Tables["SubTopic"].AsEnumerable().Select(s => new SubTopicViewModel()
            //{
            //    SubTopicID = Convert.ToInt32(s["SubTopicID"]),
            //    SubTopic = s["SubTopic"].ToString(),
            //    Description = s["Description"].ToString(),
            //    TopicID = Convert.ToInt32(s["TopicID"]),
            //    IsActive = Convert.ToBoolean(s["IsActive"]),
            //}).ToList();
        }
Ejemplo n.º 2
0
 public List <CourseViewModel> GetCourseByStream(string StreamId)
 {
     if (StreamId != "")
     {
         List <SqlParameter> parameter = new List <SqlParameter>();
         parameter.Add(new SqlParameter("@StreamID", StreamId));
         DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStreamCourseBatch", parameter, null).Tables[0];
         if (dt.Rows.Count > 0)
         {
             return(DGeneric.BindDataList <CourseViewModel>(dt));
         }
         else
         {
             return(new List <CourseViewModel>());
         }
         //return dt.AsEnumerable().Select(s => new CourseViewModel()
         //{
         //    CourseID = Convert.ToInt32(s["CourseID"]),
         //    Course = Convert.ToString(s["Course"])
         //}).ToList();
     }
     else
     {
         return(new List <CourseViewModel>());
     }
 }
Ejemplo n.º 3
0
        public StudyMaterialViewModel GetStudyMaterialByID(int StudyMaterialID)
        {
            var studyMaterialViewModelData       = new StudyMaterialViewModel();
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@StudyMaterialID", StudyMaterialID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStudyMaterialByID", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudyMaterialViewModel>(dt).FirstOrDefault());
            }
            else
            {
                return(new List <StudyMaterialViewModel>().FirstOrDefault());
            }
            //if (ds.Tables.Count > 0)
            //{
            //                    studyMaterialViewModelData = DGeneric.BindDataList<OnlineTestViewModel>(dt).FirstOrDefault();
            //                    studyMaterialViewModelData.StreamID = dt.Rows[0]["StreamID"].ToString().Split(',').Select(int.Parse).ToArray();
            //                    //Vaibhav Changed because of empty data
            //                    // onlineTestViewModelData.CourseID = dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray();
            //                    // onlineTestViewModelData.BatchID = dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray();
            //                    studyMaterialViewModelData.CourseID = dt.Rows[0]["CourseID"].ToString() != string.Empty ? dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
            //                    studyMaterialViewModelData.BatchID = dt.Rows[0]["BatchID"].ToString() != string.Empty ? dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
            //}
            //return studyMaterialViewModelData;
        }
Ejemplo n.º 4
0
        public List <TopicViewModel> GetTopic()
        {
            List <SqlParameter>     sqlParameterList     = new List <SqlParameter>();
            List <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table6", "Topic"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetAllMasterData", sqlParameterList, dataTableMappingList);
            List <TopicViewModel> testTypeList = new List <TopicViewModel>();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        string tableName = Convert.ToString(dt.Rows[0]["TableName"]);
                        switch (tableName)
                        {
                        case "Topic":
                            testTypeList = DGeneric.BindDataList <TopicViewModel>(dt);
                            break;
                        }
                    }
                }
            }

            return(testTypeList);
        }
Ejemplo n.º 5
0
        public static Login GetUserDetails1(Login user)
        {
            List <SqlParameter> parameter = new List <SqlParameter>();

            parameter.Add(new SqlParameter("@UserName", user.UserName));
            parameter.Add(new SqlParameter("@Password", user.UserPassword));
            parameter.Add(new SqlParameter("@UserTypeID", user.UserTypeID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_Login", parameter, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <Login>(dt).FirstOrDefault());
            }
            else
            {
                return(new Login());
            }

            //Login Userlist = null;
            //foreach (DataRow dr in dt.Rows)
            //{
            //    Userlist = new Login()
            //    {
            //        UserID = Convert.ToInt32(dr["UserID"]),
            //        FirstName = dr["FirstName"].ToString(),
            //        LastName = dr["LastName"].ToString(),
            //        MobileNo = dr["Mobile"].ToString(),
            //        UserName = dr["UserName"].ToString(),
            //      //  UserPassword = Convert.ToString(dr["UserPassword"]),
            //        UserTypeID = Convert.ToInt32(dr["UserTypeID"]),
            //        UserType = Convert.ToString(dr["UserType"])
            //    };
            //}
            //return Userlist;
        }
Ejemplo n.º 6
0
        public List <EligibleStudentViewModel> GetEligibleStudent(int OnlineTestID)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@OnlineTestID", OnlineTestID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetEligibleStudent", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <EligibleStudentViewModel>(dt));
            }
            //return dt.AsEnumerable().Select(s => new EligibleStudentViewModel()
            //{
            //    StudentID = Convert.ToInt32(s["StudentID"]),
            //    OnlineTestID = Convert.ToInt32(s["OnlineTestID"]),
            //    EnrollmentNo = (s["EnrollmentNo"]).ToString(),
            //    StudentName = (s["StudentName"]).ToString(),
            //    Gender = (s["Gender"]).ToString(),
            //    MobileNumber = (s["MobileNumber"]).ToString(),
            //    FatherMobileNo = (s["FatherMobileNo"]).ToString(),
            //    IsEligible = Convert.ToBoolean((s["IsEligible"])),
            //    TestStatusID = Convert.ToInt32(s["TestStatusID"])
            //}).ToList();
            else
            {
                return(new List <EligibleStudentViewModel>());
            }
        }
Ejemplo n.º 7
0
        public List <TestTypeViewModel> GetTestType()
        {
            List <SqlParameter>     sqlParameterList     = new List <SqlParameter>();
            List <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table", "TestType"));
            dataTableMappingList.Add(new DataTableMapping("Table1", "QuestionType"));
            dataTableMappingList.Add(new DataTableMapping("Table2", "Subject"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetAllMasterData", sqlParameterList, dataTableMappingList);
            List <TestTypeViewModel> testTypeList = new List <TestTypeViewModel>();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        string tableName = Convert.ToString(dt.Rows[0]["TableName"]);
                        switch (tableName)
                        {
                        case "TestType":
                            testTypeList = DGeneric.BindDataList <TestTypeViewModel>(dt);
                            break;
                        }
                    }
                }
            }

            return(ds.Tables["TestType"].AsEnumerable().Select(s => new TestTypeViewModel()
            {
                TestTypeID = Convert.ToInt32(s["TestTypeID"]),
                TestType = s["TestType"].ToString(),
            }).ToList());
        }
Ejemplo n.º 8
0
        public List <StudentViewModel> GetStudentDetails()
        {
            string strQuery = @"SELECT  dbo.StudentAccount.StudentAccountID, dbo.StudentAccount.StudentID, dbo.StudentAccount.Password, dbo.StudentAccount.IsActive, 
                      dbo.StudentAccount.CreatedByUserID, dbo.StudentAccount.CreatedOnDate, dbo.Student.EnrollmentNo, dbo.Student.EnrollmentDate, dbo.Student.FirstName, 
                      dbo.Student.MiddleName, dbo.Student.LastName, dbo.Student.Gender, dbo.Student.DOB, dbo.Student.MobileNumber, dbo.Student.PhoneNumber, dbo.Student.Email, 
                      dbo.Student.Address, dbo.Student.Landmark, dbo.Student.CityID, dbo.Student.Pin, dbo.Student.Medium, dbo.Student.Cast, dbo.Student.PhotoUrl, 
                      dbo.Student.StreamID, dbo.Student.CourseID, dbo.Student.BatchID, dbo.Student.SessionID, dbo.Student.[School/College], dbo.Student.FatherName, 
                      dbo.Student.FatherOccupation, dbo.Student.FatherMobile, dbo.Student.FatherEmail,ss.[Session],s.Stream,c.Course,b.Batch
                    FROM dbo.StudentAccount left JOIN dbo.Student ON dbo.Student.StudentID = dbo.StudentAccount.StudentID
											left join dbo.[Session] ss on Student.SessionID= ss.SessionID
											left join dbo.Stream s on Student.StreamID= s.StreamID
											left join dbo.Course c on Student.CourseID= c.CourseID
											left join dbo.Batch b on Student.BatchID= b.BatchID"                                            ;

            DataTable dt = DGeneric.GetData(strQuery).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudentViewModel>(dt));
            }
            else
            {
                return(new List <StudentViewModel>());
            }
            //return dt.AsEnumerable().Select(x => new StudentViewModel()
            //{
            //    StudentAccountID = Convert.ToInt32(x["StudentAccountID"]),
            //    StudentID = Convert.ToInt32(x["StudentID"]),
            //    EnrollmentNo = x["EnrollmentNo"].ToString(),
            //    EnrollmentDate = x["EnrollmentDate"].ToString().ConvertDateTimeToString(),
            //    FirstName = x["FirstName"].ToString(),
            //    LastName = x["LastName"].ToString(),
            //    Gender = x["Gender"].ToString(),
            //    DOB = x["DOB"].ToString().ConvertDateTimeToString(),
            //    MobileNo = x["MobileNumber"].ToString(),
            //    Email = x["Email"].ToString(),
            //    Address = x["Address"].ToString(),
            //    Landmark = x["Landmark"].ToString(),
            //    Pincode = x["Pin"].ToString(),
            //    CityID = Convert.ToInt32(x["CityID"]),
            //    Caste = x["Cast"].ToString(),
            //    PhotoUrl = x["PhotoUrl"].ToString(),
            //    Medium = x["Medium"].ToString(),
            //    FatherName = x["FatherName"].ToString(),
            //    FatherMobile = x["FatherMobile"].ToString(),
            //    FatherEmail = x["FatherEmail"].ToString(),
            //    //SessionID = Convert.ToInt32(x["SessionID"]),
            //    //StreamID = Convert.ToInt32(x["StreamID"]),
            //    //CourseID = Convert.ToInt32(x["CourseID"]),
            //    //BatchID = Convert.ToInt32(x["BatchID"]),

            //}).ToList();
        }
Ejemplo n.º 9
0
        public List <StudyMaterialViewModel> GetStudyMaterial()
        {
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStudyMaterial", null, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudyMaterialViewModel>(dt));
            }
            else
            {
                return(new List <StudyMaterialViewModel>());
            }
        }
Ejemplo n.º 10
0
        public List <GeneralSettingsViewModel> GetGeneralSettings()
        {
            DataTable dt = DGeneric.GetData("Select * from GeneralSettings").Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <GeneralSettingsViewModel>(dt));
            }
            else
            {
                return(new List <GeneralSettingsViewModel>());
            }
        }
Ejemplo n.º 11
0
        public StudentDashboardViewModel GetStudentDashboardDetail(int StudentID)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("StudentID", StudentID));
            List <DataTableMapping> dataTableMapping = new List <DataTableMapping>();

            dataTableMapping.Add(new DataTableMapping("Table", "TotalTest"));
            dataTableMapping.Add(new DataTableMapping("Table1", "NotStarted"));
            dataTableMapping.Add(new DataTableMapping("Table2", "Started"));
            dataTableMapping.Add(new DataTableMapping("Table3", "Completed"));
            dataTableMapping.Add(new DataTableMapping("Table4", "TestPercentage"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetStudentDashboard", sqlParameterList, dataTableMapping);
            var     StudentDashboardData = new StudentDashboardViewModel();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        string tableName = Convert.ToString(dt.TableName);
                        switch (tableName)
                        {
                        case "TotalTest":
                            StudentDashboardData.TotalTest = Convert.ToInt32(dt.Rows[0]["TotalTest"]);
                            break;

                        case "NotStarted":
                            StudentDashboardData.NotStarted = Convert.ToInt32(dt.Rows[0]["NotStarted"]);
                            break;

                        case "Started":
                            StudentDashboardData.Started = Convert.ToInt32(dt.Rows[0]["Started"]);
                            break;

                        case "Completed":
                            StudentDashboardData.Completed = Convert.ToInt32(dt.Rows[0]["Completed"]);
                            break;

                        case "TestPercentage":
                            StudentDashboardData.TestPercentage = DGeneric.BindDataList <TestPercentage>(dt).OrderBy(o => o.ResultID).ToList();
                            break;
                        }
                    }
                }
            }

            return(StudentDashboardData);
        }
Ejemplo n.º 12
0
        public List <SliderViewModel> GetSlider(int SliderID)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("SliderID", SliderID > 0 ? SliderID : 0));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetSlider", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <SliderViewModel>(dt));
            }
            else
            {
                return(new List <SliderViewModel>());
            }
        }
Ejemplo n.º 13
0
        public List <StudyMaterialViewModel> GetStudyMaterialBySubTopic(string SubTopicID)
        {
            List <SqlParameter> parameter = new List <SqlParameter>();

            parameter.Add(new SqlParameter("SubTopicID", SubTopicID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStudyMaterialBySubTopic", parameter, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudyMaterialViewModel>(dt));
            }
            else
            {
                return(new List <StudyMaterialViewModel>());
            }
        }
Ejemplo n.º 14
0
        public List <NotificationViewModel> GetNotification(int NotificationID, int ReciverID)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("NotificationID", NotificationID > 0 ? NotificationID : 0));
            sqlParameterList.Add(new SqlParameter("ReciverID", ReciverID > 0 ? ReciverID : 0));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetNotification", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <NotificationViewModel>(dt));
            }
            else
            {
                return(new List <NotificationViewModel>());
            }
        }
Ejemplo n.º 15
0
        public List <StudentOnlineTestViewModel> GetOnlineTestByStudentID(int StudentID)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@StudentID", StudentID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetOnlineTestByStudentID", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudentOnlineTestViewModel>(dt));
            }
            else
            {
                return(new List <StudentOnlineTestViewModel>());
            }
            //return dt.AsEnumerable().Select(s => new StudentOnlineTestViewModel()
            //{
            //    EligibleStudentID = Convert.ToInt32(s["EligibleStudentID"]),
            //    StudentID = Convert.ToInt32(s["StudentID"]),
            //    OnlineTestID = Convert.ToInt32(s["OnlineTestID"]),
            //    OnlineTestNo = s["OnlineTestNo"].ToString(),
            //    TestSeriesID = Convert.ToInt32(s["TestSeriesID"]),
            //    TestTypeID = Convert.ToInt32(s["TestTypeID"]),
            //    TestSeriesName = s["TestSeries"].ToString(),
            //    TestTypeName = s["TestType"].ToString(),
            //    TestName = s["TestName"].ToString(),
            //    TestDuration = s["TestDuration"].ToString(),
            //    SessionID = Convert.ToInt32(s["SessionID"]),
            //    //StreamID = Convert.ToInt32(s["StreamID"]),
            //    //CourseID = Convert.ToInt32(s["CourseID"]),
            //    //BatchID = Convert.ToInt32(s["BatchID"]),
            //    SubjectID = Convert.ToInt32(s["SubjectID"]),
            //    Topic = s["Topic"].ToString(),
            //    Instructions = s["Instructions"].ToString(),
            //    TestMarks = s["TestMarks"].ToString(),
            //    PassingPercentage = s["PassingPercentage"].ToString(),
            //    IsNegativeMarking = Convert.ToBoolean(s["IsNegativeMarking"]),
            //    IsVisible = Convert.ToBoolean(s["IsVisible"]),
            //    StartTime = s["StartTime"].ToString(),
            //    EndTime = s["EndTime"].ToString(),
            //    StartDate = Convert.ToDateTime(s["StartDate"]),
            //    EndDate = Convert.ToDateTime(s["EndDate"]),
            //    IsActive = Convert.ToBoolean(s["IsActive"])
            //}).ToList();
        }
Ejemplo n.º 16
0
        public List <StudentResponseViewModel> GetStudentResponse(int StudentID, int TestID)
        {
            List <SqlParameter> paramerterList = new List <SqlParameter>();

            paramerterList.Add(new SqlParameter("@StudentID", StudentID));
            paramerterList.Add(new SqlParameter("@TestID", TestID));
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStudentResponse", paramerterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudentResponseViewModel>(dt));
            }

            else
            {
                return(new List <StudentResponseViewModel>());
            }
        }
Ejemplo n.º 17
0
        //return dt.AsEnumerable().Select(s => new BatchViewModel()
        //{
        //    BatchID = Convert.ToInt32(s["BatchID"]),
        //    Batch = s["Batch"].ToString(),
        //}).ToList();

        public List <SessionViewModel> GetSession()
        {
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_SessionSelect", null, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <SessionViewModel>(dt));
            }
            else
            {
                return(new List <SessionViewModel>());
            }
            //return dt.AsEnumerable().Select(s => new SessionViewModel()
            //{
            //    SessionID = Convert.ToInt32(s["SessionID"]),
            //    Session = Convert.ToString(s["Session"]),
            //}).ToList();
        }
Ejemplo n.º 18
0
        public List <OnlineTestViewModel> GetOnlineTest()
        {
            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetAllOnlineTest", null, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <OnlineTestViewModel>(dt));
            }
            else
            {
                return(new List <OnlineTestViewModel>());
            }

            //return dt.AsEnumerable().Select(s => new OnlineTestViewModel()
            //{
            //    OnlineTestID = Convert.ToInt32(s["OnlineTestID"]),
            //    OnlineTestNo = s["OnlineTestNo"].ToString(),
            //    TestSeriesID = Convert.ToInt32(s["TestSeriesID"]),
            //    TestSeries = s["TestSeries"].ToString(),
            //    TestTypeID = Convert.ToInt32(s["TestTypeID"]),
            //    TestType = s["TestType"].ToString(),
            //    TestName = s["TestName"].ToString(),
            //    TestDuration = s["TestDuration"].ToString(),
            //    SessionID = Convert.ToInt32(s["SessionID"]),
            //    //StreamID = s["StreamID"].ToString().Split(',').ToArray(),
            //    //CourseID = Convert.ToInt32(s["CourseID"]),
            //    //BatchID = Convert.ToInt32(s["BatchID"]),
            //    //StreamID = s["StreamID"].ToString().Split(',').Select(int.Parse).ToArray(),
            //    //CourseID = s["CourseID"].ToString() != string.Empty ? dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray() : null,
            //    //BatchID = s["BatchID"].ToString() != string.Empty ? dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray() : null,
            //   // SubjectID = Convert.ToInt32(s["SubjectID"]),
            //    Topic = s["Topic"].ToString(),
            //    Instructions = s["Instructions"].ToString(),
            //    TestMarks = s["TestMarks"].ToString(),
            //    PassingPercentage = s["PassingPercentage"].ToString(),
            //    IsNegativeMarking = Convert.ToBoolean(s["IsNegativeMarking"]),
            //    IsVisible = Convert.ToBoolean(s["IsVisible"]),
            //    StartTime = s["StartTime"].ToString(),
            //    EndTime = s["EndTime"].ToString(),
            //    StartDate = Convert.ToString(s["StartDate"]).ConvertDateTimeToString(),
            //    EndDate = Convert.ToString(s["EndDate"]).ConvertDateTimeToString()
            //}).ToList();
        }
Ejemplo n.º 19
0
        public List <StudentReport> GetFilteredStudent(StudentReport objSR)
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@SessionID", !string.IsNullOrEmpty(objSR.SessionID)? objSR.SessionID:null));
            sqlParameterList.Add(new SqlParameter("@StreamID", objSR.StreamID != null ? objSR.StreamID.Length > 0 ? string.Join(",", objSR.StreamID) : string.Empty : string.Empty));
            sqlParameterList.Add(new SqlParameter("@CourseID", objSR.CourseID != null ? objSR.CourseID.Length > 0 ? string.Join(",", objSR.CourseID) : string.Empty : string.Empty));
            sqlParameterList.Add(new SqlParameter("@BatchID", objSR.BatchID != null & objSR.CourseID != null ? objSR.BatchID.Length > 0 & objSR.CourseID.Length > 0 ? string.Join(",", objSR.BatchID) : string.Empty : string.Empty));

            DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetFilterStudent", sqlParameterList, null).Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(DGeneric.BindDataList <StudentReport>(dt));
            }
            else
            {
                return(new List <StudentReport>());
            }
        }
Ejemplo n.º 20
0
        public TopicViewModel GetTopicByID(int TopicID)
        {
            var topicViewModelData = new TopicViewModel();
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@TopicID", TopicID));
            IList <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table", "Topic"));
            dataTableMappingList.Add(new DataTableMapping("Table1", "Course"));
            dataTableMappingList.Add(new DataTableMapping("Table2", "Batch"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetTopicByID", sqlParameterList, dataTableMappingList);

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        switch (dt.TableName)
                        {
                        case "Topic":
                            topicViewModelData          = DGeneric.BindDataList <TopicViewModel>(dt).FirstOrDefault();
                            topicViewModelData.StreamID = dt.Rows[0]["StreamID"].ToString().Split(',').Select(int.Parse).ToArray();
                            topicViewModelData.CourseID = dt.Rows[0]["CourseID"].ToString() != string.Empty ? dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            topicViewModelData.BatchID  = dt.Rows[0]["BatchID"].ToString() != string.Empty ? dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            break;

                        case "Course":
                            topicViewModelData.Course = DGeneric.BindDataList <CourseViewModel>(dt);
                            break;

                        case "Batch":
                            topicViewModelData.Batch = DGeneric.BindDataList <BatchViewModel>(dt);
                            break;
                        }
                    }
                }
            }
            return(topicViewModelData);
        }
Ejemplo n.º 21
0
 public List <BatchViewModel> GetBatchByCourse(string CourseId)
 {
     if (CourseId != "")
     {
         List <SqlParameter> parameter = new List <SqlParameter>();
         parameter.Add(new SqlParameter("CourseID", CourseId));
         DataTable dt = DGeneric.RunSP_ReturnDataSet("sp_GetStreamCourseBatch", parameter, null).Tables[0];
         if (dt.Rows.Count > 0)
         {
             return(DGeneric.BindDataList <BatchViewModel>(dt));
         }
         else
         {
             return(new List <BatchViewModel>());
         }
     }
     else
     {
         return(new List <BatchViewModel>());
     }
 }
Ejemplo n.º 22
0
        public OnlineTestViewModel GetOnlineTestById(int OnlineTestID)
        {
            var onlineTestViewModelData          = new OnlineTestViewModel();
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@OnlineTestID", OnlineTestID));
            IList <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table", "OnlineTest"));
            dataTableMappingList.Add(new DataTableMapping("Table1", "Course"));
            dataTableMappingList.Add(new DataTableMapping("Table2", "Batch"));
            dataTableMappingList.Add(new DataTableMapping("Table3", "Subject"));
            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetOnlineTestById", sqlParameterList, dataTableMappingList);

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        switch (dt.TableName)
                        {
                        case "OnlineTest":
                            onlineTestViewModelData          = DGeneric.BindDataList <OnlineTestViewModel>(dt).FirstOrDefault();
                            onlineTestViewModelData.StreamID = dt.Rows[0]["StreamID"].ToString().Split(',').Select(int.Parse).ToArray();
                            //Vaibhav Changed because of empty data
                            // onlineTestViewModelData.CourseID = dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray();
                            // onlineTestViewModelData.BatchID = dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray();
                            onlineTestViewModelData.CourseID  = dt.Rows[0]["CourseID"].ToString() != string.Empty ? dt.Rows[0]["CourseID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            onlineTestViewModelData.BatchID   = dt.Rows[0]["BatchID"].ToString() != string.Empty ? dt.Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            onlineTestViewModelData.SubjectID = dt.Rows[0]["SubjectID"].ToString() != string.Empty ? dt.Rows[0]["SubjectID"].ToString().Split(',').Select(int.Parse).ToArray() : null;

                            //onlineTestViewModelData.StartDate = Convert.ToString(dt.Rows[0]["StartDate"]).ConvertDateTimeToString();
                            //onlineTestViewModelData.EndDate = Convert.ToString(dt.Rows[0]["EndDate"]).ConvertDateTimeToString();
                            break;

                        case "Course":
                            onlineTestViewModelData.Course = DGeneric.BindDataList <CourseViewModel>(dt);
                            break;

                        case "Batch":
                            onlineTestViewModelData.Batch = DGeneric.BindDataList <BatchViewModel>(dt);
                            break;

                        case "Subject":
                            onlineTestViewModelData.Subject = DGeneric.BindDataList <SubjectViewModel>(dt);
                            break;
                        }
                    }
                }
            }
            return(onlineTestViewModelData);
            //if (dt.Rows.Count > 0)
            //{
            //    foreach (DataRow item in dt.Rows)
            //    {
            //        onlineTestViewModelData.OnlineTestID = Convert.ToInt32(item["OnlineTestID"]);
            //        onlineTestViewModelData.OnlineTestNo = item["OnlineTestNo"].ToString();
            //        onlineTestViewModelData.TestSeriesID = Convert.ToInt32(item["TestSeriesID"]);
            //        onlineTestViewModelData.TestTypeID = Convert.ToInt32(item["TestTypeID"]);
            //        onlineTestViewModelData.TestName = item["TestName"].ToString();
            //        onlineTestViewModelData.TestDuration = item["TestDuration"].ToString();
            //        onlineTestViewModelData.SessionID = Convert.ToInt32(item["SessionID"]);
            //        onlineTestViewModelData.StreamID = item["StreamID"].ToString().Split(',').Cast<int>().ToArray();
            //        onlineTestViewModelData.CourseID = item["CourseID"].ToString().Split(',').Cast<int>().ToArray();
            //        onlineTestViewModelData.BatchID = item["BatchID"].ToString().Split(',').Cast<int>().ToArray();
            //        onlineTestViewModelData.SubjectID = Convert.ToInt32(item["SubjectID"]);
            //        onlineTestViewModelData.Topic = item["Topic"].ToString();
            //        onlineTestViewModelData.Instructions = item["Instructions"].ToString();
            //        onlineTestViewModelData.TestMarks = item["TestMarks"].ToString();
            //        onlineTestViewModelData.PassingPercentage = item["PassingPercentage"].ToString();
            //        onlineTestViewModelData.IsNegativeMarking = Convert.ToBoolean(item["IsNegativeMarking"]);
            //        onlineTestViewModelData.IsVisible = Convert.ToBoolean(item["IsVisible"]);
            //        onlineTestViewModelData.StartTime = item["StartTime"].ToString();
            //        onlineTestViewModelData.EndTime = item["EndTime"].ToString();
            //        onlineTestViewModelData.StartDate = Convert.ToDateTime(item["StartDate"]);
            //        onlineTestViewModelData.EndDate = Convert.ToDateTime(item["EndDate"]);
            //    }
            //}
            //return onlineTestViewModelData;
            //return ds.Tables[0].AsEnumerable().Select(s => new OnlineTestViewModel()
            //{
            //    OnlineTestID = Convert.ToInt32(s["OnlineTestID"]),
            //    OnlineTestNo = s["OnlineTestNo"].ToString(),
            //    TestSeriesID = Convert.ToInt32(s["TestSeriesID"]),
            //    TestTypeID = Convert.ToInt32(s["TestTypeID"]),
            //    TestName = s["TestName"].ToString(),
            //    TestDuration = s["TestDuration"].ToString(),
            //    SessionID = Convert.ToInt32(s["SessionID"]),
            //    StreamID = s["StreamID"].ToString().Split(',').Cast<int>().ToArray(),
            //    CourseID = s["CourseID"].ToString().Split(',').Cast<int>().ToArray(),
            //    BatchID = s["BatchID"].ToString().Split(',').Cast<int>().ToArray(),
            //    SubjectID = Convert.ToInt32(s["SubjectID"]),
            //    Topic = s["Topic"].ToString(),
            //    Instructions = s["Instructions"].ToString(),
            //    TestMarks = s["TestMarks"].ToString(),
            //    PassingPercentage = s["PassingPercentage"].ToString(),
            //    IsNegativeMarking = Convert.ToBoolean(s["IsNegativeMarking"]),
            //    IsVisible = Convert.ToBoolean(s["IsVisible"]),
            //    StartTime = s["StartTime"].ToString(),
            //    EndTime = s["EndTime"].ToString(),
            //    StartDate = Convert.ToDateTime(s["StartDate"]),
            //    EndDate = Convert.ToDateTime(s["EndDate"])
            //}).FirstOrDefault();
        }
Ejemplo n.º 23
0
        public MasterViewModel GetMasterData()
        {
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();
            DataSet             ds = DGeneric.RunSP_ReturnDataSet("sp_GetAllMasterData", sqlParameterList, null);
            var masterData         = new MasterViewModel();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        string tableName = Convert.ToString(dt.Rows[0]["TableName"]);
                        switch (tableName)
                        {
                        case "TestType":
                            masterData.TestType = DGeneric.BindDataList <TestTypeViewModel>(dt);
                            break;

                        case "TestSeries":
                            masterData.TestSeries = DGeneric.BindDataList <TestSeriesViewModel>(dt);
                            break;

                        case "Stream":
                            masterData.Stream = DGeneric.BindDataList <StreamViewModel>(dt);
                            break;

                        case "Session":
                            masterData.Session = DGeneric.BindDataList <SessionViewModel>(dt);
                            break;

                        case "Subject":
                            masterData.Subject = DGeneric.BindDataList <SubjectViewModel>(dt);
                            break;

                        case "Topic":
                            masterData.Topic = DGeneric.BindDataList <TopicViewModel>(dt);
                            break;

                        case "SubTopic":
                            masterData.SubTopic = DGeneric.BindDataList <SubTopicViewModel>(dt);
                            break;

                        case "Batch":
                            masterData.Batch = DGeneric.BindDataList <BatchViewModel>(dt);
                            break;

                        case "DefaultLecture":
                            masterData.DefaultLecture = DGeneric.BindDataList <LectureModel>(dt);
                            break;

                        case "Users":
                            masterData.UserList = DGeneric.BindDataList <UserViewModel>(dt);
                            break;

                        case "Faculty":
                            masterData.FacultyList = DGeneric.BindDataList <FacultyViewModel>(dt);
                            break;
                        }
                    }
                }
            }

            return(masterData);
        }
Ejemplo n.º 24
0
        public TimeTableViewModel GetTimeTableByDate(TimeTableViewModel objTimeTable)
        {
            var timeTableViewModel = new TimeTableViewModel();
            List <DataTableMapping> dataTableMappingList = new List <DataTableMapping>();

            dataTableMappingList.Add(new DataTableMapping("Table", "TimeTable"));
            dataTableMappingList.Add(new DataTableMapping("Table1", "Lecture"));
            dataTableMappingList.Add(new DataTableMapping("Table2", "Batch"));
            dataTableMappingList.Add(new DataTableMapping("Table3", "DefaultLecture"));
            List <SqlParameter> sqlParameterList = new List <SqlParameter>();

            sqlParameterList.Add(new SqlParameter("@Date", Convert.ToDateTime(objTimeTable.FromDate)));
            sqlParameterList.Add(new SqlParameter("@ShiftID", Convert.ToInt32(objTimeTable.ShiftID)));
            sqlParameterList.Add(new SqlParameter("@SessionID", Convert.ToInt32(objTimeTable.SessionID)));

            DataSet ds = DGeneric.RunSP_ReturnDataSet("sp_GetTimeTableByDate", sqlParameterList, dataTableMappingList);

            List <LectureViewModel> obj = new List <LectureViewModel>();

            if (ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        switch (dt.TableName)
                        {
                        case "Lecture":
                            foreach (DataRow dr in ds.Tables[1].Rows)
                            {
                                obj.Add(new LectureViewModel()
                                {
                                    Lecture = new LectureViewModel()
                                    {
                                        LectureID   = Convert.ToInt32(dr["LectureID"]),
                                        LectureName = dr["Lecture"].ToString(),
                                        Time_From   = dr["Time_From"].ToString(),
                                        Time_To     = dr["Time_To"].ToString()
                                    },
                                    Batch = new ViewModels.Master.BatchViewModel()
                                    {
                                        BatchID = Convert.ToInt32(dr["BatchID"]),
                                        Batch   = dr["Batch"].ToString()
                                    },
                                    Subject     = dr["Subject"].ToString(),
                                    FacultyID   = Convert.ToInt32(dr["FacultyID"]),
                                    Faculty     = dr["Faculty"].ToString(),
                                    TimeTableID = Convert.ToInt32(dr["TimeTableID"]),
                                    ID          = Convert.ToInt32(dr["ID"])
                                });
                            }
                            break;

                        case "TimeTable":
                            timeTableViewModel             = DGeneric.BindDataList <TimeTableViewModel>(ds.Tables[0]).FirstOrDefault();
                            timeTableViewModel.DateType    = "single";
                            timeTableViewModel.FromDate    = Convert.ToString(ds.Tables[0].Rows[0]["TimeTableDate"]).ConvertDateTimeToString();
                            timeTableViewModel.LectureID   = ds.Tables[0].Rows[0]["LectureID"].ToString() != string.Empty ? ds.Tables[0].Rows[0]["LectureID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            timeTableViewModel.BatchID     = ds.Tables[0].Rows[0]["BatchID"].ToString() != string.Empty ? ds.Tables[0].Rows[0]["BatchID"].ToString().Split(',').Select(int.Parse).ToArray() : null;
                            timeTableViewModel.LectureList = obj;
                            break;

                        case "DefaultLecture":
                            timeTableViewModel.Lecture = DGeneric.BindDataList <LectureModel>(dt);

                            break;

                        case "Batch":
                            timeTableViewModel.Batch = DGeneric.BindDataList <BatchViewModel>(dt);
                            break;
                        }
                    }
                }
            }



            return(timeTableViewModel);
            //return ds.Tables[0].AsEnumerable().Select(s => new TimeTableViewModel()
            //{
            //    TimeTableID = Convert.ToInt32(s["TimeTableID"]),
            //    Description = s["Description"].ToString(),
            //    FromDate = Convert.ToDateTime(s["TimeTableDate"]),
            //    ToDate = Convert.ToDateTime(s["TimeTableDate"]),
            //    ShiftID = Convert.ToInt32(s["ShiftID"]),
            //    SessionID = Convert.ToInt32(s["SessionID"]),
            //    BatchID = Convert.ToInt32(s["BatchID"]).Split(',').ToArray(),
            //    LectureID = Convert.ToInt32(s["LectureID"]),
            //    CreatedByUserID = Convert.ToInt32(s["CreatedByUserID"]),
            //    CreatedOnDate = Convert.ToDateTime(s["CreatedOnDate"]),
            //    IsActive = Convert.ToBoolean(s["IsActive"]),
            //    LectureList = obj
            //}).ToList();
        }