Esempio n. 1
0
        private void 评论ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string     fileid = skinDataGridView1.CurrentRow.Cells["FileId"].Value.ToString();
            frmComment frm    = new frmComment(Convert.ToInt32(fileid));
            DataTable  dtpl   = new DataTable();
            //开启一个模态窗体,格挡其他窗体
            DialogResult result = frm.ShowDialog();

            //模态窗体返回一个完成运行的状态值
            if (result == DialogResult.OK)
            {
                //加载评论列表
                dtpl = new CommentBLL().FindComment(Convert.ToInt32(fileid));
                this.skinDataGridView2.DataSource = dtpl;
                if (dtpl != null && dtpl.Rows.Count > 0)
                {
                    skinDataGridView2.Rows[0].Selected = false;
                }
            }
            this.skinGroupBox2.Text = "[" + skinDataGridView1.CurrentRow.Cells["FileName"].Value.ToString() + "]" + "共" +
                                      dtpl.Rows.Count.ToString() + "条评论";
        }
Esempio n. 2
0
        private void CommentFrm(DataGridViewCellEventArgs b)
        {
            DataGridViewColumn column = new DataGridViewColumn();

            if (b.ColumnIndex == -1)
            {
                column = skinDataGridView1.Columns[0];
            }
            else
            {
                column = skinDataGridView1.Columns[b.ColumnIndex];
            }
            var fileId = Convert.ToInt32(skinDataGridView1.Rows[b.RowIndex].Cells["FileId"].Value);
            var dtpl   = new CommentBLL().FindComment(fileId);

            this.skinDataGridView2.DataSource = dtpl;
            if (column is DataGridViewImageColumn)
            {
                frmComment frm = new frmComment(fileId);
                //开启一个模态窗体,格挡其他窗体
                DialogResult result = frm.ShowDialog();
                //模态窗体返回一个完成运行的状态值
                if (result == DialogResult.OK)
                {
                    //加载评论列表
                    dtpl = new CommentBLL().FindComment(fileId);
                    this.skinDataGridView2.DataSource = dtpl;
                    if (dtpl != null && dtpl.Rows.Count > 0)
                    {
                        skinDataGridView2.Rows[0].Selected = false;
                    }
                }
            }
            this.skinGroupBox2.Text = "[" + skinDataGridView1.Rows[b.RowIndex].Cells["FileName"].Value.ToString() + "]" +
                                      "共" + dtpl.Rows.Count.ToString() + "条评论";
        }