Ejemplo n.º 1
0
 public static string BuildDealerUrl(Dealer dealer, Catalog catalog)
 {
     var url = string.Empty;
     if (Convert.ToInt32(catalog.CatalogYear) < 2015 || catalog.Brand == "Lincoln")
     {
         url = string.Format(@"http://www.mybrochureorder.com/qr/?model={0}&year={1}&brand={2}&dealerid={3}&zip={4}",
             catalog.ShortName, catalog.CatalogYear, catalog.Brand, dealer.DealerPa, dealer.DealerZip);
     }
     else if (Convert.ToInt32(catalog.CatalogYear) >= 2015 && catalog.Brand == "Ford")
     {
         url = string.Format(@"http://fbqr.co/{0}{1}", catalog.QRCodeName, dealer.DealerPa);
     }
     return url;
 }
Ejemplo n.º 2
0
        public bool SearchDealer(string id)
        {
            con             = new SqlConnection(Connection);
            cmd             = new SqlCommand();
            cmd.CommandText = string.Format("Select * from profile where Userid='{0}'", id);
            cmd.Connection  = con;
            con.Open();
            cmd.Connection = con;
            cmd.ExecuteNonQuery();
            reader = cmd.ExecuteReader();
            if (reader.Read())
            {
                if (string.IsNullOrWhiteSpace(reader[6].ToString()) && string.IsNullOrWhiteSpace(reader[5].ToString()))
                {
                    if (reader[7].ToString() == "Customer")
                    {
                        return(false);
                    }
                    dealer = new Dealer(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), 0, 0, reader[7].ToString(), reader[8].ToString(), reader[9].ToString());
                    //start from here...
                    //start from here.
                }
                else if (string.IsNullOrWhiteSpace(reader[6].ToString()))
                {
                    if (reader[7].ToString() == "Customer")
                    {
                        return(false);
                    }
                    dealer = new Dealer(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), Double.Parse(reader[5].ToString()), 0, reader[7].ToString(), reader[8].ToString(), reader[9].ToString());
                    //start from here...
                    //start from here.
                }
                else if (string.IsNullOrWhiteSpace(reader[5].ToString()))
                {
                    if (reader[7].ToString() == "Customer")
                    {
                        return(false);
                    }
                    dealer = new Dealer(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), 0, Double.Parse(reader[6].ToString()), reader[7].ToString(), reader[8].ToString(), reader[9].ToString());
                    //start from here...
                    //start from here.
                }
                else
                {
                    if (reader[7].ToString() == "Customer")
                    {
                        return(false);
                    }

                    dealer = new Dealer(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), Double.Parse(reader[5].ToString()), Double.Parse(reader[6].ToString()), reader[7].ToString(), reader[8].ToString(), reader[9].ToString());
                    //start from here...
                }

                return(true);
            }
            else
            {
                return(false);
            }

            con.Close();
        }