private void btnAddEL_Click(object sender, RoutedEventArgs e) { EstudioLab E = new EstudioLab(); E.Motivo = txtorden.Text; dtgLabs.ItemsSource = null; dtgLabs.ItemsSource = CL.BusLab(); txtId2.Text = txtIdPac.Text; CEL.AddEL(int.Parse(txtId2.Text), int.Parse(txtIdlab.Text), E); }
public void AddEL(int IDP, int IDL, EstudioLab EL) { try { dsl = new DSL(); dsl.Open("DATA SOURCE = JARVIS; INITIAL CATALOG = PROYECTOINTEGRADOR; INTEGRATED SECURITY = YES", Proveedor.SQLServer); dsl.InitialSQLStatement("dbo.usp_AddEL", CommandType.StoredProcedure); dsl.SetParameterProcedure("@Idp", ParameterDirection.Input, eTypes.Entero, IDP); dsl.SetParameterProcedure("@Idl", ParameterDirection.Input, eTypes.Entero, IDL); dsl.SetParameterProcedure("@Motivo", ParameterDirection.Input, eTypes.Cadena, EL.Motivo); dsl.ExecuteNonQuery(); dsl.Close(); } catch (Exception e) { throw new Exception(e.Message, e); } finally { dsl = null; } }