Ejemplo n.º 1
0
        public carrot_FaqCategory CategoryGetByID(Guid faqCategoryID)
        {
            carrot_FaqCategory ge = (from c in db.carrot_FaqCategories
                                     where c.SiteID == this.ThisSite.SiteID &&
                                     c.FaqCategoryID == faqCategoryID
                                     select c).FirstOrDefault();

            return(ge);
        }
Ejemplo n.º 2
0
        public carrot_FaqCategory Save(carrot_FaqCategory item)
        {
            if (item.FaqCategoryID == Guid.Empty)
            {
                item.FaqCategoryID = Guid.NewGuid();
            }

            if (!db.carrot_FaqCategories.Where(x => x.FaqCategoryID == item.FaqCategoryID).Any())
            {
                db.carrot_FaqCategories.InsertOnSubmit(item);
            }

            db.SubmitChanges();

            return(item);
        }
		protected void btnSave_Click(object sender, EventArgs e) {
			using (FaqHelper fh = new FaqHelper(SiteID)) {

				var fc = fh.CategoryGetByID(ItemGuid);

				if (fc == null || ItemGuid == Guid.Empty) {
					ItemGuid = Guid.NewGuid();
					fc = new carrot_FaqCategory();
					fc.SiteID = SiteID;
					fc.FaqCategoryID = ItemGuid;
				}

				fc.FAQTitle = txtFAQ.Text;

				fh.Save(fc);
			}

			string stringFile = CreateLink("CategoryList");

			Response.Redirect(stringFile);
		}
        protected void btnSave_Click(object sender, EventArgs e)
        {
            using (FaqHelper fh = new FaqHelper(SiteID)) {
                var fc = fh.CategoryGetByID(ItemGuid);

                if (fc == null || ItemGuid == Guid.Empty)
                {
                    ItemGuid         = Guid.NewGuid();
                    fc               = new carrot_FaqCategory();
                    fc.SiteID        = SiteID;
                    fc.FaqCategoryID = ItemGuid;
                }

                fc.FAQTitle = txtFAQ.Text;

                fh.Save(fc);
            }

            string stringFile = CreateLink("CategoryList");

            Response.Redirect(stringFile);
        }
Ejemplo n.º 5
0
		public carrot_FaqCategory Save(carrot_FaqCategory item) {
			if (item.FaqCategoryID == Guid.Empty) {
				item.FaqCategoryID = Guid.NewGuid();
			}

			if (!db.carrot_FaqCategories.Where(x => x.FaqCategoryID == item.FaqCategoryID).Any()) {
				db.carrot_FaqCategories.InsertOnSubmit(item);
			}

			db.SubmitChanges();

			return item;
		}
Ejemplo n.º 6
0
 partial void Deletecarrot_FaqCategory(carrot_FaqCategory instance);
Ejemplo n.º 7
0
 partial void Updatecarrot_FaqCategory(carrot_FaqCategory instance);
Ejemplo n.º 8
0
 partial void Insertcarrot_FaqCategory(carrot_FaqCategory instance);
Ejemplo n.º 9
0
 partial void Deletecarrot_FaqCategory(carrot_FaqCategory instance);
Ejemplo n.º 10
0
 partial void Updatecarrot_FaqCategory(carrot_FaqCategory instance);
Ejemplo n.º 11
0
 partial void Insertcarrot_FaqCategory(carrot_FaqCategory instance);