Esempio n. 1
0
        public void delete(int id)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal jou = db.journals.SingleOrDefault(x => x.jouID == id);
                db.journals.DeleteOnSubmit(jou);
                db.SubmitChanges();

                Console.WriteLine("Delete Journal IS EXECUTE ......" + DateTime.Now);
            }
        }
Esempio n. 2
0
        public void modifaypaper(Journalshared current)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal jou = db.journals.SingleOrDefault(x => x.jouID == current.JId);

                jou.joucity      = current.Jcity;
                jou.journalTitle = current.Jtitle;
                jou.jousubject   = current.Jsub;
                jou.jouclass     = current.Jclass;


                db.SubmitChanges();

                Console.WriteLine("Modifay Journal IS EXECUTE ......" + DateTime.Now);
            }
        }
Esempio n. 3
0
 public int save(Journalshared current)
 {
     using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
     {
         journal jou = new journal
         {
             journalTitle = current.Jtitle,
             jouclass     = current.Jclass,
             joucity      = current.Jcity,
             jousubject   = current.Jsub
         };
         db.journals.InsertOnSubmit(jou);
         db.SubmitChanges();
         Console.WriteLine(" ADD Journal IS EXECUTE ......" + DateTime.Now);
         return(jou.jouID);
     }
 }
Esempio n. 4
0
        public Journalshared getById(int id)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal jou = db.journals.SingleOrDefault(x => x.jouID == id);

                Journalshared ps = new Journalshared();


                ps.Jtitle = jou.journalTitle;
                ps.Jcity  = jou.joucity;
                ps.Jclass = jou.jouclass;
                ps.Jsub   = jou.jousubject;


                Console.WriteLine("Retrive Journal IS EXECUTE ......" + DateTime.Now);
                return(ps);
            }
        }
Esempio n. 5
0
 partial void Deletejournal(journal instance);
Esempio n. 6
0
 partial void Updatejournal(journal instance);
Esempio n. 7
0
 partial void Insertjournal(journal instance);
Esempio n. 8
0
        //  طريقة التحقق من ورقة
        public ValidationResult validate(papershare P)
        {
            using (PaperindexDataClassDataContext db = new PaperindexDataClassDataContext())
            {
                journal J = db.journals.SingleOrDefault(ob => ob.journalTitle == P.JTitle);


                if ((P.JTitle.Length == 0) && (J == null))
                {
                    return(new ValidationResult(false, "Paper Journal Tilte is Missing Or Not Nested"));
                }

                if ((P.PTitle == null) && (P.PTitle.Length == 0))
                {
                    return(new ValidationResult(false, "Paper Tilte is Missing"));
                }

                if ((P.PKeywords == null) && (P.PKeywords.Length == 0))
                {
                    return(new ValidationResult(false, "Keywords is Missing"));
                }
                if ((P.PAbstract == null) && (P.PAbstract.Length == 0))
                {
                    return(new ValidationResult(false, "Abstract is Missing"));
                }

                if ((P.Pauther == null) && (P.Pauther.Length == 0))
                {
                    return(new ValidationResult(false, "Authers is Missing"));
                }



                if ((P.JTitle == null) && (P.JTitle.Length == 0))
                {
                    return(new ValidationResult(false, "Journal Tilte is Missing"));
                }

                if (P.PYear > 2016)
                {
                    return(new ValidationResult(false, "Year of Paper more than this Year"));
                }

                if (P.PYear < 1940)
                {
                    return(new ValidationResult(false, "Year of Paper old than 1940"));
                }



                if (P.PVnumber <= 0)
                {
                    return(new ValidationResult(false, "Volume Number must be positive"));
                }

                if (P.PInumber <= 0)
                {
                    return(new ValidationResult(false, "Issue Number must be positive"));
                }



                if (P.PPagesF <= P.PPagesN)
                {
                    return(new ValidationResult(false, "The Last page of paper must be greater than Start page "));
                }

                int s = P.PPagesF - P.PPagesN;
                if (s >= 45)
                {
                    return(new ValidationResult(false, "The Last page of paper must be greater than Start page less 45 P "));
                }


                return(new ValidationResult(true, " Validation Succeeded"));
            }
        }