Esempio n. 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["customerID"] == null)
     {
         loginSignsup.Visible = true;
         withUsername.Visible = false;
         if (!IsPostBack)
         {
             FillCategory();
         }
     }
     else
     {
         loginSignsup.Visible = false;
         withUsername.Visible = true;
         if (!IsPostBack)
         {
             FillCategory();
             dt = objaccess.GetCustomer(Convert.ToInt32(Session["CustomerID"]));
             if (dt.Rows.Count > 0)
             {
                 Label_Name.Text = dt.Rows[0]["UserName"].ToString();
                 //Label_userName.Text = dt.Rows[0]["memberid"].ToString();
             }
             dt = objdataaccess.GetDatatable("Select * from tbl_WalletBalance where CID=" + Session["CustomerID"].ToString());
             if (dt.Rows.Count > 0)
             {
                 label_WalletAmount.Text = dt.Rows[0]["Balance"].ToString();
             }
         }
     }
 }
    protected void txt_signup_Click(object sender, EventArgs e)
    {
        dt = objaccess.GetCustomerBymobile(txtMobile.Text);
        if (dt.Rows.Count == 0)
        {
            dt = objaccess.GetCustomer(Convert.ToInt32(Session["CustomerID"]));

            string ipaddress = GetIPAddress();
            objaccess.AddEditCustomerRegistration(0, txt_username.Text, txt_email.Text, txt_password.Text, ipaddress, txtMobile.Text, hidden_memberid.Value, txt_referralid.Text);
            dt = objaccess.GetLoginforbulk(txtMobile.Text, txt_password.Text);
            if (dt.Rows.Count > 0)
            {
                Session["CustomerID"] = Convert.ToString(dt.Rows[0]["CustomerID"]);
                objwallet.AddEditWalletAmount(0, "0", "0", "0", Session["CustomerID"].ToString());
                DataTable dtmemberdetails = objacc.GetDatatable("Select * from tblcustomer where customerID=" + dt.Rows[0]["CustomerID"].ToString());
                if (dtmemberdetails.Rows.Count > 0)
                {
                    string Message = "Registration Successfully with us. Your CUSTOMER ID IS : " + dtmemberdetails.Rows[0]["MemberID"].ToString() + " Share on Whatsapp and Facebook and Get 200 Points For Shopping Daily";
                    // SendSMS(dtmemberdetails.Rows[0]["Mobile_No"].ToString(), Message, dtmemberdetails.Rows[0]["MemberID"].ToString());
                }
            }

            ScriptManager.RegisterStartupScript(this, this.GetType(), "keykey", "alert(' Your Account Create Successfully !!!');location.replace('UserHome.aspx');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "keykey", "alert('You are Already Registered With mobile !!!');", true);
        }
    }
    protected void txt_signup_Click(object sender, EventArgs e)
    {
        #region signup
        dt = objaccess.GetCustomerBymobile(txtMobile.Text);
        if (dt.Rows.Count == 0)
        {
            string Referral = txt_referralid.Text == "" ? "WINSMART" : txt_referralid.Text;
            if (txt_referralid.Text != "")
            {
                Referral = txt_referralid.Text;
            }
            else
            {
                Referral = "WINSMART";
            }

            dt = objaccess.GetCustomer(Convert.ToInt32(Session["CustomerID"]));

            string ipaddress = GetIPAddress();
            objaccess.AddEditCustomerRegistration(0, txt_username.Text, txt_email.Text, txt_password.Text, ipaddress, txtMobile.Text, hidden_memberid.Value, Referral);
            fillcart();
            dt = objaccess.GetLoginforbulk(txtMobile.Text, txt_password.Text);
            if (dt.Rows.Count > 0)
            {
                Session["CustomerID"] = Convert.ToString(dt.Rows[0]["CustomerID"]);
                objwallet.AddEditWalletAmount(0, "0", "0", "0", Session["CustomerID"].ToString());
                fillcart();
                DataTable dtmemberdetails = objacc.GetDatatable("Select * from tblcustomer where customerID=" + dt.Rows[0]["CustomerID"].ToString());
                if (dtmemberdetails.Rows.Count > 0)
                {
                    string Message = "Registration Successfully with us. Your CUSTOMER ID IS : " + dtmemberdetails.Rows[0]["MemberID"].ToString() + " Share on Whatsapp and Facebook and Get 200 Points For Shopping Daily";
                    SendSMS(dtmemberdetails.Rows[0]["Mobile_No"].ToString(), Message, dtmemberdetails.Rows[0]["MemberID"].ToString());
                }
            }
            //Page.ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert(' Your Account Create Successfully !');window.location('UserLogin.aspx');</script>");

            ScriptManager.RegisterStartupScript(this, this.GetType(), "keykey", "alert(' Your Account Create Successfully !!!');location.replace('ViewCart.aspx');", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "keykey", "alert('You are Already Registered With mobile !!!');", true);
        }
        //}
        //else
        //{
        //    ScriptManager.RegisterStartupScript(this, this.GetType(), "keykey", "alert('Invalid Sponsor ID !!!');", true);
        //}


        #endregion
    }
Esempio n. 4
0
    public void network()
    {
        DataTable dt = objdataaccess.GetDatatable("Select * from tbl_WalletBalance where CID=" + Session["CustomerID"].ToString());

        if (dt.Rows.Count > 0)
        {
            lblwalletbonus.Text = "0";
            lblbonuspoint.Text  = dt.Rows[0]["Balance"].ToString();
        }
        dt = objcustomer.GetCustomer(Convert.ToInt32(Session["CustomerID"]));
        if (dt.Rows.Count > 0)
        {
            Session["memberid"] = dt.Rows[0]["memberid"].ToString();
            dt = objcustomer.getnetwork(Session["memberid"].ToString());
            rep_cart.DataSource = dt;
            rep_cart.DataBind();
        }
    }
    private void fillCustomer(int CustomerID)
    {
        DataTable dt = new DataTable();

        dt = objCustomer.GetCustomer(CustomerID);

        txtFirstName.Text = Convert.ToString(dt.Rows[0]["UserName"]);
        //   txtLastName.Text = Convert.ToString(dt.Rows[0]["LastName"]);
        txtEmail.Text      = Convert.ToString(dt.Rows[0]["Email"]);
        txtContactNo1.Text = Convert.ToString(dt.Rows[0]["Mobile_No"]);
        txtAddress.Text    = Convert.ToString(dt.Rows[0]["Address"]);
        txtPassword.Text   = Convert.ToString(dt.Rows[0]["Password"]);
        txtRePassword.Text = Convert.ToString(dt.Rows[0]["Password"]);
        txtZip.Text        = Convert.ToString(dt.Rows[0]["ZIP"]);
        txtCity.Text       = Convert.ToString(dt.Rows[0]["City"]);
        fillddlCountry();
        ddlCountry.SelectedValue = Convert.ToString(dt.Rows[0]["CountryID"]);
        fillddlState(Convert.ToInt32(ddlCountry.SelectedValue));
        ddlState.SelectedValue = Convert.ToString(dt.Rows[0]["StateID"]);
    }