天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.2 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.FJC.Entity.Basic;
using QMFrameWork.Data;
using System.Data;
using QMAPP.Entity;
using QMAPP.FJC.Entity.MD;
namespace QMAPP.FJC.DAL.Basic
{
/// </summary>
/// 模块名称:配置表
/// 作 者:张松男
/// 编写日期:2021年03月17日
/// </summary>
public class AppConfigDAL
{
/// <summary>
/// 获取全部规则
/// </summary>
/// <returns></returns>
public AppConfig Get(string Code)
{
try
{
string sql = $"SELECT * FROM [T_MD_AppConfig_QD] where Code = '{Code}'";
List<DataParameter> parameters = new List<DataParameter>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
return session.Get<AppConfig>(sql, parameters.ToArray());
}
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取全部规则
/// </summary>
/// <returns></returns>
public MaterialClass GetMATERIAL(string MATERIALCode,ref string msg)
{
try
{
var sql = $" select MATERIAL_TYPE_NAME,LAYER_NUM,UP_MATERIAL_TYPE_CODE from T_MD_MATERIAL_CLASS where MATERIAL_TYPE_CODE = '{MATERIALCode}'";
var MaterialClass = new MaterialClass();
List<DataParameter> parameters = new List<DataParameter>();
using (IDataSession session = AppDataFactory.CreateMainSession())
{
MaterialClass = session.Get<MaterialClass>(sql, parameters.ToArray());
}
if (MaterialClass.LAYER_NUM == "2")
{
msg = MaterialClass.MATERIAL_TYPE_NAME;
return MaterialClass;
}
else
{
GetMATERIAL(MaterialClass.UP_MATERIAL_TYPE_CODE,ref msg);
}
return MaterialClass;
}
catch (Exception ex)
{
throw ex;
}
}
}
}