123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- using LeaRun.Application.Entity.SystemManage;
- using LeaRun.Application.Entity.SystemManage.ViewModel;
- using LeaRun.Application.IService.SystemManage;
- using LeaRun.Application.Service.SystemManage;
- using LeaRun.Cache.Factory;
- using LeaRun.Util;
- using System;
- using System.Collections.Generic;
- namespace LeaRun.Application.Busines.SystemManage
- {
- /// <summary>
- /// 版 本 6.1
- /// Copyright (c) 2013-2016 上海力软信息技术有限公司
- /// 创建人:佘赐雄
- /// 日 期:2015.11.17 9:56
- /// 描 述:数据字典明细
- /// </summary>
- public class DataItemDetailBLL
- {
- private IDataItemDetailService service = new DataItemDetailService();
- /// <summary>
- /// 缓存key
- /// </summary>
- public string cacheKey = "dataItemCache";
- #region 获取数据
- /// <summary>
- /// 明细列表
- /// </summary>
- /// <param name="itemId">分类Id</param>
- /// <returns></returns>
- public IEnumerable<DataItemDetailEntity> GetList(string itemId)
- {
- return service.GetList(itemId);
- }
- /// <summary>
- /// 明细实体
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- public DataItemDetailEntity GetEntity(string keyValue)
- {
- return service.GetEntity(keyValue);
- }
- /// <summary>
- /// 数据字典列表
- /// </summary>
- /// <returns></returns>
- public IEnumerable<DataItemModel> GetDataItemList()
- {
- return service.GetDataItemList();
- }
- #endregion
- #region 验证数据
- /// <summary>
- /// 项目值不能重复
- /// </summary>
- /// <param name="itemValue">项目值</param>
- /// <param name="keyValue">主键</param>
- /// <param name="itemId">分类Id</param>
- /// <returns></returns>
- public bool ExistItemValue(string itemValue, string keyValue, string itemId)
- {
- return service.ExistItemValue(itemValue, keyValue, itemId);
- }
- /// <summary>
- /// 项目名不能重复
- /// </summary>
- /// <param name="itemName">项目名</param>
- /// <param name="keyValue">主键</param>
- /// <param name="itemId">分类Id</param>
- /// <returns></returns>
- public bool ExistItemName(string itemName, string keyValue, string itemId)
- {
- return service.ExistItemName(itemName, keyValue, itemId);
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除明细
- /// </summary>
- /// <param name="keyValue">主键</param>
- public void RemoveForm(string keyValue)
- {
- try
- {
- service.RemoveForm(keyValue);
- CacheFactory.Cache().RemoveCache(cacheKey);
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 保存明细表单(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <param name="dataItemDetailEntity">明细实体</param>
- /// <returns></returns>
- public void SaveForm(string keyValue, DataItemDetailEntity dataItemDetailEntity)
- {
- try
- {
- dataItemDetailEntity.SimpleSpelling = Str.PinYin(dataItemDetailEntity.ItemName);
- service.SaveForm(keyValue, dataItemDetailEntity);
- CacheFactory.Cache().RemoveCache(cacheKey);
- }
- catch (Exception)
- {
- throw;
- }
- }
- #endregion
- }
- }
|