Esempio n. 1
0
        public bool Insert(string loai, byte[] img, ref string err)
        {
            string sqlString = "Insert Into CATEGORY_SACH(Loai, Image) VALUES (@id,@img)";

            db.AddParameters("@id", SqlDbType.NChar, loai);
            db.AddParameters("@img", SqlDbType.Image, img);
            return(db.MyExecuteNonQuery(sqlString, CommandType.Text, ref err));
        }
Esempio n. 2
0
        public bool Insert(string maSP, string tenSP, string thuongHieu, string loai,
                           float giaSP, float giaTT, int rate, string idImage,
                           byte[] image1, byte[] image2, byte[] image3, byte[] image4, DateTime ngayThem, ref string err)
        {
            //Inert image
            string sqlStringImg = "Insert Into HINHANH_XE(IdImage, Image1, Image2, Image3, Image4) VALUES (@id,@img1,@img2,@img3,@img4)";

            db.AddParameters("@id", SqlDbType.NChar, maSP);
            db.AddParameters("@img1", SqlDbType.Image, image1);
            db.AddParameters("@img2", SqlDbType.Image, image2);
            db.AddParameters("@img3", SqlDbType.Image, image3);
            db.AddParameters("@img4", SqlDbType.Image, image4);

            if (!db.MyExecuteNonQuery(sqlStringImg, CommandType.Text, ref err))
            {
                return(false);
            }


            string sqlString = "Insert Into XE   Values(" + "N'" + maSP + "',N'" + tenSP + "',N'" + thuongHieu + "','" + loai
                               + "','" + giaSP + "','" + giaTT + "','" + rate + "','" + idImage + "','" + ngayThem + "')";

            return(db.MyExecuteNonQuery(sqlString, CommandType.Text, ref err));
        }