public bool SaveSupplierPurchase(SupplierPurchase supplierPurchase) { string connectionString = dBConnection.ConnectionString; bool isAdd = false; SqlConnection sqlConnection = new SqlConnection(connectionString); string commandString = @"INSERT INTO SupplierPurchase(Date,BillNo,SupplierId) VALUES('" + supplierPurchase.Date + "','" + supplierPurchase.BillNo + "'," + "" + supplierPurchase.SupplierId + ")"; SqlCommand sqlCommand = new SqlCommand(commandString, sqlConnection); sqlConnection.Open(); int isExecute = sqlCommand.ExecuteNonQuery(); if (isExecute > 0) { isAdd = true; } sqlConnection.Close(); return(isAdd); }
public bool SaveSupplierPurchase(SupplierPurchase supplierPurchase) { return(_purchaseRepository.SaveSupplierPurchase(supplierPurchase)); }