private void InitForm()
        {
            var manheimService = new ManheimService();

            _manheimData = manheimService.ManheimReport(_vehicleLookUp, SessionVar.CurrentDealer.DealerSetting.MainheimUserName, SessionVar.CurrentDealer.DealerSetting.MainheimPassword);
            BindEvents();

            cbbTrim.DataSource    = _manheimData;
            cbbTrim.DisplayMember = "TrimName";
            cbbTrim.ValueMember   = "TrimServiceId";

            if (cbbTrim.SelectedValue != null)
            {
                lblPriceBelow.Text   = _manheimData[0].LowestPrice.ToString();
                lblPriceAverage.Text = _manheimData[0].AveragePrice.ToString();
                lblPriceAbove.Text   = _manheimData[0].HighestPrice.ToString();

                var nationList = InitNationList();
                cbbRegion.DataSource    = nationList;
                cbbRegion.DisplayMember = "Value";
                cbbRegion.ValueMember   = "Key";

                ShowLoading();
                var worker = new BackgroundWorker();
                worker.DoWork             += worker_DoWork;
                worker.RunWorkerCompleted += worker_RunWorkerCompleted;
                worker.RunWorkerAsync();
            }
        }
        private List <ManheimTransactionViewModel> TrimInit()
        {
            var manheimService = new ManheimService();

            return(manheimService.GetManheimTransactions(_manheimData[0].Year.ToString(CultureInfo.InvariantCulture), _manheimData[0].MakeServiceId.ToString(CultureInfo.InvariantCulture),
                                                         _manheimData[0].ModelServiceId.ToString(CultureInfo.InvariantCulture),
                                                         _manheimData[0].TrimServiceId.ToString(CultureInfo.InvariantCulture), "NA"));
        }
        private void RegionChange()
        {
            var firstManheim = _manheimData.FirstOrDefault(i => i.TrimServiceId == int.Parse(cbbTrim.SelectedValue.ToString()));

            if (firstManheim != null)
            {
                var manheimService = new ManheimService();
                var data           = manheimService.GetManheimTransactions(firstManheim.Year.ToString(CultureInfo.InvariantCulture), firstManheim.MakeServiceId.ToString(CultureInfo.InvariantCulture),
                                                                           firstManheim.ModelServiceId.ToString(CultureInfo.InvariantCulture),
                                                                           firstManheim.TrimServiceId.ToString(CultureInfo.InvariantCulture),
                                                                           cbbRegion.SelectedValue.ToString());
                dgManheimDetail.DataSource = data;
            }
            HideLoading();
        }
Example #4
0
        public static List <ManheimWholesaleViewModel> ManheimData(string vin, string manheimUsername, string manheimPassword, IAuctionManagement manheimAuctionManagement)
        {
            var result = new List <ManheimWholesaleViewModel>();

            try
            {
                if (!string.IsNullOrEmpty(vin))
                {
                    var model = manheimAuctionManagement.GetVehicle(vin);

                    if (model.Mmr > 0 && model.MmrAbove > 0 && model.MmrBelow > 0)
                    {
                        var newRecord = new ManheimWholesaleViewModel()
                        {
                            LowestPrice  = (model.MmrBelow),
                            AveragePrice = (model.Mmr),
                            HighestPrice = (model.MmrAbove),
                            Year         = model.Year,
                            TrimName     = model.Trim
                        };
                        result.Add(newRecord);
                    }
                    else
                    {
                        //manheimService.ExecuteByVin(SessionHandler.User.Setting.Manheim, SessionHandler.User.Setting.ManheimPassword, vin.Trim());
                        var manheimService = new ManheimService();
                        result = manheimService.ManheimReport(model, manheimUsername, manheimPassword);
                    }
                }
                else
                {
                    result = new List <ManheimWholesaleViewModel>();
                }
            }
            catch (Exception)
            {
                result = new List <ManheimWholesaleViewModel>();
            }

            return(result);
        }
