public int updateOrderInfo(cOrder newO) { //Create a connection SqlConnection conn = new SqlConnection(connStr); //The procedure I want to call SqlCommand cmd = new SqlCommand("usp_ADMIN_edit_order", conn); //Command type I want to execute cmd.CommandType = CommandType.StoredProcedure; try { conn.Open(); cmd.Parameters.AddWithValue("@orderID", newO.personID); cmd.Parameters.AddWithValue("@anstalldID", newO.anstalldID); cmd.Parameters.AddWithValue("@startTid", newO.startTid); cmd.Parameters.AddWithValue("@tjanstID", newO.tjanstID); return(cmd.ExecuteNonQuery()); } catch { throw; } finally { cmd.Dispose(); conn.Close(); conn.Dispose(); } }
protected void btnUppdatera_Click(object sender, EventArgs e) { AdminDAL aDAL = new AdminDAL(); cOrder o = new cOrder(); o.anstalldID = anstalldID(); o.tjanstID = tjanstID(); o.personID = lblID.Text; o.startTid = Convert.ToDateTime(tbStartTid.Text); aDAL.updateOrderInfo(o); FillOrdrar(); }
public void OnOrderReceived(cOrder newOrder) { myConsumer.orderQueue.Add(cOrder); }