protected void btnDeleteAll_Click(object sender, EventArgs e)
 {
     foreach (RepeaterItem item in CommentsListRepeater.Items)
     {
         HiddenField hidCommentRecId = item.FindControl("hidCommentRecId") as HiddenField;
         if (hidCommentRecId != null)
         {
             MasterDetailComment.Delete(Convert.ToInt64(hidCommentRecId.Value));
         }
         BindData();
     }
 }
        protected void CommentsListRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Delete":
                int recId = Convert.ToInt32(e.CommandArgument);
                // Delete the comment record.  Cascase delete will remove flag records as well.
                MasterDetailComment.Delete(recId);
                BindData();
                break;

            case "Accept":
                int recId2 = Convert.ToInt32(e.CommandArgument);
                // Accept the comment, and clear all flag records.
                MasterDetailFlagComment.Delete(MasterDetailFlagComment.Columns.CommentId, recId2);
                BindData();
                break;

            default:
                break;
            }
        }
 public bool Delete(object Id)
 {
     return(MasterDetailComment.Delete(Id) == 1);
 }