public List <Qiyas.BusinessLogicLayer.Entity.PPM.Exam> GetAllView() { List <Qiyas.BusinessLogicLayer.Entity.PPM.Exam> exams = new List <Entity.PPM.Exam>(); var examsView = db.ExamViews.ToList(); foreach (var item in examsView) { Qiyas.BusinessLogicLayer.Entity.PPM.Exam exam = new Entity.PPM.Exam(); exam.CreatedDate = item.CreatedDate; exam.CreatorID = item.CreatorID; exam.ExamCode = item.ExamCode; exam.ExamID = item.ExamID; exam.ExamSpecialityID = item.ExamSpecialityID; exam.ExamTypeID = item.ExamTypeID; exam.IsActive = item.IsActive; exam.ModifiedByID = item.ModifiedByID; exam.ModifiedDate = item.ModifiedDate; exam.Name = item.Name; exam.Notes = item.Notes; exam.NumberofPages = item.NumberofPages; exam.NumberofSections = item.NumberofSections; exam.StudentGenderID = item.StudentGenderID; exam.TimeForSection = item.TimeForSection; exams.Add(exam); } return(exams); }
public Qiyas.BusinessLogicLayer.Entity.PPM.Exam GetByCode(string Code) { Qiyas.BusinessLogicLayer.Entity.PPM.Exam examType = null; var ex = db.Exams.Where(c => c.ExamCode == Code).FirstOrDefault(); if (ex != null) { examType = new Entity.PPM.Exam(ex); } return(examType); }