private void GetScore() { foreach (Control c in panel1.Controls) { Inc.UcStarScore ucStar = (Inc.UcStarScore)c; foreach (DataRow dr in dtEvaluation.Rows) { if (dr["EVALUATIONID"].ToString() == ucStar.ItemContentID) { dr["DEFAULTSCORE"] = ucStar.ItemScore; } } } }
private void BindUC() { this.lblLast.Enabled = true; this.lblNext.Enabled = true; panel1.Controls.Clear(); if (CurrentPageNum == 1) { this.lblLast.Enabled = false; } if (CurrentPageNum == AllPageNum) { this.lblNext.Enabled = false; } int StartIndex = 0; if (CurrentPageNum != 1) { StartIndex = (CurrentPageNum - 1) * ItemCountInPage; } int endIndex = StartIndex + ItemCountInPage - 1; int locationCount = 0; for (int i = StartIndex; i <= endIndex; i++) { if (i >= dtEvaluation.Rows.Count) { break; } Inc.UcStarScore ucStar = new Inc.UcStarScore(); ucStar.ItemContentID = dtEvaluation.Rows[i]["EVALUATIONID"].ToString(); ucStar.ItemScore = dtEvaluation.Rows[i]["DEFAULTSCORE"].ToString(); ucStar.ItemContent = dtEvaluation.Rows[i]["EVALUATIONCONTENT"].ToString(); ucStar.star_click += UcStar_star_click; ucStar.Location = new Point(0, locationCount * ucStar.Height); panel1.Controls.Add(ucStar); locationCount++; } }