public Boolean Guardar(EgresosCaja e) { SqlConnection con = Conexion.Instancia().conectar(); //SqlConnection con = new SqlConnection(Properties.Settings.Default.con); SqlCommand cmd = new SqlCommand("EgresoCaja_Insertar_PA", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter paramId = new SqlParameter("id", SqlDbType.Int); paramId.Direction = ParameterDirection.Output; cmd.Parameters.Add(paramId); cmd.Parameters.AddWithValue("descripcion", e.descripcion); cmd.Parameters.AddWithValue("monto", e.monto); cmd.Parameters.AddWithValue("fecha", e.fecha); con.Open(); cmd.ExecuteNonQuery(); con.Close(); e.id = (Int32)paramId.Value; return(true); }
public Boolean Guardar(EgresosCaja e) { EgresosCajaDAO dao = new EgresosCajaDAO(); return(dao.Guardar(e)); }