public static List <ParentComment> GetAllDepartmentsandEmployee() { List <ParentComment> listDepartments = new List <ParentComment>(); string cs = ConfigurationManager.ConnectionStrings["commentConnectionString"].ConnectionString; using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("Select *from ParentComment", con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { ParentComment parent = new ParentComment(); parent.ParentCommentID = Convert.ToInt32(rdr["CommentID"]); parent.ParentUserName = rdr["UserName"].ToString(); string date = rdr["CommentDate"].ToString(); date = date.Substring(0, date.LastIndexOf("/") + 5); parent.ParanetCommentDate = date; parent.ParentCommentMessage = rdr["CommentMessage"].ToString(); listDepartments.Add(parent); } } return(listDepartments); }
public void Comment() { string uID = Request.QueryString["uID"]; //DataTable dt = b.Get_Parent_Comment(int.Parse(uID)); GridView1.DataSource = ParentComment.GetAllDepartmentsandEmployee(int.Parse(uID)); GridView1.DataBind(); }
private void Reply_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (string.IsNullOrWhiteSpace(Text)) { return; } ParentComment.AddReply(new Reply(AuthService.CurrentUser, Text)); }
public string[] CommentDetails(ParentComment comment) { string[] commentDetails = new string[16]; commentDetails[0] = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(comment.User.Name); //username commentDetails[1] = comment.User.Picture; //imgUrl commentDetails[2] = comment.DateTime.ToShortDateString(); // datetime commentDetails[3] = "gp" + comment.Id; //grandparentId commentDetails[4] = "mc" + comment.Id; //maincommentid commentDetails[5] = "cpr" + comment.Id; //childCommentId commentDetails[6] = "cex" + comment.Id; //commentExpid commentDetails[7] = "ctex" + comment.Id; //ctrlExpid commentDetails[8] = "ctflg" + comment.Id; //ctrlFlagId commentDetails[9] = "sp" + comment.Id; //shareParentId commentDetails[10] = "sc" + comment.Id; //shareChildId commentDetails[11] = "td" + comment.Id; //comText commentDetails[12] = "tdc" + comment.Id; //comTextdiv commentDetails[13] = "rpl" + comment.Id; //Reply commentDetails[14] = "cc1" + comment.Id; //commentControl commentDetails[15] = "cc2" + comment.Id; //commentMenu return(commentDetails); }