public static int Update(Product_Attripute p, int id) { string state = $"Update Product set Name = '{p.Name}', Price = {p.Price}, Description = '{p.Description}', Image_path = '{p.Image_path}', Promotion = '{p.Promotion}', Quantity = {p.Quantity}, Cat_Id= {p.Cat_Id} where P_Id = {id}"; return(Connection.ExecuteNonQuery(state)); }
public static int Insert(Product_Attripute p) { string state = $"insert into Product (Name, Price, Description, Image_path, Promotion, Quantity, Cat_Id) values ('{p.Name}', '{p.Price}', '{p.Description}', '{p.Image_path}', '{p.Promotion}', '{p.Quantity}', '{p.Cat_Id}')"; return(Connection.ExecuteNonQuery(state)); }