Beispiel #1
0
 protected void BtnUpdate_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     try
     {
         if (ValiEdit())
         {
             DBLL.clsFAQs       FAQ    = new DBLL.clsFAQs();
             DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
             bool _Result = FAQ.update_tb_FAQsBynFAQID(int.Parse(hfFAQUpdateID.Value), txtsQuestionCN.Text, txtsQuestionEN.Text, txtsAnswerCN.Text, txtsAnswerEN.Text, Session["user"].ToString(), DateTime.Now, true, int.Parse(ddlnSorting.SelectedValue));
             if (_Result == true)
             {
                 ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateSuccess");
                 ShowMsg1.Show();
                 MultiView1.ActiveViewIndex = 0;
                 ReBindPageList();
             }
             else
             {
                 //失败就一条
                 ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateFail");
                 ShowMsg1.Show();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     try
     {
         int nID = 0;
         if (int.TryParse(hfID.Value.ToString(), out nID) && nID > 0)
         {
             //更新
             if (Vali())
             {
                 DBLL.clsFAQs       clFAQ  = new DBLL.clsFAQs();
                 DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
                 bool _Result = clFAQ.update_tb_FAQsBynFAQID(int.Parse(hfID.Value), txtsQuestionCN.Text, txtsQuestionEN.Text, txtsAnswerCN.Text, txtsAnswerEN.Text, Session["user"].ToString(), DateTime.Now, true, int.Parse(txtnSorting.Text));
                 if (_Result == true)
                 {
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateSuccess");
                     ShowMsg1.Show();
                 }
                 else
                 {
                     //失败就一条
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateFail");
                     ShowMsg1.Show();
                 }
             }
             else
             {
                 ShowMsg1.Show();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }