Exemplo n.º 1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Score model = new Score();

            model.sCode = textBox1.Text;
            ScoreDAL.Drop(model, "scode");
            ShowDataGird();
        }
Exemplo n.º 2
0
        public ScoreControllerV1(LeaderboardContext context)
        {
            this.context = context;
            this.context.ChangeTracker.QueryTrackingBehavior = Microsoft.EntityFrameworkCore.QueryTrackingBehavior.NoTracking;

            personDAL = new PersonDAL(context);
            scoreDAL  = new ScoreDAL(context);
        }
 public ScoreBLL(ScoreDAL dal)
 {
     this.ScoreID  = dal.ScoreID;
     this.Score    = dal.Score;
     this.UserID   = dal.UserID;
     this.GameID   = dal.GameID;
     this.UserName = dal.UserName;
     this.GameName = dal.GameName;
 }
Exemplo n.º 4
0
        private void Button2_Click(object sender, EventArgs e)
        {
            Score model = new Score();

            model.sCode = textBox1.Text;
            model.name  = textBox2.Text;
            model.kemu  = textBox4.Text;
            model.score = textBox3.Text;
            ScoreDAL.Add(model);
            ShowDataGird();
        }
        public ScoreBLL FindScoreByScoreID(int ScoreID)
        {
            ScoreBLL ProposedReturnValue = null;
            ScoreDAL DataLayerObject     = _context.FindScoreByScoreID(ScoreID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new ScoreBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 显示数据网格控件
        /// </summary>
        public void ShowDataGird()
        {
            this.dataGridView1.DataSource = null;
            this.dataGridView1.Columns.Clear();

            List <Score> list = ScoreDAL.FindList(new Score());

            dataGridView1.DataSource = list;

            dataGridView1.Columns["sCode"].HeaderText = "学号";
            dataGridView1.Columns["name"].HeaderText  = "学生姓名";
            dataGridView1.Columns["kemu"].HeaderText  = "科目";
            dataGridView1.Columns["score"].HeaderText = "成绩";
        }
Exemplo n.º 7
0
 private void DataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Columns[e.ColumnIndex].Name == "colBtn_alter")
     {
         Score model = new Score();
         model.sCode = dataGridView1.Rows[e.RowIndex].Cells["sCode"].Value.ToString();
         model.name  = dataGridView1.Rows[e.RowIndex].Cells["name"].Value.ToString();
         model.kemu  = dataGridView1.Rows[e.RowIndex].Cells["kemu"].Value.ToString();
         model.score = dataGridView1.Rows[e.RowIndex].Cells["score"].Value.ToString();
         if (ScoreDAL.AlterByPK(model, "sCode"))
         {
             ShowDataGird(); MessageBox.Show("修改成功", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Exemplo n.º 8
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Score model = new Score();

            model.name = textBox2.Text;
            this.dataGridView1.DataSource = null;
            this.dataGridView1.Columns.Clear();
            List <Score> list = ScoreDAL.FindList(model, "name");

            dataGridView1.DataSource = list;
            dataGridView1.Columns["sCode"].HeaderText = "学号";
            dataGridView1.Columns["name"].HeaderText  = "学生姓名";
            dataGridView1.Columns["kemu"].HeaderText  = "科目";
            dataGridView1.Columns["score"].HeaderText = "成绩";
        }
Exemplo n.º 9
0
        public void ShowDataGird()
        {
            this.dataGridView1.DataSource = null;
            this.dataGridView1.Columns.Clear();

            List <Score> list = ScoreDAL.FindList(new Score());

            dataGridView1.DataSource = list;

            dataGridView1.Columns["sCode"].HeaderText = "学号";
            dataGridView1.Columns["sCode"].ReadOnly   = true;
            dataGridView1.Columns["name"].HeaderText  = "学生姓名";
            dataGridView1.Columns["kemu"].HeaderText  = "科目";
            dataGridView1.Columns["score"].HeaderText = "成绩";

            DataGridViewButtonColumn col_Btn_alter = new DataGridViewButtonColumn();

            col_Btn_alter.Name       = "colBtn_alter";
            col_Btn_alter.HeaderText = "";
            col_Btn_alter.DefaultCellStyle.NullValue = "修改";
            dataGridView1.Columns.Add(col_Btn_alter);
        }
Exemplo n.º 10
0
        public static DataTable GetClasses()
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetClasses());
        }
Exemplo n.º 11
0
        public static DataTable GetSubjectGoSpecID(string specid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetSubjectGoSpecID(specid));
        }
Exemplo n.º 12
0
        public static DataTable GetScoreByStudentid(string studentid)
        {
            ScoreDAL sd = new ScoreDAL();

            return(sd.GetScoreByStudentid(studentid));
        }
Exemplo n.º 13
0
        /// <summary>
        /// 根据学生id,科目id修改成绩
        /// </summary>
        /// <param name="score">成绩</param>
        /// <param name="studentid">学生id</param>
        /// <param name="subjectid">科目id</param>
        /// <returns></returns>
        public static int UpdateExamInation(string score, string studentid, string subjectid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.UpdateExamInation(score, studentid, subjectid));
        }
Exemplo n.º 14
0
        public static DataTable GetTeacher()
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetTeacher());
        }
Exemplo n.º 15
0
        /// <summary>
        /// 插入成绩
        /// </summary>
        /// <param name="studentid">学生id</param>
        /// <param name="subjectid">科目id</param>
        /// <param name="score">成绩</param>
        /// <returns></returns>
        public static int InsertExamInation(string studentid, string subjectid, string score)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.InsertExamInation(studentid, subjectid, score));
        }
Exemplo n.º 16
0
 public static IList <Score> getList(String stuid)
 {
     return(ScoreDAL.Find(stuid));
 }
Exemplo n.º 17
0
        public static DataTable GetExamInationByClassid(string classid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetExamInationByClassid(classid));
        }
Exemplo n.º 18
0
        public static DataTable GetStudentByClassid(string classid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetStudentByClassid(classid));
        }
Exemplo n.º 19
0
        /// <summary>
        /// 根据专业id获取成绩
        /// </summary>
        /// <param name="specid"></param>
        /// <returns></returns>
        public static DataTable GetExamInationBySpecid(string specid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetExamInationBySpecid(specid));
        }
Exemplo n.º 20
0
 public static IList <Score> getAll()
 {
     return(ScoreDAL.getAll());
 }
Exemplo n.º 21
0
 public static Dictionary <int, String> getCourse()
 {
     return(ScoreDAL.getCourse());
 }
Exemplo n.º 22
0
 public static Score getRow(int sid)
 {
     return(ScoreDAL.getRow(sid));
 }
Exemplo n.º 23
0
        /// <summary>
        /// 根据专业id获取学生id,学生姓名,学生班级
        /// </summary>
        /// <param name="specid"></param>
        /// <returns></returns>
        public static DataTable GetStudentBySpecid(string specid)
        {
            ScoreDAL sid = new ScoreDAL();

            return(sid.GetStudentBySpecid(specid));
        }
Exemplo n.º 24
0
 public static bool Add(Score s)
 {
     return(ScoreDAL.Add(s));
 }
Exemplo n.º 25
0
 public static bool Update(Score s)
 {
     return(ScoreDAL.Update(s));
 }
Exemplo n.º 26
0
 public static bool Delete(int sid)
 {
     return(ScoreDAL.Delete(sid));
 }