Example #1
0
        protected void btnProceed_Click(object sender, EventArgs e)
        {
            try
            {
                Introduction objRequest = new Introduction();

                Response.Cookies["TOKEN"].Value = Guid.NewGuid().ToString();
                Response.Cookies["TOKEN"].Expires = DateTime.Now.AddDays(1);

                objRequest.ID = new Guid(Response.Cookies["TOKEN"].Value);
                objRequest.MOBILE = txtMobile.Text.Trim();
                objRequest.EMAIL = txtEmail.Text.Trim();

                objGLocation = new GeoLocation();
                objGLocation = GetUserIP();
                objRequest.IPADDRESS = objGLocation.ip;

                hdnOTP.Value = objWebsite.GenerateRandomNo(100000, 999999).ToString();
                objRequest.OTP = Convert.ToInt32(hdnOTP.Value);

                objWebsite.InsertWebsiteIntroduction(objRequest);

                divwelcmForm.Attributes.CssStyle.Add("display", "none");
                divOTP.Attributes.CssStyle.Add("display", "block");

                //TODO:Comment for beta and live
                Response.Redirect("/Default.aspx", false);
            }
            catch (Exception ex)
            {
                objWebsite.InsertWebsiteLog(Request.Cookies["TOKEN"].Value, "welcome.aspx.cs", "btnProceed_Click", "", ex.ToString());
            }
        }
Example #2
0
        public void InsertWebsiteIntroduction(Introduction objIntro)
        {
            int result = 0;
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[5];
                sqlParams[0] = new SqlParameter("@IPADDRESS", SqlDbType.VarChar);
                sqlParams[0].Value = objIntro.IPADDRESS;
                sqlParams[1] = new SqlParameter("@MOBILE", SqlDbType.VarChar);
                sqlParams[1].Value = objIntro.MOBILE;
                sqlParams[2] = new SqlParameter("@EMAIL", SqlDbType.VarChar);
                sqlParams[2].Value = objIntro.EMAIL;
                sqlParams[3] = new SqlParameter("@OTP", SqlDbType.VarChar);
                sqlParams[3].Value = objIntro.OTP;
                sqlParams[4] = new SqlParameter("@ID", SqlDbType.UniqueIdentifier);
                sqlParams[4].Value = objIntro.ID;

                result = CExecuteNonQuery("USP_INSERTWEBSITEINTRODUCTION", sqlParams);
            }
            catch (Exception ex)
            {
                InsertWebsiteLog(Common.TOKEN, "Website.cs", "InsertWebsiteIntroduction", JsonConvert.SerializeObject(objIntro), ex.ToString());
            }
        }