WinForm应用程序框架设计之WinAction(删除数据)
来源:互联网 发布:淘宝店打不开怎么回事 编辑:程序博客网 时间:2024/05/23 21:19
我们来先看看WinAction的删除数据的流程:
具体的参考代码:
public virtual void DeleteEntity(object entity, object caller, object sender, EventArgs e) { if (caller is IDataListView) { IDataListView listForm = caller as IDataListView; if (null == listForm.DataList || (listForm.DataList is ICollection && (listForm.DataList as ICollection).Count == 0)) return; } if (MessageBox.Show("确实要删除当前记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; //判断当前删除的是否是新增的记录。(如果是新增的那条,其id为-1) if (entity is Entity && (entity as Entity).IsNewEntity) { Form eForm = CallEditForm(caller); if (eForm.Visible) eForm.Close(); return; } useBll.Delete((T)entity); if (updateFreshByDB && caller is IDataListView && (caller as IDataListView).RefreshEntityList != null) (caller as IDataListView).RefreshEntityList((caller as IDataListView).SearchEntity, caller, sender, e); }
原创作品出自努力偷懒,转载请说明文章出处:http://blog.csdn.net/kfarvid或 http://www.cnblogs.com/kfarvid/
- WinForm应用程序框架设计之WinAction(删除数据)
- WinForm应用程序框架设计之WinAction(新增数据)
- WinForm应用程序框架设计之WinAction(修改数据)
- WinForm应用程序框架设计之WinAction(数据操作)
- WinForm应用程序框架设计之WinAction(介绍)
- WinForm应用程序框架设计之WinAction(一:显示列表窗体)
- 应用程序框架设计之二:分层和层间数据传递(上)
- 应用程序框架设计之二:分层和层间数据传递(下)
- 应用程序框架设计之前言
- 应用程序框架设计之前言
- 应用程序框架设计之前言
- 应用程序框架设计之前言
- WinForm应用程序之注册模块的设计与实现
- 应用程序框架设计(一)
- 应用程序框架设计之二:分层和层间数据传递
- 应用程序框架设计之前言 (转)
- Winform开发框架之数据即时更新的实现
- Winform开发框架之数据即时更新的实现
- 学习jquery validation总结
- java调用存储过程(摘抄)
- [Android开发]Android 重要组件 之 Intent
- platform设备添加流程
- 记录下callstack信息
- WinForm应用程序框架设计之WinAction(删除数据)
- APMServ启用.htaccess伪静态重写功能,APMServ设置伪静态
- android:layout_weight属性的使用
- Request.返回值
- POJ 3126 Prime Path BFS
- sql developer无法更新数据
- 教你用VS2008/VS2010写简单C/C++语言main函数程序
- C# 中的委托和事件
- 回文字符串的测试