MyLesson/ServiceUser/Dept_List.aspx.cs

(开头部分) 6KB

这里只显示每个文件的开头 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 Dept_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()
        {
            PRDataContext pr = new PRDataContext();
            var DataSource = pr.Inf_Dept.Where(s => s.DeptID.Contains(this.txtDeptID.Text.Trim()) && s.DeptName.Contains(this.txtDeptName.Text.Trim()));


            this.InitAdoPage(DataSource.Count());
            DataSource = DataSource.Skip(int.Parse(this.Ado_PageSize.Value) * (int.Parse(this.Ado_PageIndex.Text) - 1)).Take(int.Parse(this.Ado_PageSize.Value));
            this.dgList.DataSource = DataSource;
            this.dgList.DataBind();

        }
        #endregion

        #region 事件产生的函数
        protected void btnNew_Click(object sender, EventArgs e)
        {
            Response.Redirect("Dept_Edit.aspx");
        }

        protected void dgList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            PRDataContext pr = new PRDataContext();
后面还有 127 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。