Пример #1
0
 private void ViewFaq(string lang)
 {
     FaqBSO faqBSO = new FaqBSO();
     DataTable table = faqBSO.GetFaqAll(lang);
     DataListFaq.DataSource = table;
     DataListFaq.DataBind();
 }
Пример #2
0
        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;
            }
        }
Пример #3
0
 private void ViewFaq()
 {
     FaqBSO faqBSO = new FaqBSO();
     DataTable table = faqBSO.GetFaqAll(Language.language);
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToGridView(grvFaq, table);
 }
Пример #4
0
 private void OtherFaqGet(int Id, string lang)
 {
     FaqBSO faqBSO = new FaqBSO();
     DataTable table = faqBSO.GetFaqOther(Id, lang);
     DataListOtherFaq.DataSource = table;
     DataListOtherFaq.DataBind();
 }
Пример #5
0
 protected void ImageButton1_Click(object sender, EventArgs e)
 {
     ccJoin.ValidateCaptcha(txtCapcha.Text.Trim());
     if (!ccJoin.UserValidated)
     {
         ErrorMess.Visible = true;
         txtCapcha.Focus();
         lblError.Text = "Mã bảo mật chưa chính xác";
         return;
     }
     else
     {
         try
         {
             ETO.Faq faq = ReceiveHtml();
             FaqBSO faqBSO = new FaqBSO();
             faqBSO.CreateFaq(faq);
             clientview.Text = String.Format(Resources.Resource.AddNewsSuccessful);
             lblSucess.Visible = true;
             lblSucess.Text = "Gửi thắc mắc thành công";
         }
         catch (Exception ex)
         {
             clientview.Text = ex.Message.ToString();
         }
     }
 }
Пример #6
0
        private void ViewFaqDetail(int Id)
        {
            FaqBSO faqBSO = new FaqBSO();
            ETO.Faq faq = faqBSO.GetFaqById(Id);

            LiteralQuestion.Text = faq.Question;
            LiteralAnswer.Text = faq.Answer;
        }
Пример #7
0
 protected void btn_Order_Click(object sender, ImageClickEventArgs e)
 {
     foreach (GridViewRow row in grvFaq.Rows)
     {
         TextBox textOrder = (TextBox)row.FindControl("txtFaqOrder");
         int cOrder = Convert.ToInt32(textOrder.Text);
         int faqID = Convert.ToInt32(row.Cells[0].Text);
         FaqBSO faqBSO = new FaqBSO();
         faqBSO.FaqUpOrder(faqID, cOrder);
     }
     ViewFaq();
 }
Пример #8
0
 protected void btn_add_Click(object sender, EventArgs e)
 {
     try
     {
         Faq faq = ReceiveHtml();
         FaqBSO faqBSO = new FaqBSO();
         faqBSO.CreateFaq(faq);
         clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }
Пример #9
0
 protected void grvFaq_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     int Id = Convert.ToInt32(e.CommandArgument.ToString());
     string cName = e.CommandName.ToLower();
     switch (cName)
     {
         case "_edit":
             Response.Redirect("~/Admin/editfaq/" + Id + "/Default.aspx");
             break;
         case "_delete":
             FaqBSO faqBSO = new FaqBSO();
             faqBSO.DeleteFaq(Id);
             ViewFaq();
             break;
     }
 }
Пример #10
0
 protected void btn_edit_Click(object sender, EventArgs e)
 {
     try
     {
         Faq faq = ReceiveHtml();
         FaqBSO faqBSO = new FaqBSO();
         faqBSO.UpdateFaq(faq);
         clientview.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "hỏi đáp", faq.Question);
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }