public class Product{private string ProductName;private string Price;public string productname{ get { return ProductName; } set { ProductName = value; }}public decimal price{ get { return Price; } set { Price = value; }}}
public class ProductImpl:IProduct{public void addProduct (Product oProduct){//Write code here to add the product info in database.//you will pass values to database from oProduct Object//For example//To fetch the productname,we will write//oProduct. productname}}
protected void btnSubmit_Click(object sender, EventArgs e){Product oProduct=new Product();oProduct. Productname=txtProductName.Text;oProduct .price=txtPrice.TextProductImpl oImpl=new ProductImpl();oImpl. addProduct (oProduct);}