예제 #1
0
 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
 public static void DeleteFaqQuestion(FaqInfo question)
 {
     IFaqQuestion dal = Factory<IFaqQuestion>.Create("Faq");
     dal.Delete(question);
 }
예제 #4
0
        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);
        }
예제 #5
0
 public static int AddFaqQuestion(FaqInfo question)
 {
     IFaqQuestion dal = Factory<IFaqQuestion>.Create("Faq");
     return dal.Add(question);
 }