public void Reply_OnClick(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbReply.Text)) { FailMessage("回复失败,必须填写答复内容"); return; } try { DataProvider.GovPublicApplyReplyDao.DeleteByApplyId(applyInfo.Id); var fileUrl = string.Empty; var replyInfo = new GovPublicApplyReplyInfo(0, PublishmentSystemId, applyInfo.Id, tbReply.Text, fileUrl, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now); DataProvider.GovPublicApplyReplyDao.Insert(replyInfo); GovPublicApplyManager.Log(PublishmentSystemId, applyInfo.Id, EGovPublicApplyLogType.Reply, Body.AdministratorName, Body.AdministratorInfo.DepartmentId); DataProvider.GovPublicApplyDao.UpdateState(applyInfo.Id, EGovPublicApplyState.Replied); SuccessMessage("申请回复成功"); AddWaitAndRedirectScript(ListPageUrl); } catch (Exception ex) { FailMessage(ex, ex.Message); } }
public void Insert(GovPublicApplyReplyInfo replyInfo) { var sqlString = "INSERT INTO wcm_GovPublicApplyReply(PublishmentSystemID, ApplyID, Reply, FileUrl, DepartmentID, UserName, AddDate) VALUES (@PublishmentSystemID, @ApplyID, @Reply, @FileUrl, @DepartmentID, @UserName, @AddDate)"; var parms = new IDataParameter[] { GetParameter(ParmPublishmentsystemid, EDataType.Integer, replyInfo.PublishmentSystemID), GetParameter(ParmApplyId, EDataType.Integer, replyInfo.ApplyID), GetParameter(ParmReply, EDataType.NText, replyInfo.Reply), GetParameter(ParmFileUrl, EDataType.NVarChar, 255, replyInfo.FileUrl), GetParameter(ParmDepartmentId, EDataType.Integer, replyInfo.DepartmentID), GetParameter(ParmUserName, EDataType.VarChar, 50, replyInfo.UserName), GetParameter(ParmAddDate, EDataType.DateTime, replyInfo.AddDate) }; ExecuteNonQuery(sqlString, parms); }
public GovPublicApplyReplyInfo GetReplyInfoByApplyId(int applyId) { GovPublicApplyReplyInfo replyInfo = null; var parms = new IDataParameter[] { GetParameter(ParmApplyId, EDataType.Integer, applyId) }; using (var rdr = ExecuteReader(SqlSelectByApplyId, parms)) { if (rdr.Read()) { var i = 0; replyInfo = new GovPublicApplyReplyInfo(GetInt(rdr, i++), GetInt(rdr, i++), GetInt(rdr, i++), GetString(rdr, i++), GetString(rdr, i++), GetInt(rdr, i++), GetString(rdr, i++), GetDateTime(rdr, i)); } rdr.Close(); } return(replyInfo); }