示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LaximoMaster master = Page.Master as LaximoMaster;
            if (master != null)
            {
                ICatalog catalog = master.Catalog;

                GetCatalogInfo catalogInfo = master.CatalogProvider.GetCatalogInfo(catalog.Code, null, catalog.Ssd);
                catalog.Info = catalogInfo;

                if (catalogInfo.row.supportvinsearch)
                {
                    VinSearchForm vinSearchForm = new VinSearchForm(new VinSearchExtender(), catalog);

                    catalogPanel.Controls.Add(new LiteralControl(String.Format("<h1>{0}</h1>", vinSearchForm.GetLocalizedString("SearchByVIN"))));
                    catalogPanel.Controls.Add(vinSearchForm);
                    catalogPanel.Controls.Add(new LiteralControl("<br /><br />"));
                }
                if (catalogInfo.row.supportframesearch)
                {
                    FrameSearchForm frameSearchForm = new FrameSearchForm(new FrameSearchExtender(), catalog);

                    catalogPanel.Controls.Add(new LiteralControl(String.Format("<h1>{0}</h1>", frameSearchForm.GetLocalizedString("SearchByFrame"))));
                    catalogPanel.Controls.Add(frameSearchForm);
                    catalogPanel.Controls.Add(new LiteralControl("<br /><br />"));
                }
                if (catalogInfo.row.supportparameteridentifocation)
                {
                    WizardExtended wizard = new WizardExtended(new WizardExtender(), catalog);
                    wizard.WizardInfo = master.CatalogProvider.GetWizard(catalog.Code, string.Empty, string.Empty);

                    catalogPanel.Controls.Add(new LiteralControl(String.Format("<h1>{0}</h1>", wizard.GetLocalizedString("SearchByWizard"))));
                    catalogPanel.Controls.Add(wizard);
                    catalogPanel.Controls.Add(new LiteralControl("<br /><br />"));
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LaximoMaster master = Page.Master as LaximoMaster;
            if (master != null)
            {
                ICatalog catalog = master.Catalog;
                catalog.Info = master.CatalogProvider.GetCatalogInfo(catalog.Code, null, catalog.Ssd);

                VehicleInfo[] vehicleInfos;
                switch (FindType)
                {
                    case "findByVIN":
                        FindVehicleByVIN findVehicleByVin = master.CatalogProvider.FindVehicleByVIN(catalog.Code, Vin, null, catalog.Ssd);
                        vehicleInfos = findVehicleByVin.row;
                        break;
                    case "findByFrame":
                        FindVehicleByFrame findVehicleByFrame = master.CatalogProvider.FindVehicleByFrame(catalog.Code, Frame, FrameNo, null, catalog.Ssd);
                        vehicleInfos = findVehicleByFrame.row;
                        break;
                    case "findByWizard":
                        FindVehicleByWizard findVehicleByWizard = master.CatalogProvider.FindVehicleByWizard(catalog.Code, WizardId, null, catalog.Ssd);
                        vehicleInfos = findVehicleByWizard.row;
                        break;
                    default:
                        throw new ArgumentException(string.Format("Find type '{0}' is not supported", FindType));
                }

                VehiclesExtender extender = new VehiclesExtender();
                if (vehicleInfos == null || vehicleInfos.Length == 0)
                {
                    if (FindType.Equals("findByVIN"))
                    {
                        vehiclesPanel.Controls.Add(new LiteralControl(extender.GetLocalizedString("FINDFAILED", null, Vin)));
                    }
                    else
                    {
                        vehiclesPanel.Controls.Add(
                            new LiteralControl(extender.GetLocalizedString("FINDFAILED", null,
                                                                           String.Format("{0}-{1}", Frame, FrameNo))));
                    }
                }
                else
                {
                    VehiclesList vehiclesList = new VehiclesList(extender, catalog);
                    vehiclesList.QuickGroupsEnable = catalog.Info.row.supportquickgroups;
                    vehiclesList.Vehicles = vehicleInfos;

                    vehiclesPanel.Controls.Add(
                        new LiteralControl(String.Format("<h1>{0}</h1><br>", vehiclesList.GetLocalizedString("Cars"))));
                    vehiclesPanel.Controls.Add(vehiclesList);
                }

                if (catalog.Info.row.supportvinsearch)
                {
                    VinSearchForm vinSearchForm = new VinSearchForm(new VinSearchExtender(), catalog);
                    vinSearchForm.PreviousVin = Vin;

                    vehiclesPanel.Controls.Add(new LiteralControl(String.Format("<h1>{0}</h1>", vinSearchForm.GetLocalizedString("SearchByVIN"))));
                    vehiclesPanel.Controls.Add(vinSearchForm);
                    vehiclesPanel.Controls.Add(new LiteralControl("<br /><br />"));
                }

                if (catalog.Info.row.supportframesearch)
                {
                    FrameSearchForm frameSearchForm = new FrameSearchForm(new FrameSearchExtender(), catalog);
                    frameSearchForm.PreviousFrame = Frame;
                    frameSearchForm.PreviousFrameNo = FrameNo;

                    vehiclesPanel.Controls.Add(new LiteralControl(String.Format("<h1>{0}</h1>", frameSearchForm.GetLocalizedString("SearchByFrame"))));
                    vehiclesPanel.Controls.Add(frameSearchForm);
                    vehiclesPanel.Controls.Add(new LiteralControl("<br /><br />"));
                }
            }
        }