You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/MvcShipping/DB/DingTalkContext.cs

37 lines
1001 B
C#

using HcUtility.Comm;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace DSWeb.Areas.MvcShipping.DB
{
public class DingTalkContext : DbContext
{
public DingTalkContext()
: base("DongShengDB")
{
}
public DbSet<User> Users { get; set; }
public DbSet<SysParamSet> ParamSets { get; set; }
public SysParamSet pAgentid { get; set; }
public DBResult CanUse() {
var result = new DBResult();
pAgentid = ParamSets.FirstOrDefault(p => p.PARAMNAME == "DingTalkAgentid");
if (pAgentid == null || string.IsNullOrWhiteSpace(pAgentid.PARAMVALUE))
{
//throw new Exception("钉钉Agentid参数配置错误");
result.SetErrorInfo("钉钉Agentid参数配置错误");
}
else {
result.OK();
}
return result;
}
}
}