Пример #1
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            string link;
            if (type.Equals("quickgroup"))
            {
                link = String.Format("QuickGroups.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
            }
            else
            {
                ListCategoriesRow category = dataItem as ListCategoriesRow;
                if (category == null)
                {
                    throw new ArgumentException(String.Format("Expected type 'ListCategoriesRow'. Actual type is '{0}'.", renderer.GetType()));
                }
                link = String.Format("Vehicle.aspx?c={0}&vid={1}&cid={2}&ssd={3}", catalog.Code, catalog.VehicleId,
                                     category.categoryid,
                                     catalog.Ssd);
            }

            if (ItemId > 0)
            {
                link += string.Format("&ItemId={0}", ItemId);
            }

            return link;
        }
Пример #2
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            ListUnitsRow unit = dataItem as ListUnitsRow;
            if (unit == null)
            {
                throw new ArgumentException(String.Format("Expected type 'ListUnitsRow'. Actual type is '{0}'.", renderer.GetType()));
            }

            string link;

            if (type.Equals("filter"))
            {
                link = String.Format("UnitFilter.aspx?c={0}&vid={1}&uid={2}&cid={3}&ssd={4}&path_id={5}&f={6}",
                                     catalog.Code, catalog.VehicleId, unit.unitid, catalog.CategoryId, unit.ssd,
                                     catalog.PathId, HttpUtility.UrlEncode(unit.filter));
            }
            else
            {
                link = String.Format("Unit.aspx?c={0}&vid={1}&uid={2}&cid={3}&ssd={4}&path_id={5}",
                                     catalog.Code, catalog.VehicleId, unit.unitid, catalog.CategoryId, unit.ssd,
                                     catalog.PathId);
            }

            if (ItemId > 0)
            {
                link += string.Format("&ItemId={0}", ItemId);
            }

            return link;
        }
Пример #3
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            string link;
            if (type.Equals("vehicle"))
            {
                link = String.Format("Vehicle.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
            }
            else
            {
                t_row row = dataItem as t_row;
                if (row == null)
                {
                    throw new ArgumentException(String.Format("Expected type 't_row'. Actual type is '{0}'.",
                                                              dataItem.GetType()));
                }

                link = String.Format("QuickDetails.aspx?c={0}&gid={1}&vid={2}&ssd={3}", catalog.Code,
                                     row.quickgroupid, catalog.VehicleId, catalog.Ssd);
            }

            if (ItemId > 0)
            {
                link += string.Format("&ItemId={0}", ItemId);
            }

            return link;
        }
Пример #4
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            if (type.Equals("quickgroup"))
            {
                return String.Format("QuickGroups.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
            }

            //'window.alert('.FormatLocalizedString('SelectedDetail', $dataItem->oem).')'
            return String.Format("window.alert('{0}')", GetLocalizedString("SelectedDetail", renderer));//dataItem->oem - wtf?
        }
Пример #5
0
 public string GetLocalizedString(string name, GuayaquilTemplate renderer, params string[] p)
 {
     if (p != null && p.Length > 0)
     {
         // ReSharper disable AssignNullToNotNullAttribute
         return String.Format(Resources.Laximo.ResourceManager.GetString(name), p);
         // ReSharper restore AssignNullToNotNullAttribute
     }
     return Resources.Laximo.ResourceManager.GetString(name);
 }
Пример #6
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            GetWizard wizard = dataItem as GetWizard;
            if (wizard == null)
            {
                throw new ArgumentNullException("wizard");
            }

            return
                String.Format(
                    type.Equals("vehicles")
                        ? "Vehicles.aspx?ft=findByWizard&c={0}&wid={1}&ssd="
                        : "Wizard.aspx?c={0}&wizardid={1}&valueid=$valueid$&ssd=", catalog.Code, wizard.row[0].wizardid);
        }
Пример #7
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            ListCatalogsRow catalogsRow = dataItem as ListCatalogsRow;
            if (catalogsRow == null)
            {
                throw new ArgumentException(String.Format("Expected type 'ListCatalogsRow'. Actual type is '{0}'.", dataItem.GetType()));
            }

            string link = String.Format("Catalog.aspx?c={0}&ssd=", catalogsRow.code);
            if (catalogsRow.supportparameteridentifocation)
            {
                link += "&spi=t";
            }
            return link;
        }
