public List <Contact> FindAll() { using (ElearningEntities e = new ElearningEntities()) { List <Contact> c = new List <Contact>(); try { IEnumerable <Contact> contact = e.Contacts.OrderBy(i => i.Email); c = contact.ToList(); } catch { c = null; } return(c); } }
public Contact FindByID(string name) { Contact con = null; using (ElearningEntities e = new ElearningEntities()) { try { con = e.Contacts.First(i => i.Email == name); } catch { return con; } return con; } }
public Contact FindByID(string name) { Contact con = null; using (ElearningEntities e = new ElearningEntities()) { try { con = e.Contacts.First(i => i.Email == name); } catch { return(con); } return(con); } }
public List<Department> FindAll() { List<Department> selectedDep = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Department> dep = e.Departments; selectedDep = dep.ToList(); } } catch { return selectedDep; } return selectedDep; }
public List<Question> FindAll() { List<Question> selectedQuestioner = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Question> q = e.Questions; selectedQuestioner = q.ToList(); } } catch { return selectedQuestioner; } return selectedQuestioner; }
public List<Contact> FindAll() { using (ElearningEntities e = new ElearningEntities()) { List<Contact> c = new List<Contact>(); try { IEnumerable<Contact> contact = e.Contacts.OrderBy(i => i.Email); c = contact.ToList(); } catch { c = null; } return c; } }
public Employee FindById(string firstname, string lastname) { Employee selectedEmployee = null; try { using (ElearningEntities e = new ElearningEntities()) { Employee emp = e.Employees.First(i => i.Firstname == firstname); selectedEmployee = emp; } } catch { return selectedEmployee; } return selectedEmployee; }
public Score FindById(int id) { Score selectedScore = null; try { using (ElearningEntities e = new ElearningEntities()) { Score s = e.Scores.First(i => i.ScoreID == id); selectedScore = s; } } catch { return selectedScore; } return selectedScore; }
//public Quiz FindbyId(int id) //{ // Quiz selectedQuiz = null; //try //{ //using (ElearningEntities e = new ElearningEntities()) //{ //Quiz q = e.Quizs.First(i => i.QuizID == id); //selectedQuiz = q; //} //} //catch //{ //return selectedQuiz; //} //return selectedQuiz; //} public List<Answer> FindAll() { List<Answer> selectedAnswer = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Answer> a = e.Answers; selectedAnswer = a.ToList(); } } catch { return selectedAnswer; } return selectedAnswer; }
public Position FindById(int id) { Position selectedProgress = null; try { using (ElearningEntities e = new ElearningEntities()) { Position p = e.Positions.First(i => i.PositionID == id); selectedProgress = p; } } catch { return selectedProgress; } return selectedProgress; }
public List<Policy> FindAll() { List<Policy> selectedPolicy = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Policy> p = e.Policies; selectedPolicy = p.ToList(); } } catch { return selectedPolicy; } return selectedPolicy; }
public Location FindbyId(int id) { Location l = null; try{ using (ElearningEntities e = new ElearningEntities()) { l = e.Locations.First(i => i.LocationID == id); } } catch { return(l); } return(l); }
public List<Position> FindAll() { List<Position> selectedProgress = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Position> p = e.Positions; selectedProgress = p.ToList(); } } catch { return selectedProgress; } return selectedProgress; }
public List<Employee> FindAll() { List<Employee> selectedEmployee = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Employee> emp = e.Employees; selectedEmployee = emp.ToList(); } } catch { return selectedEmployee; } return selectedEmployee; }
public Policy FindById(int reference) { Policy selectedPolicy = null; try { using (ElearningEntities e = new ElearningEntities()) { Policy p = e.Policies.First(i => i.PolicyID == reference); selectedPolicy = p; } } catch { return selectedPolicy; } return selectedPolicy; }
public List<Score> FindAll() { List<Score> selectedScore = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Score> s = e.Scores; selectedScore = s.ToList(); } } catch { return selectedScore; } return selectedScore; }
public Score FindById(int id) { Score selectedScore = null; try { using (ElearningEntities e = new ElearningEntities()) { Score s = e.Scores.First(i => i.ScoreID == id); selectedScore = s; } } catch { return(selectedScore); } return(selectedScore); }
public List <Score> FindAll() { List <Score> selectedScore = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Score> s = e.Scores; selectedScore = s.ToList(); } } catch { return(selectedScore); } return(selectedScore); }
public List<Department> FindById(string name) { List<Department> selectedDep = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Department> dep = e.Departments.Where(i => i.DepartmentName == name); selectedDep = dep.ToList(); } } catch { return selectedDep; } return selectedDep; }
public List <Department> FindAll() { List <Department> selectedDep = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Department> dep = e.Departments; selectedDep = dep.ToList(); } } catch { return(selectedDep); } return(selectedDep); }
//public Quiz FindbyId(int id) //{ // Quiz selectedQuiz = null; //try //{ //using (ElearningEntities e = new ElearningEntities()) //{ //Quiz q = e.Quizs.First(i => i.QuizID == id); //selectedQuiz = q; //} //} //catch //{ //return selectedQuiz; //} //return selectedQuiz; //} public List <Answer> FindAll() { List <Answer> selectedAnswer = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Answer> a = e.Answers; selectedAnswer = a.ToList(); } } catch { return(selectedAnswer); } return(selectedAnswer); }
public List <Policy> FindAll() { List <Policy> selectedPolicy = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Policy> p = e.Policies; selectedPolicy = p.ToList(); } } catch { return(selectedPolicy); } return(selectedPolicy); }
public Employee FindById(string firstname, string lastname) { Employee selectedEmployee = null; try { using (ElearningEntities e = new ElearningEntities()) { Employee emp = e.Employees.First(i => i.Firstname == firstname); selectedEmployee = emp; } } catch { return(selectedEmployee); } return(selectedEmployee); }
public Policy FindById(int reference) { Policy selectedPolicy = null; try { using (ElearningEntities e = new ElearningEntities()) { Policy p = e.Policies.First(i => i.PolicyID == reference); selectedPolicy = p; } } catch { return(selectedPolicy); } return(selectedPolicy); }
public List <Question> FindAll() { List <Question> selectedQuestioner = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Question> q = e.Questions; selectedQuestioner = q.ToList(); } } catch { return(selectedQuestioner); } return(selectedQuestioner); }
public List <Department> FindById(string name) { List <Department> selectedDep = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Department> dep = e.Departments.Where(i => i.DepartmentName == name); selectedDep = dep.ToList(); } } catch { return(selectedDep); } return(selectedDep); }
public List <Employee> FindAll() { List <Employee> selectedEmployee = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Employee> emp = e.Employees; selectedEmployee = emp.ToList(); } } catch { return(selectedEmployee); } return(selectedEmployee); }
public Position FindById(int id) { Position selectedProgress = null; try { using (ElearningEntities e = new ElearningEntities()) { Position p = e.Positions.First(i => i.PositionID == id); selectedProgress = p; } } catch { return(selectedProgress); } return(selectedProgress); }
public List <Position> FindAll() { List <Position> selectedProgress = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Position> p = e.Positions; selectedProgress = p.ToList(); } } catch { return(selectedProgress); } return(selectedProgress); }
public bool Persist(Position entity) { bool isPeristed = false; try { using (ElearningEntities e = new ElearningEntities()) { e.Positions.Add(entity); e.SaveChanges(); isPeristed = true; } } catch { return isPeristed; } return isPeristed; }
public List <Location> FindAll() { List <Location> allSpaces = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable <Location> loc = e.Locations; allSpaces = loc.ToList(); } } catch { return(allSpaces); } return(allSpaces); }
public bool Merge(Score entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Score s = e.Scores.First(i => i.ScoreID == entity.ScoreID); s.Attempt = entity.Attempt; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public bool Merge(Department entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Department d = e.Departments.First(i => i.DepartmentName == entity.DepartmentName); d.Description = entity.Description; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public bool Persist(Policy entity) { bool isPeristed = false; try { using (ElearningEntities e = new ElearningEntities()) { e.Policies.Add(entity); e.SaveChanges(); isPeristed = true; } } catch { return(isPeristed); } return(isPeristed); }
public bool Merge(Question entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Question q = e.Questions.First(i => i.QuestionID == entity.QuestionID); q.Description = entity.Description; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public bool Merge(Employee entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Employee emp = e.Employees.First(i => i.EmployeeID == entity.EmployeeID); emp.JobTitle = entity.JobTitle; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public bool Merge(Position entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Position p = e.Positions.First(i => i.PositionID == entity.PositionID); p.PositionName = entity.PositionName; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public bool Remove(Question entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Question q= e.Questions.First(i => i.QuestionID == entity.QuestionID); e.Questions.Remove(q); e.SaveChanges(); isRemoved = true; } } catch { return isRemoved; } return isRemoved; }
public bool Remove(Answer entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Answer a = e.Answers.First(i => i.AnswerID == entity.AnswerID); e.Answers.Remove(a); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Remove(Score entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Score s = e.Scores.First(i => i.ScoreID == entity.ScoreID); e.Scores.Remove(s); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Merge(Question entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Question q = e.Questions.First(i => i.QuestionID == entity.QuestionID); q.Description = entity.Description; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Merge(Score entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Score s = e.Scores.First(i => i.ScoreID == entity.ScoreID); s.Attempt = entity.Attempt; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Merge(Department entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Department d = e.Departments.First(i => i.DepartmentName == entity.DepartmentName); d.Description = entity.Description; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Remove(Department entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Department d = e.Departments.First(i => i.DepartmentID == entity.DepartmentID); e.Departments.Remove(d); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Remove(Question entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Question q = e.Questions.First(i => i.QuestionID == entity.QuestionID); e.Questions.Remove(q); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Merge(Answer entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Answer a = e.Answers.First(i => i.AnswerID == entity.AnswerID); a.Option1 = entity.Option1; e.SaveChanges(); isMerge = true; } } catch { return isMerge; } return isMerge; }
public List<Location> FindAll() { List<Location> allSpaces = null; try { using (ElearningEntities e = new ElearningEntities()) { IEnumerable<Location> loc = e.Locations; allSpaces = loc.ToList(); } } catch { return allSpaces; } return allSpaces; }
public bool Merge(Employee entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Employee emp = e.Employees.First(i => i.EmployeeID == entity.EmployeeID); emp.JobTitle = entity.JobTitle; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Persist(Employee entity) { bool isPeristed = false; try { using (ElearningEntities e = new ElearningEntities()) { e.Employees.Add(entity); e.SaveChanges(); isPeristed = true; } } catch { return(isPeristed); //Console.Write(e.ToString()); } return(isPeristed); }
public bool Remove(Employee entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Employee d = e.Employees.First(i => i.EmployeeID == entity.EmployeeID); e.Employees.Remove(d); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Merge(Answer entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Answer a = e.Answers.First(i => i.AnswerID == entity.AnswerID); a.Option1 = entity.Option1; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Persist(Employee entity) { bool isPeristed = false; try { using (ElearningEntities e = new ElearningEntities()) { e.Employees.Add(entity); e.SaveChanges(); isPeristed = true; } } catch { return isPeristed; //Console.Write(e.ToString()); } return isPeristed; }
public bool Remove(Policy entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Policy p = e.Policies.First(i => i.PolicyID == entity.PolicyID); e.Policies.Remove(p); e.SaveChanges(); isRemoved = true; } } catch { return(isRemoved); } return(isRemoved); }
public bool Merge(Policy entity) { bool isMerge = false; try { using (ElearningEntities e = new ElearningEntities()) { Policy p = e.Policies.First(i => i.PolicyID == entity.PolicyID); p.PolicyName = entity.PolicyName; e.SaveChanges(); isMerge = true; } } catch { return(isMerge); } return(isMerge); }
public bool Persist(Contact entity) { bool isPersisted = true; try { using (ElearningEntities e = new ElearningEntities()) { e.Contacts.Add(entity); e.SaveChanges(); } } catch (Exception e) { isPersisted = false; Console.WriteLine(e.ToString()); } return isPersisted; }
public Location FindbyId(int id) { Location l = null; try{ using (ElearningEntities e = new ElearningEntities()) { l = e.Locations.First(i => i.LocationID == id); } } catch { return l; } return l; }
public bool Merge(Location entity) { bool isMerged = false; try { using (ElearningEntities e = new ElearningEntities()) { Location c = e.Locations.First(i => i.LocationID == entity.LocationID); c.CubeName = entity.CubeName; c.MoreDetails = entity.MoreDetails; e.SaveChanges(); isMerged = true; } } catch { return isMerged; } return isMerged; }
public bool Merge(Contact entity) { bool isMerged = true; using (ElearningEntities e = new ElearningEntities()) { Contact contact; try { contact = e.Contacts.First(i => i.ContactID == entity.ContactID); contact.Email = entity.Email; e.SaveChanges(); } catch { isMerged = false; } } return isMerged; }
public bool Remove(Employee entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Employee d = e.Employees.First(i => i.EmployeeID == entity.EmployeeID); e.Employees.Remove(d); e.SaveChanges(); isRemoved = true; } } catch { return isRemoved; } return isRemoved; }
public bool Remove(Position entity) { bool isRemoved = false; try { using (ElearningEntities e = new ElearningEntities()) { Position p = e.Positions.First(i => i.PositionID == entity.PositionID); e.Positions.Remove(p); e.SaveChanges(); isRemoved = true; } } catch { return isRemoved; } return isRemoved; }