protected void btnDel_Click(object sender, EventArgs e) { IntendanceMasterAction intendanceMasterAction = new IntendanceMasterAction(); IntendancePhotoListAction intendancePhotoListAction = new IntendancePhotoListAction(); DataTable photoInfoList = intendancePhotoListAction.GetPhotoInfoList(this.hdnIntendanceGuid.Value); string text; if (photoInfoList.Rows.Count > 0) { for (int i = 0; i < photoInfoList.Rows.Count; i++) { MakeThumbnail makeThumbnail = new MakeThumbnail(); if (makeThumbnail.DelThumbnai(photoInfoList.Rows[i]["NoteId"].ToString())) { } } if (intendancePhotoListAction.ClearPhotosList(this.hdnIntendanceGuid.Value) > 0) { text = "1"; } else { text = "删除失败"; } } else { text = "1"; } if (!(text == "1")) { this.js.Text = "alert('" + text + "!');"; return; } if (intendanceMasterAction.Del(this.hdnIntendanceGuid.Value) > 0) { this.js.Text = "alert('删除成功!');"; this.DataBindToPage(""); return; } this.js.Text = "alert('删除失败!');"; }
protected void DataBindToPage(string strWhere) { IntendanceMasterAction intendanceMasterAction = new IntendanceMasterAction(); DataTable dataSource = new DataTable(); strWhere = this.strUser; if (this.hdnflag.Value == "2" || this.hdnflag.Value == "3") { if (this.hdnflag.Value == "2") { int num = 2; if (this.ProjectCode == new Guid("00000000-0000-0000-0000-000000000000")) { string sqlString = string.Concat(new object[] { "select a.*,b.v_xm,c.PrjName,c.PrjGuid ,d.CodeName from OPM_EPCM_IntendanceMaster as a inner join PT_yhmc as b on a.OpYhdm=b.v_yhdm inner join pt_prjinfo as c on a.PrjGuid=c.PrjGuid INNER JOIN dbo.XPM_Basic_CodeList as d ON a.QuestionTypeId = d.CodeID where d.TypeID = (select TypeId from XPM_Basic_CodeType WHERE SignCode='ProblemSupervise')", strWhere, " and a.settleState = ", num, " order by a.BookInDate desc" }); dataSource = publicDbOpClass.DataTableQuary(sqlString); } else { dataSource = intendanceMasterAction.GetList(this.ProjectCode, strWhere); } } else { dataSource = intendanceMasterAction.GetList(this.ProjectCode, strWhere); } } else { dataSource = intendanceMasterAction.GetList(this.ProjectCode, strWhere); } this.grdModules.DataSource = dataSource; this.grdModules.DataBind(); }