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); }
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); }
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; }
partial void Deletecarrot_FaqCategory(carrot_FaqCategory instance);
partial void Updatecarrot_FaqCategory(carrot_FaqCategory instance);
partial void Insertcarrot_FaqCategory(carrot_FaqCategory instance);
partial void Deletecarrot_FaqCategory(carrot_FaqCategory instance);
partial void Updatecarrot_FaqCategory(carrot_FaqCategory instance);
partial void Insertcarrot_FaqCategory(carrot_FaqCategory instance);