示例#1
0
        public ActionResult SaveAnnounecement(int Id, string text, bool showOnPage)
        {
            if (Id > 0)
            {
                BK_Announcement a = AdriaTicketData.BK_Announcements.FirstOrDefault(x => x.Id == Id);
                a.Announcement = text;
                a.ShowOnPage = showOnPage;
            }
            else
            {
                BK_Announcement a = new BK_Announcement();
                a.Announcement = text;
                a.ShowOnPage = showOnPage;
                AdriaTicketData.BK_Announcements.InsertOnSubmit(a);
            }

            AdriaTicketData.SubmitChanges();

            return Json("completed", JsonRequestBehavior.AllowGet);
        }
 partial void UpdateBK_Announcement(BK_Announcement instance);
 partial void DeleteBK_Announcement(BK_Announcement instance);
 partial void InsertBK_Announcement(BK_Announcement instance);