コード例 #1
0
        public UserProperties(int id)
        {
            InitializeComponent();
            initial();
            isCreating = false;
            userId     = id;
            User user = GlobalDb.getUser(id);

            if (user.id == 0)
            {
                MessageBox.Show("未找到此用户");
                this.Close();
            }
            textBoxName.Text      = user.name;
            textBoxCellPhone.Text = user.cellPhone;
            Store store = ShardDb.getStore(user.storeId);

            if (store.id == 0)
            {
                MessageBox.Show("未找到店铺");
                this.Close();
            }
            comboBoxStore.SelectedValue = user.storeId;
            comboBoxCity.SelectedValue  = store.cityId;
            comboBoxRole.SelectedValue  = user.roleId;
            textBoxMemo.Text            = user.memo;
            textBoxMail.Text            = user.mail;
            checkBoxActive.Checked      = user.active;
            buttonDelete.Visible        = !isCreating;
        }