示例#1
0
        private void insertProduct(product a)
        {
            product Product = new product();

            Product.product_name   = a.product_name;
            Product.product_detail = a.product_detail;
            Product.product_price  = a.product_price;
            Product.brand_id       = a.brand_id;
            Product.type_id        = a.type_id;
            using (ecommerceEntities db = new ecommerceEntities())
            {
                db.products.Add(Product);
                db.SaveChanges();
            }
        }
示例#2
0
        private void registerAccount(account a)
        {
            account Account = new account();

            Account.name            = a.name;
            Account.password        = a.password;
            Account.email_address   = a.email_address;
            Account.contact_number  = a.contact_number;
            Account.activation_code = a.activation_code;
            using (ecommerceEntities db = new ecommerceEntities())
            {
                db.accounts.Add(Account);
                db.SaveChanges();
                sendCode();
                //Response.Redirect("WebForm2.aspx?email_address="+txtEmail.Text);
            }
        }