示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tbl_CustomerInfo atbl_CustomerInfo = new tbl_CustomerInfo();

            if (Session["username"] != null)
            {
                SqlConnection con = new SqlConnection(@"Data Source=SOJIB;Initial Catalog=WebshopManagement;User ID=sa;Password=sa987;MultipleActiveResultSets=True;Application Name=EntityFramework");
                con.Open();
                SqlCommand cmd = new SqlCommand("select * from tbl_CustomerInfo where Name = '" + Session["username"].ToString() + "' and Password = '******'", con);

                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataSet        ds = new DataSet();
                da.Fill(ds);
                DataTable dt = ds.Tables[0];
                con.Close();
                //Binding TextBox From dataTable
                txtName.Text    = Session["username"].ToString();
                txtEmail.Text   = dt.Rows[0]["Email"].ToString();
                txtAddress.Text = dt.Rows[0]["Address"].ToString();

                msg_Notice.Visible = true;

                msg_Notice.Text = "You can change your personal Info...";
            }


            lblAmount.Text = Session["Amount"].ToString();
        }
示例#2
0
        protected void btnSignUp_Click(object sender, EventArgs e)
        {
            tbl_CustomerInfo atbl_CustomerInfo = new tbl_CustomerInfo();

            atbl_CustomerInfo.Name     = txtName.Text;
            atbl_CustomerInfo.Password = txtPassword.Text;
            atbl_CustomerInfo.Email    = txtEmail.Text;
            atbl_CustomerInfo.Address  = txtAddress.Text;
            atbl_CustomerInfo.Phone    = txtPhone.Text;


            int count = (from emp in _context.tbl_CustomerInfo
                         where emp.Name == atbl_CustomerInfo.Name &&
                         emp.Password == atbl_CustomerInfo.Password
                         select emp.Name).Count();

            if (count > 0)
            {
                msg_lbl.Visible = true;
                msg_lbl.Text    = "User already exists!";
                return;
            }
            objCustomerSetup_BLL.SaveSignCustomer(atbl_CustomerInfo);
            msg_lbl.Visible = true;
            msg_lbl.Text    = "SignUp Successfully";

            txtName.Text     = "";
            txtPassword.Text = "";
            txtEmail.Text    = "";
            txtAddress.Text  = "";
            txtPhone.Text    = "";
        }
 internal int SaveSignCustomer(tbl_CustomerInfo atbl_CustomerInfo)
 {
     _context.tbl_CustomerInfo.Add(atbl_CustomerInfo);
     _context.SaveChanges();
     return(1);
 }
 internal int SaveSignCustomer(tbl_CustomerInfo atbl_CustomerInfo)
 {
     return(objCustomerSetup_DAL.SaveSignCustomer(atbl_CustomerInfo));
 }