コード例 #1
0
ファイル: Form1.cs プロジェクト: milosghub/Student
        private void RefreshData()
        {
            List <Student> students = studentBusiness.GetStudents();

            listBox.Items.Clear();

            foreach (Student s in students)
            {
                listBox.Items.Add(s.Id + " - " + s.Name + " - " + s.IndexNumber + " - " + s.AverageMark);
            }
        }
コード例 #2
0
 private void RefreshView(int NewIndex)
 {
     try
     {
         int    size      = this.gv_Result.PageSize;
         string name      = tb_AddName.Text.Trim();
         string school    = ddl_School.SelectedValue;
         string sex       = ddl_sex.SelectedValue;
         string startYear = input_start.Value;
         string endYear   = input_end.Value;
         var    ps        = StudentBusiness.GetStudents(size, name, school, sex, startYear, endYear);
         this.gv_Result.PageIndex  = NewIndex;
         this.gv_Result.DataSource = new PagedCollection <Student>(ps, NewIndex);
         this.gv_Result.DataBind();
         this.Label_Result.Text = ps.GetResultCount().ToString();
     }
     catch
     {
         ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "alter", "alert('数据加载错误!')", true);
     }
 }
コード例 #3
0
        //GET: /Students/
        public IActionResult Index()
        {
            var students = _studentBusiness.GetStudents();

            return(View(students));
        }
        // GET: Student
        public ActionResult Index()
        {
            var x = new StudentBusiness();

            return(View(x.GetStudents().ToList()));
        }