Esempio n. 1
0
        protected void Save()
        {
            bool bAdd = false;

            var itm = (from c in db.tblCalendars
                       where c.CalendarID == ItemGuid
                       select c).FirstOrDefault();

            if (itm == null || ItemGuid == Guid.Empty)
            {
                ItemGuid       = Guid.NewGuid();
                bAdd           = true;
                itm            = new tblCalendar();
                itm.CalendarID = ItemGuid;
            }

            if (itm != null)
            {
                itm.EventDate   = Convert.ToDateTime(txtDate.Text);
                itm.EventDetail = reContent.Text;
                itm.EventTitle  = txtEvent.Text;
                itm.IsActive    = chkActive.Checked;
                itm.SiteID      = SiteID;
            }

            if (bAdd)
            {
                db.tblCalendars.InsertOnSubmit(itm);
            }
            db.SubmitChanges();

            string filePath = CreateLink(ModuleName, string.Format("id={0}", ItemGuid));

            Response.Redirect(filePath);
        }
		protected void Save() {
			bool bAdd = false;

			var itm = (from c in db.tblCalendars
					   where c.CalendarID == ItemGuid
					   select c).FirstOrDefault();

			if (itm == null || ItemGuid == Guid.Empty) {
				ItemGuid = Guid.NewGuid();
				bAdd = true;
				itm = new tblCalendar();
				itm.CalendarID = ItemGuid;
			}

			if (itm != null) {
				itm.EventDate = Convert.ToDateTime(txtDate.Text);
				itm.EventDetail = reContent.Text;
				itm.EventTitle = txtEvent.Text;
				itm.IsActive = chkActive.Checked;
				itm.SiteID = SiteID;
			}

			if (bAdd) {
				db.tblCalendars.InsertOnSubmit(itm);
			}
			db.SubmitChanges();

			string filePath = CreateLink(ModuleName, string.Format("id={0}", ItemGuid));

			Response.Redirect(filePath);
		}
Esempio n. 3
0
 partial void DeletetblCalendar(tblCalendar instance);
Esempio n. 4
0
 partial void UpdatetblCalendar(tblCalendar instance);
Esempio n. 5
0
 partial void InserttblCalendar(tblCalendar instance);
 partial void DeletetblCalendar(tblCalendar instance);
 partial void UpdatetblCalendar(tblCalendar instance);
 partial void InserttblCalendar(tblCalendar instance);