Ejemplo n.º 1
0
 private void ShowInfo(int Id)
 {
     Eva.BLL.Awards bll=new Eva.BLL.Awards();
     Eva.Model.Awards model=bll.GetModel(Id);
     this.lblId.Text=model.Id.ToString();
     this.lblName.Text=model.Name;
     this.lblGrade.Text=model.Grade;
     this.lblScore.Text=model.Score;
     this.lblStudentId.Text=model.StudentId.ToString();
     this.lblAcademicYear.Text=model.AcademicYear.ToString();
     this.lblSchoolTerm.Text=model.SchoolTerm.ToString();
     this.lblIsCheck.Text=model.IsCheck;
     this.lblTotal.Text=model.Total.ToString();
 }
Ejemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtName.Text.Trim().Length==0)
            {
                strErr+="Name不能为空!\\n";
            }
            if(this.txtGrade.Text.Trim().Length==0)
            {
                strErr+="Grade不能为空!\\n";
            }
            if(this.txtScore.Text.Trim().Length==0)
            {
                strErr+="Score不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtStudentId.Text))
            {
                strErr+="StudentId格式错误!\\n";
            }
            if(!PageValidate.IsNumber(txtAcademicYear.Text))
            {
                strErr+="AcademicYear格式错误!\\n";
            }
            if(!PageValidate.IsNumber(txtSchoolTerm.Text))
            {
                strErr+="SchoolTerm格式错误!\\n";
            }
            if(this.txtIsCheck.Text.Trim().Length==0)
            {
                strErr+="IsCheck不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtTotal.Text))
            {
                strErr+="Total格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            string Name=this.txtName.Text;
            string Grade=this.txtGrade.Text;
            string Score=this.txtScore.Text;
            int StudentId=int.Parse(this.txtStudentId.Text);
            int AcademicYear=int.Parse(this.txtAcademicYear.Text);
            int SchoolTerm=int.Parse(this.txtSchoolTerm.Text);
            string IsCheck=this.txtIsCheck.Text;
            int Total=int.Parse(this.txtTotal.Text);

            Eva.Model.Awards model=new Eva.Model.Awards();
            model.Name=Name;
            model.Grade=Grade;
            model.Score=Score;
            model.StudentId=StudentId;
            model.AcademicYear=AcademicYear;
            model.SchoolTerm=SchoolTerm;
            model.IsCheck=IsCheck;
            model.Total=Total;

            Eva.BLL.Awards bll=new Eva.BLL.Awards();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }