Пример #1
0
        public ActionResult Register(string txtEmail, string txtConfirmEmail, string txtPassword, string txtConfirmPassword,string Button)
        {
            if (Button == "Create")
            {

                string strHostName = Dns.GetHostName(); //Get Host Name
                IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); //Got IP Address
                string strAddr = ipEntry.AddressList[2].ToString();
                //string url = "http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress=24.107.53.155";
                UserGeoLocator ul = new UserGeoLocator();
                UserLocationModel ulm = ul.GetUserLocation(strAddr);
                CustomerModel Customer = new CustomerModel();
                Customer.Email = txtEmail;
                Customer.Password = txtPassword;
                Customer.LastIPAddress = strAddr;
                //Customer.IsNew = false;
                Customer.Status = "I";
                Customer.LastCity = ulm.City;
                Customer.LastCountryName = ulm.CountryName;
                Customer.LastLatitude = ulm.Latitude;
                Customer.LastLongitude = ulm.Longitude;
                Customer.LastTimeZone = ulm.Timezone;
                Customer.LastZipCode = ulm.ZipPostalCode;
                //Customer.SignUpdate = DateTime.Now;
                CustomerDB.CreateCustomer(Customer);

                string EmailActivationURL = string.Format("http://*****:*****@RTDeals.com", "Account Activation", EmailActivationURL);

            }
            return View();
        }
Пример #2
0
        public static void CreateCustomer(CustomerModel Customer)
        {
            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "Insert into Customer(Email,Password,LastIPAddress,LastLongitude,LastLatitude,LastCity,LastZipCode,LastCountryName,LastTimeZone,status,SignUpdate,IsNew)" +
                    "values('" + Customer.Email + "','" + Customer.Password + "','" + Customer.LastIPAddress + "','" + Customer.LastLongitude + "','" + Customer.LastLatitude + "','" + Customer.LastCity + "','" + Customer.LastZipCode + "','" + Customer.LastCountryName + "','" + Customer.LastTimeZone + "','" + 'I' + "' , " + "NOW()" + " , '" + 1 + "')";
                cmd.CommandType = CommandType.Text;
                DB.ExecuteNonQuery(cmd);
            }
            catch (Exception e)
            {
                string s = e.Message;

            }
        }