Files
zszq-trs/YLErpWeb/Models/ModelHelper.cs
T
2024-05-09 14:06:26 +08:00

29 lines
947 B
C#

namespace YLErp.Web.Models
{
public static class ClientModelHelper
{
/// <summary>
/// 获取所有联系人类型
/// </summary>
public static List<SelectListItem> GetAllcontactype(bool IsProdunct = true)
{
using (var con = DbContextFactory.GetClientDbContext(null))
{
var retList = con.contactype.Select(m => new SelectListItem
{
Text = m.ContactType,
Value = m.id + ""
}).ToList();
if (!IsProdunct)
{
var productionManager = retList.Where(o => o.Text == "产品投资经理").FirstOrDefault();
if (productionManager != null)
{
retList.Remove(productionManager);
}
}
return retList;
}
}
}
}