public void Remove(int aUniqueID) { LNoticeDataContext tmpNC = new LNoticeDataContext(); Table <TNotice> Notices = tmpNC.GetTable <TNotice>(); IQueryable <TNotice> tmpQ = from iter in Notices where iter.theUniqueID == aUniqueID select iter; TNotice tt = tmpQ.Where(x => x.theUniqueID == aUniqueID).Single(); Notices.DeleteOnSubmit(tt); tmpNC.SubmitChanges(); }
public int AddNotice(ref CNotice aNotice) { LNoticeDataContext tmpNC = new LNoticeDataContext(); // CNotice tmpNotice = new CNotice(); // tmpNotice.theUniqueID = 0; TNotice tmpNotice = new TNotice(); tmpNotice.theNumber = 0; tmpNotice.theTitle = aNotice.theTitle; tmpNotice.theContent = aNotice.theContent; tmpNotice.theWriter = aNotice.theWriter; tmpNotice.theDate = DateTime.Now; // theNotices.Add(tmpNotice); tmpNC.TNotice.InsertOnSubmit(tmpNotice); tmpNC.SubmitChanges(); aNotice.theDate = DateTime.Now; return(1); }
partial void DeleteTNotice(TNotice instance);
partial void UpdateTNotice(TNotice instance);
partial void InsertTNotice(TNotice instance);