using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; /// /// Summary description for TellimusteHaldus /// public class TellimusteHaldus { SqlConnection yhendus = new SqlConnection( ConfigurationManager.ConnectionStrings[ "yhendusTekst"].ConnectionString); ToodeteHaldus t = new ToodeteHaldus(); public TellimusteHaldus() { yhendus.Open(); } public void SalvestaTellimus(DataTable ostukorv) { SqlCommand cm = new SqlCommand("INSERT INTO Tellimused_tbl "+ "(KliendiID) VALUES(@KliendiID)", yhendus); } void SalvestaTellimuseToode(DataRow tooterida, int TellimuseNR) { int VanaTooteID = t.LeiaVanaToode( Convert.ToInt32(tooterida["TooteID"])); SqlCommand cm=new SqlCommand("INSERT INTO TellimusedTooted_tbl "+ " (TellimuseID, VanaTooteID, Kogus) "+ "VALUES(@TellimuseID, @VanaTooteID, @Kogus)",yhendus); cm.Parameters.AddWithValue("@TellimuseID", TellimuseNR); cm.Parameters.AddWithValue("@VanaTooteID", VanaTooteID); cm.Parameters.AddWithValue("@Kogus", Convert.ToInt32(tooterida["Kogus"])); cm.ExecuteNonQuery(); } }