MyLesson/ServiceUser/User_Edits.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyLesson.ServiceUser
{
    public partial class User_Edits : UserForm
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ValidateLogin();
            if (!this.IsPostBack)
            {
                this.txtUserID.Text = Request.QueryString["UserID"] + "";
                this.InitList();
                this.InitForm();
                if (this.IsDept)
                    this.lstDeptID.Enabled = false;
            }
        }

        public void InitList()
        {
            PRDataContext pr = new PRDataContext();
            this.lstDeptID.DataSource = pr.Inf_Dept;
            this.lstDeptID.DataTextField = "DeptName";
            this.lstDeptID.DataValueField = "DeptID";
            this.lstDeptID.DataBind();

            if (this.IsDept)
            {
                if (this.lstDeptID.Items.FindByValue(this._DeptID) != null)
                {
                    this.lstDeptID.ClearSelection();
                    this.lstDeptID.Items.FindByValue(this._DeptID).Selected = true;
                }
            }
        }

        public void InitForm()
        {
            if (this.txtUserID.Text != "")
            {
                PRDataContext pr = new PRDataContext();
                this.txtUserID.Enabled = false;
                Inf_User user = pr.Inf_User.Where(s => s.UserID == this.txtUserID.Text).SingleOrDefault();
                if (user != null)
                {
                    this.txtUserID.Text = user.UserID;
                    this.txtPassword.Text = user.Password;
                    this.txtTel.Text = user.Tel;
                    this.txtUserName.Text = user.UserName;
                    if (this.lstUserType.Items.FindByValue(user.UserType) != null)
                    {
                        this.lstUserType.ClearSelection();
                        this.lstUserType.Items.FindByValue(user.UserType).Selected = true;
后面还有 47 行代码,购买后查看完整代码

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

AI 解读 AI

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

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