using LeaRun.Application.Entity.SystemManage;
using LeaRun.Data.Repository;
using LeaRun.Util.WebControl;
using System.Collections.Generic;
namespace LeaRun.Application.IService.SystemManage
{
///
/// 版 本 6.1
/// Copyright (c) 2013-2016 上海力软信息技术有限公司
/// 创建人:佘赐雄
/// 日 期:2015.12.21 16:19
/// 描 述:编号规则
///
public interface ICodeRuleService
{
#region 获取数据
///
/// 规则列表
///
/// 分页
/// 查询参数
///
IEnumerable GetPageList(Pagination pagination, string queryJson);
///
/// 规则实体
///
/// 主键值
///
CodeRuleEntity GetEntity(string keyValue);
#endregion
#region 验证数据
///
/// 规则编号不能重复
///
/// 编号
/// 主键
///
bool ExistEnCode(string enCode, string keyValue);
///
/// 规则名称不能重复
///
/// 名称
/// 主键
///
bool ExistFullName(string fullName, string keyValue);
#endregion
#region 提交数据
///
/// 删除规则
///
/// 主键
void RemoveForm(string keyValue);
///
/// 保存规则表单(新增、修改)
///
/// 主键值
/// 规则实体
///
void SaveForm(string keyValue, CodeRuleEntity codeRuleEntity);
#endregion
#region 单据编码处理
///
/// 获得指定模块或者编号的单据号
///
/// 用户ID
/// 模块ID
/// 模板编码
/// 单据号
string GetBillCode(string userId, string moduleId, string enCode);
///
/// 占用单据号
///
/// 用户ID
/// 模块ID
/// 模板编码
/// true/false
bool UseRuleSeed(string userId, string moduleId, string enCode, IRepository db = null);
///
/// 获得指定模块或者编号的单据号(直接使用)
///
/// 用户ID
/// 模块ID
/// 模板编码
/// 单据号
string SetBillCode(string userId, string moduleId, string enCode, IRepository db = null);
#endregion
}
}