public static void Save(FAQ faq) { using (var ctx = new BMIKidsEntities(ConnectionString)) { try { ctx.FAQs.ApplyChanges(faq); ctx.SaveChanges(); } catch (Exception ex) { LogUtility.WriteEntryEventLog("FAQ_DataProvider_DataProvider", ex, EventLogEntryType.Information); if (ex.InnerException != null) throw ex.InnerException; throw; } } }
private FAQ GetFAQInfoFromSkin() { long? FAQId = null; if (UtilityMethod.GetRequestParameter("pid").IsInt64()) FAQId = UtilityMethod.GetRequestParameter("pid").ToLong(); FAQ faq = new FAQ(); if (FAQId.HasValue) faq = FAQ_DataProvider.GetFAQ(FAQId).FirstOrDefault() ?? new FAQ(); faq.CategoryId = Convert.ToInt32(ddlCatList.SelectedValue); faq.Title = txtTitle.Text; faq.Summary = summaryctrl.Text; faq.Body = txtBody.Text; faq.SortOrderId = Convert.ToInt32(SortOrder.SelectedValue); return faq; }