FlowBaseStep.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:4k
- //------------------------------------------------------------------------------
- // 创建标识: Copyright (C) 2009 Socansoft.com 版权所有
- // 创建描述: SocanCode代码生成器 V4.3.2.3 自动创建于 2009-12-19 11:11:11
- //
- // 功能描述:
- //
- // 修改标识:
- // 修改描述:
- //------------------------------------------------------------------------------
- using System;
- using System.Data;
- using System.Collections.Generic;
- using System.Text;
- using System.Web;
- using System.Web.Caching;
- namespace BLL
- {
- /// <summary>
- /// 业务逻辑类 FlowBaseStep
- /// </summary>
- public class FlowBaseStep
- {
- private readonly SqlServerDAL.FlowBaseStep dal = new SqlServerDAL.FlowBaseStep();
- public FlowBaseStep()
- { }
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public void Add(Model.FlowBaseStep model)
- {
- if(model == null)
- throw new Exception("实体参数不能为空。");
- //请在此处添加更多与业务逻辑有关的验证,例如:
- //if(string.IsNullOrEmpty(model.Name))
- // throw new Exception("名称不能为空。");
- //if (!Regex.IsMatch(style, @"^[swu4e00-u9fa5]{1,20}$"))
- // throw new Exception("名称格式不正确。");
- dal.Add(model);
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public void Update(Model.FlowBaseStep model)
- {
- if(model == null)
- throw new Exception("实体参数不能为空。");
- //请在此处添加更多与业务逻辑有关的验证,例如:
- //if(string.IsNullOrEmpty(model.Name))
- // throw new Exception("名称不能为空。");
- //if (!Regex.IsMatch(style, @"^[swu4e00-u9fa5]{1,20}$"))
- // throw new Exception("名称格式不正确。");
- dal.Update(model);
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public void Delete(int ID)
- {
- if (ID <= 0)
- throw new Exception("参数不正确。");
- dal.Delete(ID);
- }
- /// <summary>
- /// 是否存在该记录
- /// </summary>
- public bool Exists(int ID)
- {
- if (ID <= 0)
- throw new Exception("参数不正确。");
- return dal.Exists(ID);
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public Model.FlowBaseStep GetModel(int ID)
- {
- if (ID <= 0)
- throw new Exception("参数不正确。");
- return dal.GetModel(ID);
- }
- /// <summary>
- /// 获得泛型数据列表
- /// </summary>
- public List<Model.FlowBaseStep> GetList()
- {
- return dal.GetList();
- }
- /// <summary>
- /// 取得数据行数,不建议直接使用此方法,请根据业务逻辑重写
- /// </summary>
- public int GetCount(string condition)
- {
- return dal.GetCount(condition);
- }
- /// <summary>
- /// 分页获取泛型数据列表,不建议直接使用此方法,请根据业务逻辑重写
- /// </summary>
- public List<Model.FlowBaseStep> GetPageList(int pageSize, int pageIndex, string fldSort, bool fldDir, string condition)
- {
- if (pageSize <= 0)
- throw new Exception("每页数据条数必须大于0。");
- if (pageIndex <= 0)
- throw new Exception("页索引必须大于0。");
- if (string.IsNullOrEmpty(fldSort))
- throw new Exception("排序字段不能为空。如果是默认排序,可以填写主键字段。");
- return dal.GetPageList(pageSize, pageIndex, fldSort, fldDir, condition);
- }
- }
- }