private void Button1_Click(object sender, EventArgs e) { Score model = new Score(); model.sCode = textBox1.Text; ScoreDAL.Drop(model, "scode"); ShowDataGird(); }
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; }
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); }
/// <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 = "成绩"; }
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); } } }
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 = "成绩"; }
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); }
public static DataTable GetClasses() { ScoreDAL sid = new ScoreDAL(); return(sid.GetClasses()); }
public static DataTable GetSubjectGoSpecID(string specid) { ScoreDAL sid = new ScoreDAL(); return(sid.GetSubjectGoSpecID(specid)); }
public static DataTable GetScoreByStudentid(string studentid) { ScoreDAL sd = new ScoreDAL(); return(sd.GetScoreByStudentid(studentid)); }
/// <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)); }
public static DataTable GetTeacher() { ScoreDAL sid = new ScoreDAL(); return(sid.GetTeacher()); }
/// <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)); }
public static IList <Score> getList(String stuid) { return(ScoreDAL.Find(stuid)); }
public static DataTable GetExamInationByClassid(string classid) { ScoreDAL sid = new ScoreDAL(); return(sid.GetExamInationByClassid(classid)); }
public static DataTable GetStudentByClassid(string classid) { ScoreDAL sid = new ScoreDAL(); return(sid.GetStudentByClassid(classid)); }
/// <summary> /// 根据专业id获取成绩 /// </summary> /// <param name="specid"></param> /// <returns></returns> public static DataTable GetExamInationBySpecid(string specid) { ScoreDAL sid = new ScoreDAL(); return(sid.GetExamInationBySpecid(specid)); }
public static IList <Score> getAll() { return(ScoreDAL.getAll()); }
public static Dictionary <int, String> getCourse() { return(ScoreDAL.getCourse()); }
public static Score getRow(int sid) { return(ScoreDAL.getRow(sid)); }
/// <summary> /// 根据专业id获取学生id,学生姓名,学生班级 /// </summary> /// <param name="specid"></param> /// <returns></returns> public static DataTable GetStudentBySpecid(string specid) { ScoreDAL sid = new ScoreDAL(); return(sid.GetStudentBySpecid(specid)); }
public static bool Add(Score s) { return(ScoreDAL.Add(s)); }
public static bool Update(Score s) { return(ScoreDAL.Update(s)); }
public static bool Delete(int sid) { return(ScoreDAL.Delete(sid)); }