protected void btnResolve_Click(object sender, EventArgs e) { Dispute dis = DisputeDB.getDisputeforRental(Request["rentid"].ToString()); if (dis.Status == "Resolved") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your page has expired since your disputer has closed the case')", true); rptMessages.DataBind(); setChatControls(false); tbxMessage.Text = ""; return; } //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "confirmMessage", "confirm('You are about to close the dispute case. As the action is irreversible, are you sure?')", true); DisputeDB.resolveDispute(dis.DisputeID); MessageDispute msgDis = new MessageDispute(); msgDis.Date = DateTime.Now; msgDis.Dispute = dis; msgDis.Member = MemberDB.getMemberbyEmail(Session["user"].ToString()); msgDis.Staff = new Staff(null, null, null, null, 0, null, new DateTime()); msgDis.Reply = "==============The Dispute has been closed================"; MessageDisputeDB.addMsgDispute(msgDis); setChatControls(false); }
protected void btnBanDisputed_Click(object sender, EventArgs e) { Dispute dis = DisputeDB.getDisputeybyID(Request.QueryString["disputeID"].ToString()); if (dis.Status == "Resolved") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your page has expired since the disputer has closed the case')", true); rptMessages.DataBind(); setChatControls(false); txtMsg.Value = ""; return; } Member targetMember = new Member(); if (dis.SubmittedBy.MemberID != dis.Rental.Rentee.MemberID) { targetMember = dis.Rental.Rentee; } else { targetMember = dis.Rental.Item.Renter; } if (targetMember.Status == "Banned") { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Form resubmission is not allowed')", true); rptMessages.DataBind(); return; } MemberDB.updateMemberStatus(targetMember.MemberID, "Banned"); submitMessage("=======" + targetMember.Name + " has been banned, dispute resolved=======", dis); DisputeDB.resolveDispute(dis.DisputeID); setChatControls(false); Response.Redirect(Request.RawUrl); }