Пример #1
0
        private void toolStripButton3_Click(object sender, EventArgs e)//删除提问
        {
            int a = 0; ArrayList name = new ArrayList();

            for (int i = 0; i < questionControlList.RowCount; i++)
            {
                string           b, c;
                DataGridViewCell checkbox = (DataGridViewCell)this.questionControlList.Rows[i].Cells[0];
                if ((string)checkbox.Value == "True")
                {
                    b = questionControlList.Rows[i].Cells[1].Value.ToString();
                    name.Add(b);
                }
            }
            if (MessageBox.Show("确定删除" + name.Count + "条数据吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == DialogResult.OK)
            {
                LibraryBLL.question comment = new LibraryBLL.question();
                try
                {
                    a = comment.questiondelete(name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }
                MessageBox.Show("已经删除" + a + "条数据");;
            }
        }
Пример #2
0
 private void answerUpload_Click(object sender, EventArgs e)//回答上传
 {
     try
     {
         LibraryBLL.question a = new LibraryBLL.question();
         a.answerCheckIn(answerIntro.Text, qusertionId, username.Text, System.DateTime.Now.ToString(), filename);
         LibraryBLL.FtpHelper b = new LibraryBLL.FtpHelper();
         if (filename != "")
         {
             b.answerUpload(filepath);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return;
     }
     if (MessageBox.Show("发布成功") == DialogResult.OK)
     {
         answerContentshow();
         filename = ""; filepath = "";
     }
 }
Пример #3
0
 private void questionUpload_Click(object sender, EventArgs e)//问题上传
 {
     try
     {
         LibraryBLL.question a = new LibraryBLL.question();
         a.questionCheckIn(questionTitle.Text, questionType.Text, questionIntro.Text, filename, System.DateTime.Now.ToString(), username.Text);
         LibraryBLL.FtpHelper b = new LibraryBLL.FtpHelper();
         if (filename != "")
         {
             b.Upload(filepath);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return;
     }
     if (MessageBox.Show("发布成功") == DialogResult.OK)
     {
         askContentshow("");
         filename = ""; filepath = "";
         skinPanelQuestion.Visible = false;
     }
 }