Example #5
0
        void manheimBrowser_NewWindowCreated(object sender, WebKit.NewWindowCreatedEventArgs e)
        {
            var manheimService = new ManheimService();
            var simulcastUrl   = ((WebKit.WebKitBrowser)(sender)).Url.AbsoluteUri;

            if (simulcastUrl.IndexOf("simulcast.manheim.com") > 0)
            {
                var simulcastInstallationUrl = "https://chrome.google.com/webstore/detail/manheim-media-player/ocdfcabeedcfbaoabffcbecdjdnepgcl";
                var url = "https://simulcast.manheim.com/simulcast/initBuyerAuction.do?vehicleGroupKey=a:CADE_s:76108_c:OPEN_l:1_v:1_q:1-43&vehicleGroupKey=a:CADE_s:76108_c:OPEN_l:1_v:1_q:76-900&vehicleGroupKey=a:CADE_s:76108_c:REDL_l:1_v:1_q:44-75&vehicleGroupKey=a:CADE_s:76108_c:OPEN_l:1_v:31_q:1-900&locale=en_US&isManheimAVPluginInstalled=false&CLIENT_TYPE=LIBERATOR";

                manheimService.LogOn(SessionVar.CurrentDealer.DealerSetting.MainheimUserName, SessionVar.CurrentDealer.DealerSetting.MainheimPassword);
                manheimService.WebRequestGet(simulcastUrl);
                try
                {
                    manheimService.PostSimulcastData(simulcastUrl, new SimulcastContract()
                    {
                        vehicleGroupGoto           = "a:CADE_s:76108_c:OPEN_l:1_v:1_q:1-43",
                        isManheimAVPluginInstalled = "false",
                        saleEventKey         = "CADE_76108_01",
                        vehicleGroupKey      = "a:CADE_s:76108_c:OPEN_l:1_v:31_q:1-900",
                        dealerships          = "5131094,a:CADE_s:76108_c:OPEN_l:1_v:1_q:1-43,a:CADE_s:76108_c:OPEN_l:1_v:1_q:76-900,a:CADE_s:76108_c:REDL_l:1_v:1_q:44-75,a:CADE_s:76108_c:OPEN_l:1_v:31_q:1-900",
                        initalDealer         = "CADE_s:76108_c:OPEN_l:1_v:1_q:1-43,a:CADE_s:76108_c:OPEN_l:1_v:1_q:76-900,a:CADE_s:76108_c:REDL_l:1_v:1_q:44-75,a:CADE_s:76108_c:OPEN_l:1_v:31_q:1-900",
                        email                = "*****@*****.**",
                        cellphoneNPA         = "714",
                        cellphoneNXX         = "348",
                        cellphoneStationCode = "8351",
                        faxNPA               = "714",
                        faxNXX               = "242",
                        faxStationCode       = "1875",
                        paymentMethod        = "CHECK",
                        postSaleInspection   = "7",
                        title                = "LOT",
                        transportation       = "DEALER",
                        transportContactName = "al american transport",
                        transportNPA         = "714",
                        transportNXX         = "400",
                        transportStationCode = "7057",
                        confirmPreferences   = "on"
                    });

                    url = manheimService.GetSimulcastUrl(manheimService.Result);
                }
                catch (Exception)
                {
                }

                manheimBrowser.IsScriptingEnabled             = true;
                manheimBrowser.IsWebBrowserContextMenuEnabled = true;
                manheimBrowser.Navigate(url);
            }
            else if (simulcastUrl.IndexOf("www.manheim.com/members/powersearch/redirect.do") > 0)
            {
                manheimService.LogOn(SessionVar.CurrentDealer.DealerSetting.MainheimUserName, SessionVar.CurrentDealer.DealerSetting.MainheimPassword);
                var content          = manheimService.WebRequestGet(simulcastUrl);
                var nextUrlPattern   = "onclick=\"javascript:window.open([^\\\"]*)\"";//"<input onclick=\"([^\\\"]*)\" onmousedown=\"([^\\\"]*)\" name=\"Enter Simulcast Sale\" type=\"button\" value=\"Enter Sale\" class=\"btnInput btnPrimary\" />";
                var authTokenPattern = new Regex(nextUrlPattern);
                var nextUrl          = authTokenPattern.Matches(content)[1].Value;
                nextUrl = nextUrl.Replace("(", "").Replace(")", "").Replace("\"", "").Replace("'", "").Replace(";", "").Replace(",", "").Replace("onclick=", "").Replace("javascript:window.open", "").Replace("simulcastDetail", "").Replace("return false", "");
                manheimBrowser.IsScriptingEnabled             = true;
                manheimBrowser.IsWebBrowserContextMenuEnabled = true;
                manheimBrowser.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36";
                manheimBrowser.Navigate(nextUrl);
            }
        }