Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((Session["adminUserName"] == null) && (Session["adminUserRole"] == null))
        {
            Response.Redirect("../error.aspx");
        }
        string managerName = Request.QueryString["ManagerName"]; //取得宿管姓名参数

        this.ManagerName.Text = managerName;
        //初始化界面显示
        Apartment apartment = new Apartment();

        apartment.GetApartmentManager(managerName);
        if (!IsPostBack)
        {
            //下面在界面上更新各个数据的显示
            this.ManagerSex.SelectedValue   = apartment.ManagerSex;
            this.ManagerState.SelectedValue = apartment.ManagerState;
            foreach (ListItem li in this.ManagerSex.Items)
            {
                int index = 0;
                if (li.Text == apartment.ManagerSex)
                {
                    this.ManagerSex.SelectedIndex = index;
                    break;
                }
                index++;
            }
            foreach (ListItem li in this.ManagerState.Items)
            {
                int index = 0;
                if (li.Text == apartment.ManagerState)
                {
                    this.ManagerState.SelectedIndex = index;
                    break;
                }
                index++;
            }
            this.ManagerTelephone.Text = apartment.ManagerTelephone;
            this.ManagerMemo.Text      = apartment.ManagerMemo;
        }
    }