简单快速开发C\S架构程序用最简单的不分层最快的效率达到功能要求的例子程序FrmUserEdit
这个页面进行评论的功能也进行了优化,当没有评论时,直接显示添加页面,有评论时显示评论列表页面,这样用户操作起来会非常方便,有时候可以会少操作1次,提高软件的有善性。 1 private voidbtnComment_Click( objectsender, EventArgs e) 2 { 3 boolcommnets = false; 4 List<KeyValuePair< string, object>> parameters = newList<KeyValuePair< string, object>>(); 5 parameters.Add( newKeyValuePair< string, object>(BaseCommentEntity.FieldCategoryCode, this.Name)); 6 parameters.Add( newKeyValuePair< string, object>(BaseCommentEntity.FieldObjectId, this.EntityId)); 7 parameters.Add( newKeyValuePair< string, object>(BaseCommentEntity.FieldDeletionStateCode, 0)); 8 commnets = DbLogic.Exists( this.UserCenterDbHelper, BaseCommentEntity.TableName, parameters); 9 // 若有记录显示列表页面,若没记录直接显示添加页面 10 if(commnets) 11 { 12 FrmCommnets frmCommnets = newFrmCommnets( this.Name, this.EntityId); 13 frmCommnets.ShowDialog(); 14 } 15 else 16 { 17 FrmCommentAdd frmCommentAdd = newFrmCommentAdd( this.Name, this.EntityId); 18 frmCommentAdd.ShowDialog(); 19 } 20 } 本文转自 jirigala 51CTO博客,原文链接:http://blog.51cto.com/2347979/1196203,如需转载请自行联系原作者