zl程序教程

您现在的位置是:首页 >  IT要闻

当前栏目

简单快速开发C\S架构程序用最简单的不分层最快的效率达到功能要求的例子程序FrmUserEdit 添加评论功能页面效果

2023-02-18 15:37:28 时间

 这个页面进行评论的功能也进行了优化,当没有评论时,直接显示添加页面,有评论时显示评论列表页面,这样用户操作起来会非常方便,有时候可以会少操作1次,提高软件的有善性。

 1         private void btnComment_Click(object sender, EventArgs e)
 2         {
 3             bool commnets = false;
 4             List<KeyValuePair<stringobject>> parameters = new List<KeyValuePair<string,object>>();
 5             parameters.Add(new KeyValuePair<stringobject>(BaseCommentEntity.FieldCategoryCode, this.Name));
 6             parameters.Add(new KeyValuePair<stringobject>(BaseCommentEntity.FieldObjectId, this.EntityId));
 7             parameters.Add(new KeyValuePair<stringobject>(BaseCommentEntity.FieldDeletionStateCode, 0));
 8             commnets = DbLogic.Exists(this.UserCenterDbHelper, BaseCommentEntity.TableName, parameters);
 9             // 若有记录显示列表页面,若没记录直接显示添加页面
10             if (commnets)
11             {
12                 FrmCommnets frmCommnets = new FrmCommnets(this.Name, this.EntityId);
13                 frmCommnets.ShowDialog();
14             }
15             else
16             {
17                 FrmCommentAdd frmCommentAdd = new FrmCommentAdd(this.Name, this.EntityId);
18                 frmCommentAdd.ShowDialog();
19             }
20         }