Example #1
0
        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();
        }
Example #2
0
        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);
        }
Example #3
0
 partial void DeleteTNotice(TNotice instance);
Example #4
0
 partial void UpdateTNotice(TNotice instance);
Example #5
0
 partial void InsertTNotice(TNotice instance);