public void updateReportAbuseComment(commentsBO commentsBO) { try { if (con.State == ConnectionState.Closed) { con.Open(); } query = "updateCommentReportedAsAbuse"; cmd = new SqlCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@guid", commentsBO.guid); cmd.Parameters.AddWithValue("@commentId", commentsBO.commentId); cmd.Parameters.AddWithValue("@enable", commentsBO.enable); cmd.Parameters.AddWithValue("@reportabuse", commentsBO.reportAbuseComment); cmd.ExecuteNonQuery(); } catch { throw; } finally { if (con.State == ConnectionState.Open) { con.Close(); } } }
public void postComment(commentsBO commentbo) { try { query = "COMMENT_INSERTED"; if (con.State == ConnectionState.Closed) { con.Open(); } cmd = new SqlCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@guid", commentbo.guid); cmd.Parameters.AddWithValue("@issueId", commentbo.issueId); cmd.Parameters.AddWithValue("@comment", commentbo.comment); cmd.Parameters.AddWithValue("@postedOn", DateTime.Now); cmd.ExecuteNonQuery(); } catch { throw; } finally { if (con.State == ConnectionState.Open) con.Close(); } }
public void postComment(commentsBO commentbo) { try { query = "COMMENT_INSERTED"; if (con.State == ConnectionState.Closed) { con.Open(); } cmd = new SqlCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@guid", commentbo.guid); cmd.Parameters.AddWithValue("@issueId", commentbo.issueId); cmd.Parameters.AddWithValue("@comment", commentbo.comment); cmd.Parameters.AddWithValue("@postedOn", DateTime.Now); cmd.ExecuteNonQuery(); } catch { throw; } finally { if (con.State == ConnectionState.Open) { con.Close(); } } }
private string postComment(Int64 issueId, Int64 guid, string comment) { commentsBO commentbo = new commentsBO(); commentbo.issueId = issueId; commentbo.guid = guid; commentbo.comment = comment; return(" comment posted"); }
public void updateReportAbuseComment(commentsBO commmentsBO) { try { commentdal.updateReportAbuseComment(commmentsBO); } catch { } finally { } }
protected void ListIssues_ItemCommand(object source, RepeaterCommandEventArgs e) { supportDenyBO supportdenybo = new supportDenyBO(); Int64 issueId ; string btncmdname; try { issueId = Convert.ToInt64(e.CommandArgument); btncmdname = e.CommandName.ToString(); if (btncmdname == "comment") { // ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); // ((Repeater)e.Item.FindControl("ListComments")).DataBind(); } else if (btncmdname == "support") { supportdenybo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = true; DataTable dt= supportdenybal.updateData(supportdenybo); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "deny") { supportdenybo.guid = int.Parse(Session["guid"].ToString()); ; /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = false; DataTable dt = supportdenybal.updateData(supportdenybo); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "report") { reportbal.Issue_Report(issueId); ((Image)e.Item.FindControl("IMG_Report")).ImageUrl = "../images/flag-red.png"; ((LinkButton)e.Item.FindControl("Report_Abuse")).Enabled = false; } else if (btncmdname == "post") { commentsBO commentsbo = new commentsBO(); TextBox txtcomment = (TextBox)(e.Item.FindControl("TxtComment")); if (txtcomment.Text != "") { commentsbo.comment = txtcomment.Text; commentsbo.issueId = issueId; txtcomment.Text = ""; commentsbo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ commentbal.postComment(commentsbo); ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); ((Repeater)e.Item.FindControl("ListComments")).DataBind(); } } else if (btncmdname == "more") { } } catch (Exception ex) { throw ex; } finally { } }
protected void ListIssues_ItemCommand(object source, RepeaterCommandEventArgs e) { supportDenyBO supportdenybo = new supportDenyBO(); Int64 issueId ; string btncmdname; try { issueId = Convert.ToInt64(e.CommandArgument); btncmdname = e.CommandName.ToString(); if (btncmdname == "comment") { // ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); // ((Repeater)e.Item.FindControl("ListComments")).DataBind(); } else if (btncmdname == "support") { supportdenybo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = true; supportdenybal.updateData(supportdenybo); DataTable dt = issuesbal.getIssue(issueId); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "deny") { supportdenybo.guid = int.Parse(Session["guid"].ToString()); ; /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = false; supportdenybal.updateData(supportdenybo); DataTable dt = issuesbal.getIssue(issueId); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "post") { commentsBO commentsbo = new commentsBO(); TextBox txtcomment = e.Item.FindControl("TxtComment") as TextBox; commentsbo.comment = ((TextBox)(e.Item.FindControl("TxtComment"))).Text; commentsbo.issueId = issueId; txtcomment.Text = ""; commentsbo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ commentbal.postComment(commentsbo); ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); ((Repeater)e.Item.FindControl("ListComments")).DataBind(); DataTable dt = issuesbal.getIssue(issueId); ((Label)e.Item.FindControl("LBLcommentCount")).Text = dt.Rows[0]["commentCount"].ToString(); loadlist(50, 0); } } catch { throw; } finally { } }
public void postComment(commentsBO commentbo) { commentdal.postComment(commentbo); }
private string postComment(Int64 issueId, Int64 guid, string comment) { commentsBO commentbo = new commentsBO(); commentbo.issueId = issueId; commentbo.guid = guid; commentbo.comment = comment; return " comment posted"; }
protected void ListIssues_ItemCommand(object source, RepeaterCommandEventArgs e) { supportDenyBO supportdenybo = new supportDenyBO(); Int64 issueId; string btncmdname; try { issueId = Convert.ToInt64(e.CommandArgument); btncmdname = e.CommandName.ToString(); if (btncmdname == "comment") { // ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); // ((Repeater)e.Item.FindControl("ListComments")).DataBind(); } else if (btncmdname == "support") { supportdenybo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = true; DataTable dt = supportdenybal.updateData(supportdenybo); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "deny") { supportdenybo.guid = int.Parse(Session["guid"].ToString());; /** from session **/ supportdenybo.issueId = issueId; supportdenybo.supportDeny = false; DataTable dt = supportdenybal.updateData(supportdenybo); ((Label)e.Item.FindControl("LBLsupportCount")).Text = dt.Rows[0]["supportCount"].ToString(); ((Label)e.Item.FindControl("LBLdenyCount")).Text = dt.Rows[0]["denyCount"].ToString(); } else if (btncmdname == "report") { reportbal.Issue_Report(issueId); ((Image)e.Item.FindControl("IMG_Report")).ImageUrl = "../images/flag-red.png"; ((LinkButton)e.Item.FindControl("Report_Abuse")).Enabled = false; } else if (btncmdname == "post") { commentsBO commentsbo = new commentsBO(); TextBox txtcomment = (TextBox)(e.Item.FindControl("TxtComment")); if (txtcomment.Text != "") { commentsbo.comment = txtcomment.Text; commentsbo.issueId = issueId; txtcomment.Text = ""; commentsbo.guid = int.Parse(Session["guid"].ToString()); /** from session **/ commentbal.postComment(commentsbo); ((Repeater)e.Item.FindControl("ListComments")).DataSource = (DataTable)commentbal.getComments(Convert.ToInt64(issueId)); ((Repeater)e.Item.FindControl("ListComments")).DataBind(); } } else if (btncmdname == "more") { } } catch (Exception ex) { throw ex; } finally { } }
protected void DataListIssues_ItemCommand(object source, DataListCommandEventArgs e) { supportDenyBO supportdenybo = new supportDenyBO(); string btncmdname; try { btncmdname = e.CommandName.ToString(); if (btncmdname == "support") { supportdenybo.guid = 1; /** from session **/ supportdenybo.issueId = Convert.ToInt64(e.CommandArgument); supportdenybo.supportDeny = true; supportdenybal.updateData(supportdenybo); loadDataList(); } if (btncmdname == "deny") { supportdenybo.guid = 1; /** from session **/ supportdenybo.issueId = Convert.ToInt64(e.CommandArgument); supportdenybo.supportDeny = false; supportdenybal.updateData(supportdenybo); loadDataList(); } if (btncmdname == "post") { commentsBO commentsbo = new commentsBO(); TextBox txtcomment = e.Item.FindControl("TxtComment") as TextBox; commentsbo.comment = ((TextBox)(e.Item.FindControl("TxtComment"))).Text; HiddenField issueIdh = e.Item.FindControl("HiddenFieldissueId") as HiddenField; Int64 issueId = Convert.ToInt64(issueIdh.Value); commentsbo.issueId = issueId; txtcomment.Text = ""; commentsbo.guid = 1; /** from session **/ commentbal.postComment(commentsbo); loadDataList(); } } catch { throw; } finally { } }
public void updateReportAbuseComment(commentsBO commentsBO) { try { if (con.State == ConnectionState.Closed) { con.Open(); } query = "updateCommentReportedAsAbuse"; cmd = new SqlCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@guid", commentsBO.guid); cmd.Parameters.AddWithValue("@commentId", commentsBO.commentId); cmd.Parameters.AddWithValue("@enable", commentsBO.enable); cmd.Parameters.AddWithValue("@reportabuse", commentsBO.reportAbuseComment); cmd.ExecuteNonQuery(); } catch { throw; } finally { if (con.State == ConnectionState.Open) con.Close(); } }