public static FaqInfo CopyFaqQuestionsToBO(SqlDataReader rdr) { FaqInfo faqquestion = new FaqInfo { Id = rdr.GetInt32(0), Link = rdr.SafeGetString(1), LinkTitle = rdr.SafeGetString(2), LinkBody = rdr.SafeGetString(3), CatId = rdr.GetInt32(4), Language = rdr.SafeGetString(5), Order = rdr.GetInt32(6) }; return faqquestion; }
protected void AddNewQuestion(object sender, EventArgs e) { if (tbxQuestion.Text == "" || tbxAnswer.Text == "") return; if (hdnEditFaq.Value != "") { currentfaq = Convert.ToInt32(hdnEditFaq.Value); if (currentfaq > 0) SaveFAQ(sender, e); } string category = ddlCategory.SelectedValue; string question = tbxQuestion.Text; string answer = tbxAnswer.Text; FaqInfo faq = new FaqInfo { CatId = Convert.ToInt32(category), Language = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, Link = String.Empty, LinkTitle = question, LinkBody = answer, Order = tbxQorder.Text == "" ? 0 : Convert.ToInt32(tbxQorder.Text) }; SnitzFaq.AddFaqQuestion(faq); Response.Redirect(this.Request.RawUrl); }
public static void DeleteFaqQuestion(FaqInfo question) { IFaqQuestion dal = Factory<IFaqQuestion>.Create("Faq"); dal.Delete(question); }
protected void Add(object sender, ImageClickEventArgs e) { if (fnTitle.Text == "" || fnBody.Text == "") return; string category = fnCategory.SelectedValue; string question = fnTitle.Text; string answer = fnBody.Text; FaqInfo faq = new FaqInfo { CatId = Convert.ToInt32(category), Language = CultureInfo.CurrentCulture.TwoLetterISOLanguageName, Link = String.Format("/{0}/{1}",fnCategory.SelectedItem.Text,question), LinkTitle = question, LinkBody = answer, Order = fnOrder.Text == "" ? 0 : Convert.ToInt32(fnOrder.Text) }; SnitzFaq.AddFaqQuestion(faq); Response.Redirect(this.Request.RawUrl); }
public static int AddFaqQuestion(FaqInfo question) { IFaqQuestion dal = Factory<IFaqQuestion>.Create("Faq"); return dal.Add(question); }