WFProcessSchemeService.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using LeaRun.Application.Entity.FlowManage;
  2. using LeaRun.Application.IService.FlowManage;
  3. using LeaRun.Data.Repository;
  4. namespace LeaRun.Application.Service.FlowManage
  5. {
  6. /// <summary>
  7. /// 版 本 6.1
  8. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  9. /// 创建人:陈彬彬
  10. /// 日 期:2016.03.18 15:54
  11. /// 描 述:工作流实例模板内容表操作(支持:SqlServer)
  12. /// </summary>
  13. public class WFProcessSchemeService:RepositoryFactory, WFProcessSchemeIService
  14. {
  15. #region 获取数据
  16. /// <summary>
  17. /// 获取实体对象
  18. /// </summary>
  19. /// <param name="keyValue">主键</param>
  20. /// <returns></returns>
  21. public WFProcessSchemeEntity GetEntity(string keyValue)
  22. {
  23. try
  24. {
  25. return this.BaseRepository().FindEntity<WFProcessSchemeEntity>(keyValue);
  26. }
  27. catch
  28. {
  29. throw;
  30. }
  31. }
  32. #endregion
  33. #region 提交数据
  34. /// <summary>
  35. /// 保存实体数据
  36. /// </summary>
  37. /// <param name="keyValue"></param>
  38. /// <param name="entity"></param>
  39. public void SaveEntity(string keyValue,WFProcessSchemeEntity entity)
  40. {
  41. try
  42. {
  43. if (string.IsNullOrEmpty(keyValue))
  44. {
  45. entity.Create();
  46. this.BaseRepository().Insert<WFProcessSchemeEntity>(entity);
  47. }
  48. else {
  49. entity.Modify(keyValue);
  50. this.BaseRepository().Update<WFProcessSchemeEntity>(entity);
  51. }
  52. }
  53. catch
  54. {
  55. throw;
  56. }
  57. }
  58. #endregion
  59. }
  60. }