Exemplo n.º 1
0
 public int Insert(string Name)
 {
     try
     {
         Khabardaan.Code.DAL.KeywordsDataContext dc         = new Khabardaan.Code.DAL.KeywordsDataContext();
         Khabardaan.Code.DAL.Keywords            NewKeyword = new Khabardaan.Code.DAL.Keywords();
         dc.Keywords.InsertOnSubmit(NewKeyword);
         NewKeyword.Name = Name;
         dc.SubmitChanges();
         return(NewKeyword.Code);
     }
     catch
     {
         return(0);
     }
 }
Exemplo n.º 2
0
 public Khabardaan.Code.DAL.Keywords GetKeywordByCode(int KeywordCode)
 {
     Khabardaan.Code.DAL.KeywordsDataContext dc = new Khabardaan.Code.DAL.KeywordsDataContext();
     return(dc.Keywords.SingleOrDefault(p => p.Code.Equals(KeywordCode)));
 }