public void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(this.txtES_TYPE.Text.Trim().Length==0) { strErr+="ES_TYPE不能为空!\\n"; } if(this.txtES_TITLE.Text.Trim().Length==0) { strErr+="ES_TITLE不能为空!\\n"; } if(this.txtES_CONTENT.Text.Trim().Length==0) { strErr+="ES_CONTENT不能为空!\\n"; } if(!PageValidate.IsNumber(txtES_HARD.Text)) { strErr+="ES_HARD格式错误!\\n"; } if(!PageValidate.IsNumber(txtES_DELFLAG.Text)) { strErr+="ES_DELFLAG格式错误!\\n"; } if(!PageValidate.IsDateTime(txtES_CTIME.Text)) { strErr+="ES_CTIME格式错误!\\n"; } if(this.txtES_TID.Text.Trim().Length==0) { strErr+="ES_TID不能为空!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } string ES_ID=this.lblES_ID.Text; string ES_TYPE=this.txtES_TYPE.Text; string ES_TITLE=this.txtES_TITLE.Text; string ES_CONTENT=this.txtES_CONTENT.Text; int ES_HARD=int.Parse(this.txtES_HARD.Text); int ES_DELFLAG=int.Parse(this.txtES_DELFLAG.Text); DateTime ES_CTIME=DateTime.Parse(this.txtES_CTIME.Text); string ES_TID=this.txtES_TID.Text; cfs.Model.OT_ESSAY model=new cfs.Model.OT_ESSAY(); model.ES_ID=ES_ID; model.ES_TYPE=ES_TYPE; model.ES_TITLE=ES_TITLE; model.ES_CONTENT=ES_CONTENT; model.ES_HARD=ES_HARD; model.ES_DELFLAG=ES_DELFLAG; model.ES_CTIME=ES_CTIME; model.ES_TID=ES_TID; cfs.BLL.OT_ESSAY bll=new cfs.BLL.OT_ESSAY(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx"); }
private void ShowInfo(string ES_ID) { cfs.BLL.OT_ESSAY bll=new cfs.BLL.OT_ESSAY(); cfs.Model.OT_ESSAY model=bll.GetModel(ES_ID); this.lblES_ID.Text=model.ES_ID; this.lblES_TYPE.Text=model.ES_TYPE; this.lblES_TITLE.Text=model.ES_TITLE; this.lblES_CONTENT.Text=model.ES_CONTENT; this.lblES_HARD.Text=model.ES_HARD.ToString(); this.lblES_DELFLAG.Text=model.ES_DELFLAG.ToString(); this.lblES_CTIME.Text=model.ES_CTIME.ToString(); this.lblES_TID.Text=model.ES_TID; }
private void ShowInfo(string ES_ID) { cfs.BLL.OT_ESSAY bll = new cfs.BLL.OT_ESSAY(); cfs.Model.OT_ESSAY model = bll.GetModel(ES_ID); this.lblES_ID.Text = model.ES_ID; this.lblES_TYPE.Text = model.ES_TYPE; this.lblES_TITLE.Text = model.ES_TITLE; this.lblES_CONTENT.Text = model.ES_CONTENT; this.lblES_HARD.Text = model.ES_HARD.ToString(); this.lblES_DELFLAG.Text = model.ES_DELFLAG.ToString(); this.lblES_CTIME.Text = model.ES_CTIME.ToString(); this.lblES_TID.Text = model.ES_TID; }
private void BindData(int numPerPage, int pageNum) { cfs.BLL.OT_ESSAY bll = new cfs.BLL.OT_ESSAY(); StringBuilder sb = new StringBuilder(); DataSet ds = new DataSet(); //根据Session值查表 string sqlwhere = "ES_TYPE = 5 AND ES_DELFLAG = 0"; TotalCount = bll.GetRecordCount(sqlwhere); ds = bll.GetListByPage(sqlwhere, "ES_ID DESC", (pageNum - 1) * numPerPage + 1, pageNum * numPerPage); sb.Append("<table class=\"table\" width=\"80%\" layouth=\"74\"><thead><tr align='center'><th>题目编号</th><th width='15%'>作文题目</th><th width=\"50%\">题目叙述</th><th width='5%'>难易度</th><th width='10%'>创建教师</th></tr></thead>"); sb.Append("<tbody>"); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { sb.Append("<tr target='qsid' rel='" + ds.Tables[0].Rows[i]["ES_ID"] + "' align='center'>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_ID"]); sb.Append("</td>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_TITLE"]); sb.Append("</td>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_CONTENT"]); sb.Append("</td>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_HARD"]); sb.Append("</td>"); //显示用户分组,根据Session的值更改 sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_TID"]); sb.Append("</td>"); sb.Append("</tr>"); } } sb.Append("</tbody></table>"); MainTable.InnerHtml = sb.ToString(); }
private void BindData(int numPerPage, int pageNum) { cfs.BLL.OT_ESSAY bll = new cfs.BLL.OT_ESSAY(); StringBuilder sb = new StringBuilder(); DataSet ds = new DataSet(); //根据Session值查表 string sqlwhere = "ES_TYPE = 2 AND ES_DELFLAG = 0"; TotalCount = bll.GetRecordCount(sqlwhere); ds = bll.GetListByPage(sqlwhere, "ES_ID DESC", (pageNum - 1) * numPerPage + 1, pageNum * numPerPage); sb.Append("<table class=\"table\" width=\"80%\" layouth=\"74\"><thead><tr align='center'><th>题目编号</th><th width=\"15%\">文章标题</th><th width=\"60%\">文章内容</th><th width='5%'>难易度</th><th width='10%'>创建教师</th></tr></thead>"); sb.Append("<tbody>"); if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { sb.Append("<tr target='esid' rel='" + ds.Tables[0].Rows[i]["ES_ID"] + "' align='center'>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_ID"]); sb.Append("</td>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_CONTENT"]); sb.Append("</td>"); sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_HARD"]); sb.Append("</td>"); //显示用户分组,根据Session的值更改 sb.Append("<td>"); sb.Append(ds.Tables[0].Rows[i]["ES_TID"]); sb.Append("</td>"); sb.Append("</tr>"); } } sb.Append("</tbody></table>"); MainTable.InnerHtml = sb.ToString(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtES_TYPE.Text.Trim().Length == 0) { strErr += "ES_TYPE不能为空!\\n"; } if (this.txtES_TITLE.Text.Trim().Length == 0) { strErr += "ES_TITLE不能为空!\\n"; } if (this.txtES_CONTENT.Text.Trim().Length == 0) { strErr += "ES_CONTENT不能为空!\\n"; } if (!PageValidate.IsNumber(txtES_HARD.Text)) { strErr += "ES_HARD格式错误!\\n"; } if (!PageValidate.IsNumber(txtES_DELFLAG.Text)) { strErr += "ES_DELFLAG格式错误!\\n"; } if (!PageValidate.IsDateTime(txtES_CTIME.Text)) { strErr += "ES_CTIME格式错误!\\n"; } if (this.txtES_TID.Text.Trim().Length == 0) { strErr += "ES_TID不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string ES_ID = this.lblES_ID.Text; string ES_TYPE = this.txtES_TYPE.Text; string ES_TITLE = this.txtES_TITLE.Text; string ES_CONTENT = this.txtES_CONTENT.Text; int ES_HARD = int.Parse(this.txtES_HARD.Text); int ES_DELFLAG = int.Parse(this.txtES_DELFLAG.Text); DateTime ES_CTIME = DateTime.Parse(this.txtES_CTIME.Text); string ES_TID = this.txtES_TID.Text; cfs.Model.OT_ESSAY model = new cfs.Model.OT_ESSAY(); model.ES_ID = ES_ID; model.ES_TYPE = ES_TYPE; model.ES_TITLE = ES_TITLE; model.ES_CONTENT = ES_CONTENT; model.ES_HARD = ES_HARD; model.ES_DELFLAG = ES_DELFLAG; model.ES_CTIME = ES_CTIME; model.ES_TID = ES_TID; cfs.BLL.OT_ESSAY bll = new cfs.BLL.OT_ESSAY(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }