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); } }
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); } }
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); } }
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); } }
partial void Deletejournal(journal instance);
partial void Updatejournal(journal instance);
partial void Insertjournal(journal instance);
// طريقة التحقق من ورقة 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")); } }