MyLesson/ServiceUser/Exam_List.aspx.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace MyLesson.ServiceUser
{
public partial class Exam_List : UserForm
{
protected void Page_Load(object sender, EventArgs e)
{
this.ValidateLogin();
if (!this.IsPostBack)
{
this.InitForm();
if (!string.IsNullOrEmpty(Request.QueryString["id"]))
{
btnNew.Visible = false;
}
}
}
#region 窗体内部函数
/// <summary>
/// 初始化窗体内容
/// </summary>
public void InitForm()
{
this.InitGridForm();
}
/// <summary>
/// 初始化列表信息 若使用的话不能删除此函数
/// </summary>
private void InitGridForm()
{
this.txtUserID.Text = Session["userid"].ToString();
PRDataContext pr = new PRDataContext();
var DataSource=pr.Inf_Exam.Where(s => s.UserID==this.txtUserID.Text);
if(Session["userid"].ToString()=="admin")
DataSource = pr.Inf_Exam;
if (this.IsDept)
{
List<string> userList = new List<string>();
var UserSource = pr.Inf_User.Where(s => s.DeptID == this._DeptID);
foreach (var s in UserSource)
{
userList.Add(s.UserID);
}
if (!string.IsNullOrEmpty(Request.QueryString["id"]))
DataSource = DataSource.Where(s => userList.Contains(s.UserID));
else
后面还有 153 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
