32 lines
819 B
C#
32 lines
819 B
C#
using YLErp.Model;
|
|
|
|
namespace YLErp.BLL
|
|
{
|
|
public class configcolumnBLL
|
|
{
|
|
public static bool IsColumnShow(string columnName, configcolumn data)
|
|
{
|
|
if (data == null || data.columnModel == null)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
var displayColumn = data.columnModel.FirstOrDefault(c => c.label == columnName);
|
|
if (displayColumn == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return !displayColumn.hidden;
|
|
}
|
|
|
|
public static configcolumn GetData(int userId, string targetName)
|
|
{
|
|
using (var con = new YLContext())
|
|
{
|
|
return con.configcolumn.FirstOrDefault(c => c.userid == userId && c.targetname == targetName);
|
|
}
|
|
}
|
|
}
|
|
}
|