Пример #1
0
        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;
            }
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
 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;
     }
 }
Пример #4
0
        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;
            }
        }
Пример #5
0
        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;
            }
        }
Пример #6
0
        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;
            }
        }
Пример #7
0
        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;
            }
        }
Пример #8
0
        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;
            }
        }
Пример #9
0
        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;
            }
        }
Пример #10
0
 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;
     }
 }
Пример #11
0
        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;
            }
        }
Пример #12
0
        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;
            }
        }
Пример #13
0
        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;
            }
        }
Пример #14
0
        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;
            }
        }
Пример #15
0
        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;
            }
        }
Пример #16
0
        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;
            }
        }
Пример #17
0
 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;
     }
 }
Пример #18
0
 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;
     }
 }
Пример #19
0
        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;
            }
        }
Пример #20
0
 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;
     }
 }
Пример #21
0
        public Review Add(Review toAdd)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    db.Reviews.Add(toAdd);
                    db.SaveChanges();

                    return(toAdd);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Пример #22
0
        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;
            }
        }
Пример #23
0
        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;
            }
        }
Пример #24
0
        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;
            }
        }
Пример #25
0
        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;
            }
        }
Пример #26
0
 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;
     }
 }
Пример #27
0
 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;
     }
 }
Пример #28
0
        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;
            }
        }
Пример #29
0
 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;
     }
 }
Пример #30
0
        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;
            }
        }