123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.Entities;
- using EMIS.DataLogic.Repositories;
- using Bowin.Common.JSON;
- using Bowin.Common.Linq;
- using System.Web;
- using EMIS.ViewModel;
- using System.Linq.Expressions;
- namespace EMIS.CommonLogic.SystemServices
- {
- public class ConfiguretermsInfoServices : BaseServices, IConfiguretermsInfoServices
- {
- public ConfiguretermsInfoRepository configuretermsInfoRepository { get; set; }
- public ConfiguretermsExpandRepository configuretermsExpandRepository { get; set; }
- /// <summary>
- /// 获取查询条件列表
- /// </summary>
- /// <param name="munClass">例如 表名</param>
- /// <param name="munID">页面ID</param>
- /// <returns></returns>
- public List<Entities.Sys_ConfiguretermsInfo> GetConfiguretermsInfo(string munID, string munClass)
- {
- //查询条件
- Expression<Func<Sys_ConfiguretermsInfo, bool>> expression = x => x.MNUID == munID && x.MUNClass == munClass && x.RecordStatus == (int)SYS_STATUS.USABLE;
- var result = configuretermsInfoRepository.GetList(expression, i => i.Sys_ConfiguretermsExpand).OrderBy(x => x.OrderNo).ToList();
- foreach (var item in result.SelectMany(s => s.Sys_ConfiguretermsExpand))
- {
- item.Sys_ConfiguretermsInfo = null;
- }
- return result;
- }
- public List<Sys_ConfiguretermsExpand> GetConfiguretermsExpand(Guid ConfiguretermsInfoID)
- {
- //查询条件
- System.Linq.Expressions.Expression<Func<Sys_ConfiguretermsExpand, bool>> expression = (x => true);
- if (ConfiguretermsInfoID != null && ConfiguretermsInfoID != Guid.Empty)
- expression = (x => x.ConfiguretermsInfoID == ConfiguretermsInfoID);
- return configuretermsExpandRepository.GetList(expression).OrderBy(x => x.CreateTime).ToList();
- }
- /// <summary>
- /// 获取控件名称
- /// </summary>
- /// <param name="ConfiguretermsInfo"></param>
- /// <returns></returns>
- public string GetConControlName(Sys_ConfiguretermsInfo ConfiguretermsInfo)
- {
- string name = ConfiguretermsInfo.Value.Replace(".", "");
- if (ConfiguretermsInfo.ControlType == "TextBox")
- name = name + "_QueryTextBox";
- else if (ConfiguretermsInfo.ControlType == "DropdownList")
- name = name + "_QueryDropdownList";
- else if (ConfiguretermsInfo.ControlType == "DictionaryDropDownList")
- name = name + "_QueryDictionaryDropDownList";
- else if (ConfiguretermsInfo.ControlType == "CheckBox")
- name = name + "_QueryCheckBox";
- else if (ConfiguretermsInfo.ControlType == "ComboGrid")
- name = name + "_QueryComboGrid";
- else if (ConfiguretermsInfo.ControlType == "TextBoxDate")
- name = name + "_QueryTextBoxDate";
- return name;
- }
- }
- }
|