Ejemplo n.º 1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtQuestion.Text.Trim()) &&
             !string.IsNullOrEmpty(txtAnswer.Text.Trim()))
         {
             BCAppAdmin appAdmin = new BCAppAdmin();
             if (string.IsNullOrEmpty(hdnFAQId.Value))
             {
                 appAdmin.InsertFAQ(txtQuestion.Text,
                                    txtAnswer.Text, Convert.ToInt32(Session["UserId"]));
             }
             else
             {
                 appAdmin.UpdateFAQ(Convert.ToInt32(hdnFAQId.Value), txtQuestion.Text,
                                    txtAnswer.Text);
             }
             hdnFAQId.Value   = string.Empty;
             txtQuestion.Text = string.Empty;
             txtAnswer.Text   = string.Empty;
             _BindFAQ();
         }
     }
     catch (Exception)
     {}
 }
Ejemplo n.º 2
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtQuestion.Text.Trim()) &&
             !string.IsNullOrEmpty(txtAnswer.Text.Trim()))
         {
             BCAppAdmin appAdmin = new BCAppAdmin();
             if (string.IsNullOrEmpty(hdnFAQId.Value))
             {
                 appAdmin.InsertFAQ(txtQuestion.Text,
                     txtAnswer.Text, Convert.ToInt32(Session["UserId"]));
             }
             else
             {
                 appAdmin.UpdateFAQ(Convert.ToInt32(hdnFAQId.Value), txtQuestion.Text,
                     txtAnswer.Text);
             }
             hdnFAQId.Value = string.Empty;
             txtQuestion.Text = string.Empty;
             txtAnswer.Text = string.Empty;
             _BindFAQ();
         }
     }
     catch (Exception)
     {}
 }