Пример #8
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            VehicleInfo vehicleInfo = dataItem as VehicleInfo;
            if (vehicleInfo == null)
            {
                throw new ArgumentException(String.Format("Expected type 'VehicleInfo'. Actual type is '{0}'.", dataItem.GetType()));
            }

            VehiclesList vehiclesList = renderer as VehiclesList;
            if (vehiclesList == null)
            {
                throw new ArgumentException(String.Format("Expected type 'VehiclesList'. Actual type is '{0}'.", renderer.GetType()));
            }

            if (string.IsNullOrEmpty(vehicleInfo.PathData))
            {
                throw new ArgumentNullException("VehicleInfo.PathData");
            }

            string catalogCode = string.IsNullOrEmpty(catalog.Code) ? vehicleInfo.catalog : catalog.Code;

            string pathData = (vehicleInfo.PathData.Length > 300)
                                  ? vehicleInfo.PathData.Substring(0, 300)
                                  : vehicleInfo.PathData;

            string link = String.Format("{0}.aspx?c={1}&vid={2}&ssd={3}&path_data={4}",
                                        vehiclesList.QuickGroupsEnable ? "QuickGroups" : "Vehicle",
                                        catalogCode,
                                        vehicleInfo.vehicleid,
                                        vehicleInfo.ssd,
                                        HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.Default.GetBytes(pathData))));

            if (ItemId > 0)
            {
                link += string.Format("&ItemId={0}", ItemId);
            }

            return link;
        }
Пример #9
0
 public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
 {
     return String.Format("Vehicles.aspx?ft=findByVIN&c={0}&vin=$vin$&ssd=", catalog.Code);
 }
Пример #10
0
        public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
        {
            string link;
            switch (type)
            {
                case "vehicle":
                    link = String.Format("Vehicle.aspx?c={0}&vid={1}&ssd={2}", catalog.Code, catalog.VehicleId, catalog.Ssd);
                    break;
                case "category":
                    ListQuickDetailCategory category = dataItem as ListQuickDetailCategory;
                    if (category == null)
                    {
                        throw new ArgumentException(String.Format("Expected type 'ListQuickDetailCategory'. Actual type is '{0}'.",
                                                                                  dataItem.GetType()));
                    }
                    link = string.Format("Vehicle.aspx?c={0}&vid={1}&cid={2}&ssd={3}", catalog.Code,
                                         catalog.VehicleId, category.categoryid, catalog.Ssd);
                    break;
                case "unit":
                    ListQuickDetailCategoryUnit unit = dataItem as ListQuickDetailCategoryUnit;
                    if (unit == null)
                    {
                        throw new ArgumentException(String.Format("Expected type 'ListQuickDetailCategoryUnit'. Actual type is '{0}'.",
                                                                                  dataItem.GetType()));
                    }
                    StringBuilder sb = new StringBuilder();
                    Array.ForEach(unit.Detail, delegate(DetailInfo detail)
                    {
                        sb.AppendFormat("{0},", detail.codeonimage);
                    });
                    link = String.Format("Unit.aspx?c={0}&vid={1}&uid={2}&cid={3}&ssd={4}&coi={5}", catalog.Code,
                                         catalog.VehicleId, unit.unitid, catalog.CategoryId, unit.ssd,
                                         sb.ToString().TrimEnd(','));
                    break;
                case "detail":
                    QuickDetailsList quickDetailsList = renderer as QuickDetailsList;
                    if (quickDetailsList == null)
                    {
                        throw new ArgumentException(String.Format("Expected type 'QuickDetailsList'. Actual type is '{0}'.",
                                                                  dataItem.GetType()));
                    }
                    DetailInfo unitDetail = dataItem as DetailInfo;
                    if (unitDetail == null)
                    {
                        throw new ArgumentException(String.Format("Expected type 'ListQuickDetailCategoryUnitDetail'. Actual type is '{0}'.",
                                                                                  dataItem.GetType()));
                    }
                    link = String.Format("Unit.aspx?c={0}&vid={1}&uid={2}&cid={3}&coi={4}&ssd={5}", catalog.Code,
                                         catalog.VehicleId, quickDetailsList.CurrentUnit.unitid,
                                         catalog.CategoryId, unitDetail.codeonimage, unitDetail.ssd);

                    break;
                default:
                    throw new ArgumentException(String.Format("Type '{0}' is not supported", type));
            }
            if (ItemId > 0)
            {
                link += string.Format("&ItemId={0}", ItemId);
            }

            return link;
        }
Пример #11
0
 public override string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer)
 {
     return String.Format("Vehicles.aspx?ft=findByFrame&c={0}&frame=$frame$&frameNo=$frameno$", catalog.Code);
 }
Пример #12
0
 public abstract string FormatLink(string type, object dataItem, ICatalog catalog, GuayaquilTemplate renderer);