コード例 #1
0
 protected void addButton_Click( object sender , EventArgs e )
 {
     Security s = Session["sec"] as Security;
     string strBiaoTi = txtBiaoTi.Text;
     string strNeiRong = txtNeiRong.Text;
     string strFaBuRen = s.getUserName();
     dbModule dm = new dbModule();
     int i = dm.addTongZhi(strBiaoTi, strNeiRong, strFaBuRen);
     switch ( i )
     {
         case 1://正常添加成功
             messageLabel.Text = Resources.Resource.strAddNewSuccess;
             txtBiaoTi.Text = "";
             txtNeiRong.Text = "";
             break;
         default://添加失败
             messageLabel.Text = Resources.Resource.strAddNewFailed;
             break;
     }
 }