Пример #1
0
        private BsReviewsForm addObjectsList(DataTable dt_)
        {
            BsReviewsForm objects = new BsReviewsForm();

            foreach (DataRow dr in dt_.Rows)
            {
                objects.Add(Convert.ToInt32(dr["idReview"]), setObject(new BsReviewForm(), dr));
            }
            return(objects);
        }
Пример #2
0
        private void getReviewsForm(BsReviewForm r)
        {
            string ordem = Convert.ToString(Session["ordem"]);

            if (ordem == null)
            {
                ordem = "desc";
            }
            else
            {
                if (ordem == "asc")
                {
                    ordem = "desc";
                }
                else
                {
                    ordem = "asc";
                }
            }

            Session["ordem"] = ordem;
            string field = Request["field"];

            if (field == null || field == "" || field == "undefined")
            {
                ordem = "";
            }
            else
            {
                ordem = field + " " + ordem;
            }

            Business.BsReviewsForm rvs = r.GetObjects(ordem);
            createPageXML();
            string htm = "<TABLE  BORDER=\"1\" bordercolor=\"#F8F5F0\" width=\"100%\" CELLSPACING=\"1\" CELLPADDING=\"1\">" +
                         "<TR >";

            htm += "<TD onmousedown=\"createMenuReviewInsert(" + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ");\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"20\" ><a href=\"javascript:openReviewsForm( " + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ",'review', 'none')\"><b>Comentários</b></a></TD>";
            htm += "<TD onmousedown=\"createMenuReviewInsert(" + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ");\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"20\" ><a href=\"javascript:openReviewsForm( " + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ",'idUser', 'none')\"><b>Usuário</b></a></TD>";
            htm += "<TD onmousedown=\"createMenuReviewInsert(" + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ");\" title=\"Clique no campo para organizar em ordem " + (ordem != "asc" ? "ascendente" : "decrescente") + " \" width=\"15\" ><a href=\"javascript:openReviewsForm( " + r.ItemForm.Id + ", " + r.ItemForm.Form.Id + ",'data','none' )\"><b>Data</b></a></TD>";
            htm += "</TR>";

            for (int j = 0; j < rvs.Count; j++)
            {
                htm += "<TR style=\"cursor:hand\" bgcolor=\"#ffffff\" id=\"tbReview" + rvs[j].Id + "-" + rvs[j].ItemForm.Id + "\" idReview=" + rvs[j].Id + " idUser="******" onmousedown=\"createMenuReview(" + rvs[j].Id + ", " + rvs[j].ItemForm.Id + ", " + r.ItemForm.Form.Id + "," + rvs[j].User.Id + ")\" ondblClick=\"EditReview( " + rvs[j].Id + "," + rvs[j].User.Id + "," + rvs[j].ItemForm.Id + ", " + r.ItemForm.Form.Id + " )\"  >";
                htm += "<TD width=\"520\" >" + rvs[j].ReviewSumary + "<input type=\"hidden\" id=\"hidReview" + rvs[j].Id + "-" + rvs[j].ItemForm.Id + "-" + r.ItemForm.Form.Id + "\" value='" + rvs[j].ReviewHTML + "'></TD>";
                htm += "<TD width=\"120\">" + rvs[j].User.Name + "</TD>";
                htm += "<TD width=\"80\" >" + rvs[j].Date.ToString("dd/MM/yyyy") + "</TD>";
                htm += "</TR>";
            }

            htm += "</TABLE>";

            Response.Write("<htm>");
            Response.Write(Server.HtmlEncode(htm));
            Response.Write("</htm>");

            for (int j = 0; j < rvs.Count; j++)
            {
                Response.Write("<review>");
                Response.Write(Server.HtmlEncode(rvs[j].Review));
                Response.Write("</review>");

                Response.Write("<idReviewForm>");
                Response.Write(Server.HtmlEncode(rvs[j].Id + ""));
                Response.Write("</idReviewForm>");

                Response.Write("<itemForm>");
                Response.Write(Server.HtmlEncode(rvs[j].ItemForm.Id + ""));
                Response.Write("</itemForm>");

                Response.Write("<idUser>");
                Response.Write(Server.HtmlEncode(rvs[j].User.Id + ""));
                Response.Write("</idUser>");
            }

            Response.Write("<countReview>");
            Response.Write(rvs.Count + "");
            Response.Write("</countReview>");

            closePageXML();
        }