我正在尝试创建一个系统如下 -
UI 层 - 带有用于过滤要显示的数据的选项的下拉菜单
中间层——“.cs”类来操作数据
后层 - 在这里数据被过滤并返回到类(EDMX 文件和类)
但是我的实现不起作用......错误显示为“不同上下文的参考”..
protected void Page_Load(object sender, EventArgs e)
{
inc = (IQueryable<Incident_Raw_Data>)Session["INC"];
AppInfo = (IQueryable<Application_Info>)DbData.GetDBData().AppInfo;
RespConfg = (IQueryable<Response_Config>)DbData.GetDBData().RespConfig;
ResolConfg = (IQueryable<Resolution_Config>)DbData.GetDBData().ResolConfig;
DTbl = QueryRslt(xyz, abc);
Data = GetData();
Cols = Col();
}
别介意缺少任何退货声明;;
public DataTable QueryRslt(string Type, string Value)
{
if (!string.IsNullOrEmpty(Type))
{
var str = (from IR in inc
join AI in AppInfo on IR.CI equals AI.Application_Name
join RC in RespConfg on AI.Service_Level_Categoty equals RC.Category
where (RC.Tkt_Type == "Incident" && IR.Priority == Value)
select new
{
ID = IR.Incident_ID,
CI = IR.CI,
Status = IR.Status,
BenchMark_Response_Time = RC.Days_Benchmark,
SLMDeviation = ((EntityFunctions.DiffHours(IR.Incident_Reported_Date, IR.Incident_Responded_Date) / 24.0) - RC.Days_Benchmark),
Priority = IR.Priority,
ReportedDate = IR.Incident_Reported_Date,
RespondDate = IR.Incident_Responded_Date,
AssigneeGroup = IR.Assignee,
AssignedGroup = IR.Assigned_Group
}).ToList();
}
}