Example #1
0
        public void AddProduct(int id_admin, int id_catalog, string name, int price, string detail, string image)
        {
            var Id_admin   = new SqlParameter("@id_admin", id_admin);
            var Id_catalog = new SqlParameter("@id_catalog", id_catalog);
            var Name       = new SqlParameter("@Name", name);
            var Price      = new SqlParameter("@price", price);
            var Detail     = new SqlParameter("@detail", detail);
            var Image      = new SqlParameter("@image", image);

            context.Database.ExecuteSqlCommand(@"THEMSP @id_admin,@id_catalog,@Name,@price,@detail,@image",
                                               Id_admin, Id_catalog, Name, Price, Detail, Image);
            context.SaveChanges();
        }
Example #2
0
        public void DangKyTK(string name, string email, string pass, string address, int phone)
        {
            var Name    = new SqlParameter("@name", name);
            var Email   = new SqlParameter("@email", email);
            var Pass    = new SqlParameter("@pass", pass);
            var Address = new SqlParameter("@address", address);
            var Phone   = new SqlParameter("@phone", phone);

            context.Database.ExecuteSqlCommand(@"DANGKY @name,@email,@pass,@address,@phone", Name, Email, Pass, Address, Phone);
            context.SaveChanges();
        }