Esempio n. 1
0
 private void ShowInfo()
 {
     eChartProject.BLL.eChart.Accounts_Users   bll   = new eChartProject.BLL.eChart.Accounts_Users();
     eChartProject.Model.eChart.Accounts_Users model = bll.GetModel();
     this.lblUserID.Text   = model.UserID.ToString();
     this.lblFundID.Text   = model.FundID.ToString();
     this.lblUsername.Text = model.Username;
     this.lblPassword.Text = model.Password;
     this.lblAge.Text      = model.Age.ToString();
     this.lblCity.Text     = model.City;
     this.lblCountry.Text  = model.Country;
     this.lblEmail.Text    = model.Email;
     this.lblGender.Text   = model.Gender.ToString();
 }
Esempio n. 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtUserID.Text))
            {
                strErr += "UserID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtFundID.Text))
            {
                strErr += "FundID格式错误!\\n";
            }
            if (this.txtUsername.Text.Trim().Length == 0)
            {
                strErr += "Username不能为空!\\n";
            }
            if (this.txtPassword.Text.Trim().Length == 0)
            {
                strErr += "Password不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtAge.Text))
            {
                strErr += "Age格式错误!\\n";
            }
            if (this.txtCity.Text.Trim().Length == 0)
            {
                strErr += "City不能为空!\\n";
            }
            if (this.txtCountry.Text.Trim().Length == 0)
            {
                strErr += "Country不能为空!\\n";
            }
            if (this.txtEmail.Text.Trim().Length == 0)
            {
                strErr += "Email不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtGender.Text))
            {
                strErr += "Gender格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int    UserID   = int.Parse(this.txtUserID.Text);
            int    FundID   = int.Parse(this.txtFundID.Text);
            string Username = this.txtUsername.Text;
            string Password = this.txtPassword.Text;
            int    Age      = int.Parse(this.txtAge.Text);
            string City     = this.txtCity.Text;
            string Country  = this.txtCountry.Text;
            string Email    = this.txtEmail.Text;
            int    Gender   = int.Parse(this.txtGender.Text);


            eChartProject.Model.eChart.Accounts_Users model = new eChartProject.Model.eChart.Accounts_Users();
            model.UserID   = UserID;
            model.FundID   = FundID;
            model.Username = Username;
            model.Password = Password;
            model.Age      = Age;
            model.City     = City;
            model.Country  = Country;
            model.Email    = Email;
            model.Gender   = Gender;

            eChartProject.BLL.eChart.Accounts_Users bll = new eChartProject.BLL.eChart.Accounts_Users();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }