⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modifyuser.aspx.cs

📁 实现电子病历功能 有医生护士等角色 分别可以增加病历修改病历删除病历等等功能 等等
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class IndividualOperation_Administrator_ModifyUser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string userName = Request.QueryString["UserName"].ToString();
            if (userName != "")
            {
                init(userName);
            }
        }
    }
    private static UserInfo user;
    private void init(string userName)
    {
       user = CommonService.getUser(userName);
        if (user != null)
        {
            TextBoxAddress.Text = user.Address;
            TextBoxAnswer.Text = user.Answer;
            TextBoxEmailAddress.Text = user.EmailAddress;
            TextBoxIdentItycardNum.Text = user.IdentitycardNum;
            Image1.ImageUrl = "~/Src/CommonOperation/Photograph/" + user.Photo;
            TextBoxQuestion.Text = user.Question;
            TextBoxRealName.Text = user.RealName;
            TextBoxTelephone.Text = user.TelephoneNum; 
            DropDownListSex.SelectedValue =user.Sex.ToString();          
            DropDownListYear.Items.Add(user.BirthDay.Year.ToString());
            DropDownListMonth.SelectedValue = user.BirthDay.Month.ToString();
            DropDownListDay.SelectedValue = user.BirthDay.Day.ToString();
            DropDownListActive.SelectedValue = user.IsActive.ToString();
            DropDownListRole.SelectedValue = user.Role.ToString();
        }
    }
    protected void ButtonSave_Click(object sender, EventArgs e)
    {
        user.IsActive = Convert.ToInt32(DropDownListActive.SelectedValue);
        if (AdministratorSerice.modifyUser(user))
        {
            string redirect = Request.ApplicationPath + "/Default.aspx";
            Response.Write(@"<script language='Javascript'>
                 alert('修改用户 成功!');window.location.href='UserList.aspx';</script>");
        }
    }
    protected void ButtonDelete_Click(object sender, EventArgs e)
    {
        if (AdministratorSerice.deleteUser(user.UserName))
        {
            string redirect = Request.ApplicationPath + "/Default.aspx";
            Response.Write(@"<script language='Javascript'>
                 alert('删除用户 成功!');window.location.href='UserList.aspx';</script>");            
        }
    }
    protected void ButtonCancle_Click(object sender, EventArgs e)
    {
        Response.Write("<script language='Javascript'>window.location.href='UserList.aspx';</script>");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -