Ejemplo n.º 1
0
 public void Add(Product product)
 {
     using (MimariContext mimariContext = new MimariContext())
     {
         string sorgu = "Insert Into Product (ProductName,UnitPrice,QuantityPerUnit) Values (@ProductName,@UnitPrice,@QuantityPerUnit)";
         Dictionary <string, object> dictList = new Dictionary <string, object>();
         dictList.Add("@ProductName", product.ProductName);
         dictList.Add("@UnitPrice", product.UnitPrice);
         dictList.Add("@QuantityPerUnit", product.UnitsInStock);
         mimariContext.ExecNonQueryProc(sorgu, dictList);
     }
 }
Ejemplo n.º 2
0
 public void Update(Product product)
 {
     using (MimariContext mimariContext = new MimariContext())
     {
         string sorgu = "Update Product SET ProductName=@ProductName,UnitPrice=@UnitPrice,QuantityPerUnit=@QuantityPerUnit WHERE id=@id";
         Dictionary <string, object> dictList = new Dictionary <string, object>();
         dictList.Add("@ProductName", product.ProductName);
         dictList.Add("@UnitPrice", product.UnitPrice);
         dictList.Add("@QuantityPerUnit", product.UnitsInStock);
         dictList.Add("@id", product.ProductId);
         mimariContext.ExecNonQueryProc(sorgu, dictList);
     }
 }