Exemple #1
0
        public List <long> EditPos(List <long> ids, List <int> Pos)
        {
            try
            {
                User usr = new User();

                using (LMJEntities db = new LMJEntities())
                {
                    for (int i = 0; i < ids.Count; i++)
                    {
                        usr = new User();
                        long id  = (long)ids[i];
                        int  pos = int.Parse(Pos[i].ToString());
                        usr     = db.Users.Where(e => e.Id == id).FirstOrDefault();
                        usr.Pos = pos;
                        db.SaveChanges();
                    }
                    return(ids);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #2
0
        public long Edit(Newsletter toEdit)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    Newsletter newsletter = db.Newsletters.Where(e => e.Id == toEdit.Id).FirstOrDefault();

                    newsletter.UserId      = toEdit.UserId;
                    newsletter.Name        = toEdit.Name;
                    newsletter.ISSN        = toEdit.ISSN;
                    newsletter.EISSN       = toEdit.EISSN;
                    newsletter.CoverImage  = toEdit.CoverImage;
                    newsletter.Volume      = toEdit.Volume;
                    newsletter.PublishDate = toEdit.PublishDate;
                    newsletter.isDeleted   = toEdit.isDeleted;
                    newsletter.SysDate     = toEdit.SysDate;
                    db.SaveChanges();
                    return(toEdit.Id);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #3
0
        public List <LookUp> DeleteContent(bool withParent, long parentId)
        {
            try
            {
                List <LookUp> result = new List <LookUp>();

                using (LMJEntities db = new LMJEntities())
                {
                    if (withParent)
                    {
                        result = db.LookUps.Where(e => (e.Id == parentId || e.ParentId == parentId)).ToList();
                    }
                    else
                    {
                        result = db.LookUps.Where(e => (e.Id == parentId || e.ParentId == parentId)).ToList();
                    }

                    foreach (LookUp l in result)
                    {
                        db.LookUps.Attach(l);
                        l.IsDeleted = true;
                    }

                    db.SaveChanges();
                }



                return(result);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #4
0
        public long EditAcceptenceForReviewer(long fileid, string attr)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    SubmissionFile submissionfile = db.SubmissionFiles.Where(e => e.Id == fileid).FirstOrDefault();
                    if (attr == "isAcceptedforReview")
                    {
                        submissionfile.isAcceptedforReview = true;
                    }
                    if (attr == "isAcceptedforCopyEditing")
                    {
                        submissionfile.isAcceptedforCopyEditing = true;
                    }
                    if (attr == "isAcceptedforProduction")
                    {
                        submissionfile.isAcceptedforProduction = true;
                    }

                    submissionfile.isSubmission = false;
                    submissionfile.isRevision   = false;
                    submissionfile.isCopyedited = false;
                    db.SaveChanges();

                    return(fileid);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #5
0
 public void Add(LookUpMedia newMedia)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.LookUpMedias.Add(newMedia);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #6
0
 public void Admin(Logger_Admin toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Logger_Admin.Add(toAdd);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #7
0
 public void CyberSource(Logger_CyberSource toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Logger_CyberSource.Add(toAdd);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #8
0
 public void Error(Logger_Error toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Logger_Error.Add(toAdd);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #9
0
 public UserResponsibleInProcess Add(UserResponsibleInProcess toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.UserResponsibleInProcesses.Add(toAdd);
             db.SaveChanges();
         }
         return(toAdd);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #10
0
 public List <SubmissionKeyword> Add(List <SubmissionKeyword> toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.SubmissionKeywords.AddRange(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #11
0
 public List <DiscussionsFile> Add(List <DiscussionsFile> toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.DiscussionsFiles.AddRange(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #12
0
 public Discussion Add(Discussion toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Discussions.Add(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #13
0
 public City Add(City toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Cities.Add(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #14
0
 public Newsletter Add(Newsletter toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Newsletters.Add(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #15
0
 public LookUp Add(LookUp lookup)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.LookUps.Add(lookup);
             db.SaveChanges();
         }
         return(lookup);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #16
0
 public Submission Add(Submission toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.Submissions.Add(toAdd);
             db.SaveChanges();
         }
         return(toAdd);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #17
0
 public UserRole Add(UserRole toAdd)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             db.UserRoles.Add(toAdd);
             db.SaveChanges();
             return(toAdd);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #18
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;
     }
 }
        public void UpdateDescription(LookUpMultiLanguage old, string newDescription)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    db.LookUpMultiLanguages.Attach(old);

                    old.Description = newDescription;
                    db.SaveChanges();
                }
            }
            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;
     }
 }
Exemple #21
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;
     }
 }
 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;
     }
 }
Exemple #23
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;
     }
 }
Exemple #24
0
 public List <SubmissionFile> Edit(long submissionid)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             List <SubmissionFile> files = db.SubmissionFiles.Where(e => e.SubmissionId == submissionid).ToList();
             files.ForEach(a => a.isDeleted = true);
             db.SaveChanges();
             return(files);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #25
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;
            }
        }
        public LookUpMultiLanguage Add(LookUpMultiLanguage lookupMulti)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    db.LookUpMultiLanguages.Add(lookupMulti);
                    db.SaveChanges();
                }
                return(lookupMulti);
            }
            catch (Exception ex)

            {
                throw;
            }
        }
Exemple #27
0
        public Review Add(Review toAdd)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    db.Reviews.Add(toAdd);
                    db.SaveChanges();

                    return(toAdd);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemple #28
0
 public long LinkToNewsletter(long submissionid, long newsletterid)
 {
     try
     {
         using (LMJEntities db = new LMJEntities())
         {
             Submission submissios = db.Submissions.Where(e => e.Id == submissionid).FirstOrDefault();
             submissios.IssueId = newsletterid;
             db.SaveChanges();
             return(newsletterid);
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #29
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;
            }
        }
Exemple #30
0
        public LookUp UpdateCode(LookUp toUpdate, string newCode)
        {
            try
            {
                using (LMJEntities db = new LMJEntities())
                {
                    db.LookUps.Attach(toUpdate);
                    toUpdate.Code = newCode;

                    db.SaveChanges();
                }
                return(toUpdate);
            }
            catch (Exception ex)
            {
                throw;
            }
        }