using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
namespace Learun.Application.TwoDevelopment.SystemDemo
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创建人:陈彬彬
/// 日 期:2017.04.17
/// 描 述:系统表单-请假单
///
public class DemoleaveService : RepositoryFactory
{
#region 获取数据
///
/// 获取请假数据列表
///
/// 分页
///
public IEnumerable GetPageList(Pagination pagination)
{
try
{
return this.BaseRepository().FindList(pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
///
/// 根据流程实例获取表单数据
///
///
///
public DemoleaveEntity GetEntity(string processId)
{
try
{
return this.BaseRepository().FindEntity(processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion
#region 提交数据
///
/// 保存更新数据
///
/// 主键
/// 实体对象
public void SaveEntity(string keyValue, DemoleaveEntity entity)
{
try
{
if (string.IsNullOrEmpty(keyValue))
{
entity.Create();
this.BaseRepository().Insert(entity);
}
else
{
entity.Modify(keyValue);
this.BaseRepository().Update(entity);
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion
}
}