public void InsertProduct(course.Business_Layer.product p) { db = new Db(); string insert = "insert into [product](product_name, product_description, product_pages, product_Text,product_image,product_brand,product_author,product_category,product_pdf,product_added,product_developer)" + " values('" + p.name + "','" + p.description + "','" + p.pages + "','" + p.text + "','" + p.image + "','" + p.type + "','" + p.author + "','" + p.category + "','" + p.pdf + "','" + p.added + "','" + p.developer + "')"; db.executecommand(insert); }
public int GetProductId(course.Business_Layer.product p) { db = new Db(); string sql = "SELECT Id" + "FROM product WHERE product_name='" + p.name + "'"; int d = db.executecommand(sql).ExecuteNonQuery(); return(d); }