Beispiel #1
0
 protected override void WriteDetailCellValue(HtmlTextWriter writer, DetailInfo detail, string column, int visibility)
 {
     if (column.Equals("oem"))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Href, RmsAuto.Store.Cms.Routing.UrlManager.GetSearchManufacturersUrl(detail.oem, true));
         writer.RenderBeginTag(HtmlTextWriterTag.A);
         writer.Write(detail.oem);
         writer.RenderEndTag();
     }
     else if (column.Equals("tooltip"))
     {
         //<img src="'.$this->detailinfoimage.'" width="22" height="22">
         writer.AddAttribute(HtmlTextWriterAttribute.Src, DetailInfoImageUrl);
         writer.AddAttribute(HtmlTextWriterAttribute.Width, "22");
         writer.AddAttribute(HtmlTextWriterAttribute.Height, "22");
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();
     }
     else
     {
         base.WriteDetailCellValue(writer, detail, column, visibility);
     }
 }
Beispiel #2
0
 private static string GetDetailProperyValue(DetailInfo detail, string name)
 {
     PropertyInfo propertyInfo = detail.GetType().GetProperty(name);
     if(propertyInfo != null)
     {
         object value = propertyInfo.GetValue(detail, null);
         if (value != null)
             return value.ToString();
     }
     return string.Empty;
 }
Beispiel #3
0
        protected virtual void WriteItem(HtmlTextWriter writer, DetailInfo detail, int rowNo)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class,
                                String.Format("{0}g_collapsed g_highlight{1}{2}", RowClass,
                                              string.IsNullOrEmpty(detail.filter) ? string.Empty : " g_filter_row",
                                              string.IsNullOrEmpty(detail.flag) ? string.Empty : " g_nonstandarddetail"));
            writer.AddAttribute(HtmlTextWriterAttribute.Name,
                                !string.IsNullOrEmpty(detail.codeonimage)
                                    ? detail.codeonimage
                                    : String.Concat("d_", rowNo));
            writer.AddAttribute(HtmlTextWriterAttribute.Id, String.Concat("d_", rowNo));
            writer.AddAttribute("onmouseout", "hl(this, 'out');");
            writer.AddAttribute("onmouseover", "hl(this, 'in');");
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            foreach (KeyValuePair<string, int> pair in Columns)
            {
                WriteDetailCell(writer, detail, pair.Key.ToLower(), pair.Value);
            }

            writer.RenderEndTag();
        }
Beispiel #4
0
 protected virtual void WriteDetailCellValue(HtmlTextWriter writer, DetailInfo detail, string column, int visibility)
 {
     switch (column)
     {
         case "toggle":
             break;
         case "pnc":
             writer.Write(detail.codeonimage);
             break;
         case "oem":
             writer.Write(detail.oem);
             break;
         case "amount":
             writer.Write(detail.amount);
             break;
         case "name":
             writer.Write(string.Concat(" ",
                                        string.IsNullOrEmpty(detail.name)
                                            ? "Наименование не указано"
                                            : detail.name));
             break;
         case "cart":
             //<img class="g_addtocart" src="'.$this->cartimage.'" width="22" height="22">
             writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_addtocart");
             writer.AddAttribute(HtmlTextWriterAttribute.Src, CartImageUrl);
             writer.AddAttribute(HtmlTextWriterAttribute.Width, "22");
             writer.AddAttribute(HtmlTextWriterAttribute.Height, "22");
             writer.RenderBeginTag(HtmlTextWriterTag.Img);
             writer.RenderEndTag();
             break;
         case "price":
             writer.Write(!string.IsNullOrEmpty(detail.price) ? detail.price : "-");
             break;
         case "note":
             if(!string.IsNullOrEmpty(detail.note))
             {
                 writer.Write(detail.note.Replace("\n", "<br>"));
             }
             break;
         case "tooltip":
             //<img src="'.$this->detailinfoimage.'" width="22" height="22">
             writer.AddAttribute(HtmlTextWriterAttribute.Src, DetailInfoImageUrl);
             writer.AddAttribute(HtmlTextWriterAttribute.Width, "22");
             writer.AddAttribute(HtmlTextWriterAttribute.Height, "22");
             writer.RenderBeginTag(HtmlTextWriterTag.Img);
             writer.RenderEndTag();
             break;
         case "flag":
             if (!string.IsNullOrEmpty(detail.flag))
             {
                 int bits = Convert.ToInt32(detail.flag);
                 if ((bits & 1) > 0)
                 {
                     writer.Write("Нестандартная деталь");
                 }
             }
             break;
         case "availability":
             break;
         default:
             string value = GetDetailProperyValue(detail, column);
             if(!string.IsNullOrEmpty(value))
             {
                 writer.Write(value.Replace("\n", "<br>"));
             }
             break;
     }
 }
Beispiel #5
0
        protected virtual void WriteDetailCell(HtmlTextWriter writer, DetailInfo detail, string column, int visibility)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Name, string.Concat("c_", column));
            if((visibility & 1) == 0)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:none;");
            }
            if(column.Equals("tooltip"))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_rowdatahint");
            }
            else if((visibility & 2) > 0)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_ttd");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            WriteDetailCellValue(writer, detail, column, visibility);

            writer.RenderEndTag();
        }