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); }
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); }