コード例 #1
0
 public void Remove_Pin(int id)
 {
     try
     {
         mmoDataContext db   = new mmoDataContext();
         Pinterest      prod = (from p in db.Pinterests
                                where p.Id == id
                                select p).SingleOrDefault();
         db.Pinterests.DeleteOnSubmit(prod);
         db.SubmitChanges();
     }
     catch (Exception ex) { }
 }
コード例 #2
0
        public bool Insert_Posted(int id)
        {
            bool result = false;

            try
            {
                mmoDataContext db   = new mmoDataContext();
                Posting        post = new Posting
                {
                    ImgId    = id,
                    SourceId = 6
                };
                db.Postings.InsertOnSubmit(post);
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex) { }
            return(result);
        }