예제 #1
0
        public void delete(dtosanpham k)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_delete_TT_SANPHAM", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@MASP", k.MASP));

            cmd.ExecuteNonQuery();

            closeC();
        }
예제 #2
0
        public void update(dtosanpham k)
        {
            openC();

            SqlCommand cmd = new SqlCommand("sp_update_TT_SANPHAM", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@MASP", k.MASP));
            cmd.Parameters.Add(new SqlParameter("@TENSP", k.TENSP));
            cmd.Parameters.Add(new SqlParameter("@DONGIA", k.DONGIA));
            cmd.Parameters.Add(new SqlParameter("@MADM", k.MADM));
            cmd.Parameters.Add(new SqlParameter("@MAHANGSX", k.MAHANGSX));
            cmd.Parameters.Add(new SqlParameter("@BAOHANH", k.BAOHANH));


            cmd.ExecuteNonQuery();

            closeC();
        }