public ArticleType Get(long articleid) { ArticleType response = new ArticleType(); try { using (LMJEntities db = new LMJEntities()) { response = db.ArticleTypes.Where(e => e.Id == articleid && e.isDeleted == false).FirstOrDefault();; } return(response); } catch (Exception ex) { throw; } }
public List <Question> GetList() { List <Question> response = new List <Question>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Questions.Where(e => e.isDeleted == false).ToList(); } return(response); } catch (Exception ex) { throw; } }
public List <UserRolesInJournal> Edit(long userid) { try { using (LMJEntities db = new LMJEntities()) { List <UserRolesInJournal> rolesjournal = db.UserRolesInJournals.Where(e => e.UserId == userid).ToList(); rolesjournal.ForEach(a => a.isDeleted = true); db.SaveChanges(); return(rolesjournal); } } catch (Exception ex) { throw; } }
public List <Galley> GetList(long submissionid) { List <Galley> response = new List <Galley>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Galleys.Where(e => e.SubmissionId == submissionid).ToList(); } return(response); } catch (Exception ex) { throw; } }
public List <City> GetList(long id) { List <City> response = new List <City>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Cities.Where(e => e.CountryId == id && e.isDeleted == false).ToList(); } return(response); } catch (Exception ex) { throw; } }
public List <Review> GetList() { try { List <Review> data = new List <Review>(); using (LMJEntities db = new LMJEntities()) { data = db.Reviews.Where(e => e.IsDeleted == false).ToList(); } return(data); } catch (Exception ex) { throw; } }
public Review Get(long id) { try { Review review = new Review(); using (LMJEntities db = new LMJEntities()) { review = db.Reviews.Where(e => e.Id == id && e.IsDeleted == false).FirstOrDefault(); } return(review); } catch (Exception ex) { throw; } }
public Speciality Get(long id) { Speciality response = new Speciality(); try { using (LMJEntities db = new LMJEntities()) { response = db.Specialities.Where(e => e.Id == id && e.IsDeleted == false).FirstOrDefault();; } return(response); } catch (Exception ex) { throw; } }
public Discussion Get(long id) { try { Discussion data = new Discussion(); using (LMJEntities db = new LMJEntities()) { data = db.Discussions.Where(e => e.Id == id).FirstOrDefault(); } return(data); } catch (Exception ex) { throw; } }
public List <Contributor> Edit(long submissionid) { try { using (LMJEntities db = new LMJEntities()) { List <Contributor> contributors = db.Contributors.Where(e => e.SubmissionId == submissionid).ToList(); contributors.ForEach(a => a.isDeleted = true); db.SaveChanges(); return(contributors); } } catch (Exception ex) { throw; } }
public List <Speciality> GetList() { List <Speciality> response = new List <Speciality>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Specialities.Where(e => e.IsDeleted == false).ToList(); } return(response); } catch (Exception ex) { throw; } }
public List <Contributor> Add(List <Contributor> toAdd) { try { using (LMJEntities db = new LMJEntities()) { db.Contributors.AddRange(toAdd); db.SaveChanges(); return(toAdd); } } catch (Exception ex) { throw; } }
public Newsletter Get(long issueid) { Newsletter response = new Newsletter(); try { using (LMJEntities db = new LMJEntities()) { response = db.Newsletters.Where(e => e.Id == issueid && e.isDeleted == false).FirstOrDefault();; } return(response); } catch (Exception ex) { throw; } }
public List <Subject> GetListSub(long subId) { List <Subject> response = new List <Subject>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Subjects.Where(e => e.isDeleted == false && e.SubId == subId).ToList(); } return(response); } catch (Exception ex) { throw; } }
public SubmissionInProcess Get(long processId) { try { SubmissionInProcess data = new SubmissionInProcess(); using (LMJEntities db = new LMJEntities()) { data = db.SubmissionInProcesses.Where(e => e.ProcessId == processId).FirstOrDefault(); } return(data); } catch (Exception ex) { throw; } }
public List <Discussion> GetReplies(long id) { try { List <Discussion> data = new List <Discussion>(); using (LMJEntities db = new LMJEntities()) { data = db.Discussions.Where(e => e.ChannelId == id).ToList(); } return(data); } catch (Exception ex) { throw; } }
public long Admit(long reviewid, bool isAdmit) { try { using (LMJEntities db = new LMJEntities()) { Review review = db.Reviews.Where(e => e.Id == reviewid).FirstOrDefault(); review.IsAdmit = isAdmit; db.SaveChanges(); return(reviewid); } } catch (Exception ex) { throw; } }
public long Edit(long userid) { try { using (LMJEntities db = new LMJEntities()) { User usr = db.Users.Where(e => e.Id == userid).FirstOrDefault(); usr.IsDeleted = true; db.SaveChanges(); return(usr.Id); } } catch (Exception ex) { throw; } }
public List <Review> GetList(long submissionId) { try { List <Review> data = new List <Review>(); using (LMJEntities db = new LMJEntities()) { data = db.Reviews.Where(e => e.SubmissionId == submissionId && e.IsDeleted == false && e.IsAdmit == true).ToList(); } return(data); } catch (Exception ex) { throw; } }
public int getMaxPos() { try { int pos = 0; using (LMJEntities db = new LMJEntities()) { User usr = db.Users.OrderByDescending(e => e.Pos).FirstOrDefault(); pos = (int)usr.Pos; } return(pos); } catch (Exception ex) { throw; } }
public Review Add(Review toAdd) { try { using (LMJEntities db = new LMJEntities()) { db.Reviews.Add(toAdd); db.SaveChanges(); return(toAdd); } } catch (Exception ex) { throw; } }
public User Get(string email) { User user = new User(); try { using (LMJEntities db = new LMJEntities()) { user = db.Users.Where(e => e.Email == email).FirstOrDefault(); } return(user); } catch (Exception ex) { throw; } }
public List <Galley> Add(List <Galley> toAdd) { try { using (LMJEntities db = new LMJEntities()) { db.Galleys.AddRange(toAdd); db.SaveChanges(); return(toAdd); } } catch (Exception ex) { throw; } }
public Country Get(string code) { try { Country data = new Country(); using (LMJEntities db = new LMJEntities()) { data = db.Countries.Where(e => e.Code == code && e.isDeleted == false).FirstOrDefault(); return(data); } } catch (Exception ex) { throw; } }
public List <Section> GetList(long journalId) { List <Section> response = new List <Section>(); try { using (LMJEntities db = new LMJEntities()) { response = db.Sections.Where(e => e.JournalId == journalId).ToList(); } return(response); } catch (Exception ex) { throw; } }
public List <SubmissionKeyword> Edit(long submissionid) { try { using (LMJEntities db = new LMJEntities()) { List <SubmissionKeyword> keywords = db.SubmissionKeywords.Where(e => e.SubmissionId == submissionid).ToList(); keywords.ForEach(a => a.isDeleted = true); db.SaveChanges(); return(keywords); } } catch (Exception ex) { throw; } }
public List <UserRolesInJournal> Add(List <UserRolesInJournal> toAdd) { try { using (LMJEntities db = new LMJEntities()) { db.UserRolesInJournals.AddRange(toAdd); db.SaveChanges(); return(toAdd); } return(toAdd); } catch (Exception ex) { throw; } }
public List <SubmissionInProcess> GetList(long submissionId) { try { List <SubmissionInProcess> data = new List <SubmissionInProcess>(); using (LMJEntities db = new LMJEntities()) { data = db.SubmissionInProcesses.Where(e => e.SubmissionId == submissionId).ToList(); } return(data); } catch (Exception ex) { throw; } }
public List <UserRolesInJournal> GetList(long userId) { try { List <UserRolesInJournal> data = new List <UserRolesInJournal>(); using (LMJEntities db = new LMJEntities()) { data = db.UserRolesInJournals.Where(e => e.UserId == userId && e.isDeleted == false) .ToList(); } return(data); } catch (Exception ex) { throw; } }
public List <ArticleType> GetList(List <long> Ids) { List <ArticleType> response = new List <ArticleType>(); try { using (LMJEntities db = new LMJEntities()) { response = db.ArticleTypes.Where(e => e.isDeleted == false & Ids.Contains(e.Id)).ToList(); } return(response); } catch (Exception ex) { throw; } }