using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Configuration; /// /// Summary description for CustomerDal /// public class CustomerDal { public CustomerDal() { // // TODO: Add constructor logic here // } static SqlConnection con =new SqlConnection( ConfigurationManager.ConnectionStrings["conn"].ToString()); internal static DataSet getProductData(string CenterID, string OrderID, string CustomerName, string Amount, string Status) { SqlDataAdapter da = new SqlDataAdapter("sp_Product", con); DataSet ds = new DataSet(); da.SelectCommand.CommandType = CommandType.StoredProcedure; //da.SelectCommand.Parameters.AddWithValue("@OrderID", OrderID); da.SelectCommand.Parameters.AddWithValue("@Type", "s"); da.Fill(ds); return ds; } //internal static DataSet UpdateProduct(string sts,string OrderID) //{ // SqlDataAdapter da = new SqlDataAdapter("sp_Product", con); // DataSet ds = new DataSet(); // da.SelectCommand.CommandType = CommandType.StoredProcedure; // da.SelectCommand.Parameters.AddWithValue("@Status", sts); // da.SelectCommand.Parameters.AddWithValue("@OrderID", OrderID); // da.SelectCommand.Parameters.AddWithValue("@Type", "u"); // da.Fill(ds,"test"); // return ds; //} internal static DataSet getProduct(string OrderID, string CenterID, string CustomerName, string Amount, string Status) { SqlDataAdapter da = new SqlDataAdapter("sp_Product",con); DataSet ds = new DataSet(); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.AddWithValue("@Type", "s"); da.Fill(ds); return ds; } internal static int GetUpdatedetails(string status, int orderid) { SqlCommand cmd = new SqlCommand("sp_Product", con); cmd.Parameters.AddWithValue("@Status", status); cmd.Parameters.AddWithValue("@OrderID", orderid); cmd.Parameters.AddWithValue("@Type", "u"); cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; con.Open(); try { return cmd.ExecuteNonQuery(); } catch{ throw; } finally { con.Close(); } } }