private void initControl(int Id) { if (Id > 0) { btn_add.Visible = false; btn_edit.Visible = true; try { FaqBSO faqBSO = new FaqBSO(); Faq faq = faqBSO.GetFaqById(Id); hddFaqID.Value = Convert.ToString(faq.FaqID); txtQuestion.Text = faq.Question; txtRadAnswer.Html = faq.Answer; txtRadPostDate.SelectedDate = faq.PostDate; rdbStatus.SelectedValue = Convert.ToString(faq.Status); } catch (Exception ex) { clientview.Text = ex.Message.ToString(); } } else { txtRadPostDate.SelectedDate = DateTime.Now; btn_add.Visible = true; btn_edit.Visible = false; } }
private void ViewFaqDetail(int Id) { FaqBSO faqBSO = new FaqBSO(); ETO.Faq faq = faqBSO.GetFaqById(Id); LiteralQuestion.Text = faq.Question; LiteralAnswer.Text = faq.Answer; }