??????FormDataAccess

using Genersoft.Fms.Center.Pub.Com;
using Genersoft.Platform.AdpBizIntegration.Entity;
using Genersoft.Platform.AppFramework.Service;
using Genersoft.Platform.Core.Common;
using Genersoft.Platform.Core.DataAccess;
using Genersoft.Platform.Core.Error;
using Genersoft.Platform.Engine.DataAccess.ClientSPI;
using Genersoft.Platform.Resource.Metadata.Common;
using Genersoft.Platform.Resource.Metadata.DataModel;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Genersoft.SZYD.SXTB
{
class SXQDTBFormDataAccess :FMSFormDataAccess
{
#region 卡片表单

#region 新增前

/// <summary>
/// 重写新增前检查
/// 注意此方法是在新增后点击保存时触发
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">表单数据</param>
protected override void BeforeAddObjectInTransaction(GspDataModel dataModel, DataSet data)
{
string errorMessage = string.Empty;
if (!CheckBeforeSave(dataModel, data, out errorMessage))
{
throw new GSPException(errorMessage, ErrorLevel.Info);
}
base.BeforeAddObjectInTransaction(dataModel, data);
}

#endregion

#region 新增后

/// <summary>
/// 重写新增后
/// 注意此方法是在新增后点击保存时触发
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">表单数据</param>
protected override void AfterAddObjectInTransaction(GspDataModel dataModel, DataSet data)
{
base.AfterAddObjectInTransaction(dataModel, data);
}

#endregion

#region 保存前

/// <summary>
/// 重写保存前
/// 注意新增后的保存不会触发,会触发BeforeAddObjectInTransaction
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">表单数据</param>
protected override void BeforeSaveObjectInTransaction(GspDataModel dataModel, DataSet data)
{
string errorMessage = string.Empty;
if (!CheckBeforeSave(dataModel, data, out errorMessage))
{
throw new GSPException(errorMessage, ErrorLevel.Info);
}
base.BeforeSaveObjectInTransaction(dataModel, data);
}

#endregion

#region 保存后

/// <summary>
/// 重写保存后
/// 注意新增后的保存不会触发,会触发AfterAddObjectInTransaction
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">表单数据</param>
protected override void AfterSaveObjectInTransaction(GspDataModel dataModel, DataSet data)
{
base.AfterSaveObjectInTransaction(dataModel, data);
}

#endregion

#region 删除前

/// <summary>
/// 重写删除前
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">模型数据</param>
/// <param name="dataID">内码</param>
protected override void BeforeRemoveObjectInTransaction(GspDataModel dataModel, DataSet data, object dataID)
{
base.BeforeRemoveObjectInTransaction(dataModel, data, dataID);
}

#endregion

#region 删除后

/// <summary>
/// 重写删除后
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">模型数据</param>
/// <param name="dataID">内码</param>
protected override void AfterRemoveObjectInTransaction(GspDataModel dataModel, DataSet data, object dataID)
{
base.AfterRemoveObjectInTransaction(dataModel, data, dataID);
}

#endregion

#region 保存前检查

/// <summary>
/// 保存前检查
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">模型数据</param>
/// <param name="errorMessage">错误信息</param>
/// <returns>检查结果</returns>
private bool CheckBeforeSave(GspDataModel dataModel, DataSet data, out string errorMessage)
{
errorMessage = string.Empty;
return true;

}

#endregion

#endregion

#region 列表表单

#region 列表取数

/// <summary>
/// 列表表单取数扩展
/// </summary>
/// <param name="dataModelID">数据模型ID</param>
/// <param name="filter">表单中加的过滤条件</param>
/// <param name="queryType">查询类型</param>
/// <param name="policy">策略</param>
/// <param name="otherParam">其他参数</param>
/// <param name="dataContext">表单传值</param>
/// <returns></returns>
public override DataSet GetObjectsXmlByOtherParam3(string dataModelID, ref GSPFilter filter, DataQueryType queryType, IQueryFilterPolicy policy, WebSolutionContext otherParam, JObject dataContext)
{
//解析出表单中加的过滤条件
List<Express> lstCondition = ExpressParser.ParserExpression(filter.FilterCondition);


return base.GetObjectsXmlByOtherParam3(dataModelID, ref filter, queryType, policy, otherParam, dataContext);
}

#endregion

#region 批量删除前

/// <summary>
/// 重写批量删除前
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">模型数据</param>
/// <param name="condition">过滤条件</param>
protected override void BeforeRemoveObjectsInTransaction(GspDataModel dataModel, DataSet data, string condition)
{
base.BeforeRemoveObjectsInTransaction(dataModel, data, condition);
}

#endregion

#region 批量删除后

/// <summary>
/// 重写批量删除后
/// </summary>
/// <param name="dataModel">数据模型</param>
/// <param name="data">模型数据</param>
/// <param name="condition">过滤条件</param>
protected override void AfterRemoveObjectsInTransaction(GspDataModel dataModel, DataSet data, string condition)
{
base.AfterRemoveObjectsInTransaction(dataModel, data, condition);
}

#endregion

#endregion
}
}

posted @ 2020-12-17 10:09  泉城余文乐  Views(71)  Comments(0Edit  收藏  举报